What problem does it solve?
Core package for defining JSON-render schemas, building catalogs, and generating AI-ready prompts that produce output matching a strict JSON spec shape.
Core Features & Use Cases
- Schema definition with contracts: Use defineSchema to declare the exact structure your specs and catalogs must follow.
- Catalog-driven prompting: Use defineCatalog so components and actions are discoverable and converted into consistent AI system prompts.
- Streaming spec construction: Use SpecStream utilities to incrementally build or patch JSON specs via JSONL chunks.
- State-aware dynamic props: Use $state, $bindState, $template, $computed, $cond, and visibility conditions to make rendered specs react to runtime state.
- Guardrails via validation: Validate and auto-fix specs with validateSpec and autoFixSpec, and enforce field rules with built-in validators.
- Edit/transform workflows: Generate prompts for patch/merge/diff edits and convert AI output into structured refinement instructions.
- State integration: Plug external state stores via a StateStore interface or use the in-memory createStateStore helper.
Example: define a catalog for UI components (e.g., Button, Input), generate the AI prompt constrained to your schema, stream patches from the model into a final spec, then render with state-bound props and conditional visibility.
Quick Start
Use the core skill to define a schema and catalog, then generate AI prompts that constrain outputs to your JSON-render spec and stream them into a validated final spec.