yaml
YAML wire format for json-render with streaming parser, prompt generation, and AI SDK transform. Use when working with @json-render/yaml, YAML-based spec streaming, yaml-spec/yaml-edit fences, or YAML prompt generation.
By vercel-labs · 871 installs
npx skills add vercel-labs/json-render --skill yaml
Source repository · Upstream listing
@json render/yaml
YAML wire format for @json render/core . Progressive rendering and surgical edits via streaming YAML.
Key Concepts
YAML wire format : Alternative to JSONL that uses code fences ( yaml spec , yaml edit , yaml patch , diff )
Streaming parser : Incrementally parses YAML, emits JSON Patch operations via diffing
Edit modes : Patch (RFC 6902), merge (RFC 7396), and unified diff
AI SDK transform : TransformStream that converts YAML fences into json render patches
Generating YAML Prompts
Options:
system (string) — Custom system message intro
mode ("standalone" "inline") — Output mode, default "standalone"
customRules (string[]) — Additional rules appended to prompt
editModes (EditMode[]) — Edit modes to document, default ["merge"]
AI SDK Transform
Use pipeYamlRender as a drop in replacement for pipeJsonRender :
For multi turn edits, pass the previous spec:
The transform recognizes four fence types:
yaml spec — Full spec, parsed progressively line by line
yaml edit — Partial YAML deep merged with current spec (RFC 7396)
yaml patch — RFC 6902 JSON Patch lines
diff — Unified diff applied to serialized spec
Streaming Parser (Low Level)
Methods: push(chunk) , flush() , getResult() , getPatches() , reset(initial?)
Edit Modes (from @json render/core)
The YAML package uses the universal edit mode system from core:
Fence Constants
For custom parsing, use the exported constants:
yaml spec"
YAML EDIT FENCE, // " yaml patch"
DIFF FENCE, // " "
} from "@json render/yaml";
Key Exports
Export Description
yamlPrompt Generate YAML system prompt from catalog
createYamlTransform AI SDK TransformStream for YAML fences
pipeYamlRender Convenience pipe wrapper (replaces pipeJsonRender )
createYamlStreamCompiler Streaming YAML parser with patch emission
YAML SPEC FENCE Fence constant for yaml spec
YAML EDIT FENCE Fence constant for yaml edit
YAML PATCH FENCE Fence constant for yaml patch
DIFF FENCE Fence constant for diff
FENCE CLOSE Fence close constant
diffToPatches Re export: object diff to JSON Patch
deepMergeSpec Re export: RFC 7396 deep merge