OpenForm
SchemasArtifactsShared schemas

ContentRef

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 | FileContentRef

ContentRef is used by two optional fields on ArtifactBase (available on all artifact kinds):

FieldPurpose
instructionsDomain or compliance reference content (e.g., IRS instructions, regulatory guidance)
agentInstructionsLLM/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 fix to 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

CommandBehavior
validateChecks file existence and verifies checksums for file-backed content references
fixComputes or updates checksums for file-backed content references
addAutomatically downloads file-backed content reference files from the registry
showDisplays content reference info; --deps lists referenced files
attachAttaches a file as instructions or agent instructions (--as instructions)
detachRemoves a content reference from an artifact

Related

On this page