In the Skill's Own Terms
The skill covers @json-render/ink, an Ink terminal renderer that turns JSON specs into interactive terminal component trees with data binding, visibility, actions and dynamic props. It walks through defining a catalog from the Ink schema with zod, registering only custom components in a registry, and rendering with Renderer inside JSONUIProvider, or the higher-level createRenderer and standardComponents.
Readers learn the flat element map spec format with a root key, the standard layout, content and interactive component sets, state and binding expressions, the event system and built-in setState, pushState and removeState actions, repeat lists, JSONL streaming via useUIStream, provider roles, key exports, and terminal design guidelines such as 80-120 column width.
What it produces
- An interactive terminal component tree rendered from the JSON spec.
- An AI system prompt generated from the catalog for spec authoring.
- A framework-agnostic in-memory StateStore that drives re-renders.
How It Works
- 01Define a Catalog from the Ink Schema
Import defineCatalog from @json-render/core and pass the Ink schema together with the component and action definitions you want to allow.
- 02Register Only Your Custom Components
defineRegistry takes the catalog, but the standard component implementations are already built in, so only custom ones are mapped to Ink elements.
- 03Wrap the Renderer in Providers
JSONUIProvider supplies the state, visibility, action and focus contexts to the Renderer, which receives the spec and the registry.
- 04Author Specs as a Flat Element Map
The spec carries a root key naming the first element and an elements map of typed nodes with props, children and optional event bindings.
- 05Bind Props with Expressions
Any prop value can resolve at render time from state, repeat items, conditions or string templates instead of being hard coded.
- 06Stream Specs Progressively
useUIStream consumes JSONL patch streams from an API endpoint and exposes spec, send and isStreaming to the caller.