SchemasArtifactsShared schemas
ContentRefLast updated on
Last updated on
Inline text or file-backed content reference
A ContentRef attaches reference content to any artifact. It is a discriminated union keyed on kind:
type ContentRef = InlineContentRef | FileContentRefContentRef is used by two optional fields on ArtifactBase (available on all artifact kinds):
| Field | Purpose |
|---|---|
instructions | Domain or compliance reference content (e.g., IRS instructions, regulatory guidance) |
agentInstructions | LLM/agent prompts for field ordering, grouping, tone, and presentation guidance |
ContentRef Types
InlineContentRef
Inline content with embedded text. Use when the content is short enough to live directly in the artifact definition.
kind: 'inline'
Discriminator for inline content
text: string
The text content (max 1,000,000 characters)
FileContentRef
File-backed content reference. Use when the content is large or maintained separately (e.g., a Markdown document alongside the artifact file).
kind: 'file'
Discriminator for file content
path: string
Relative path to the content file from the artifact directory
mimeType: string
MIME type of the file content (e.g., text/markdown, text/plain)
title?: string
Human-readable title
description?: string
Description of the content
checksum?: string
SHA-256 checksum for integrity verification (format: sha256:<64 hex chars>)
Checksums
The checksum field is optional in the schema but recommended for file-backed content references. When present, the CLI verifies integrity during validate and add.
- Format:
sha256:followed by 64 lowercase hex characters - Use
ofm fixto compute or update checksums automatically - The CLI refuses to download file-backed content references from a registry without a checksum
Examples
# Inline instructions (short text)
instructions:
kind: inline
text: |
Complete all fields. Landlord and tenant must both sign.
Monthly rent is due on the first of each month.
# File-backed instructions (large document)
instructions:
kind: file
path: ./instructions.md
mimeType: text/markdown
title: Form Instructions
checksum: sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
# Agent instructions (inline)
agentInstructions:
kind: inline
text: |
Present fields in this order: parties first, then property
details, then financial terms. Use formal tone.CLI Support
| Command | Behavior |
|---|---|
validate | Checks file existence and verifies checksums for file-backed content references |
fix | Computes or updates checksums for file-backed content references |
add | Automatically downloads file-backed content reference files from the registry |
show | Displays content reference info; --deps lists referenced files |
attach | Attaches a file as instructions or agent instructions (--as instructions) |
detach | Removes a content reference from an artifact |
Related
- Artifact Base Properties - Base fields shared by all artifact kinds
- Layer - Rendering output specification (similar file/inline pattern)