core

Define JSON-render schemas and catalogs for AI-generated specs.

6|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/memoirlabs/mog --skill core-memoirlabs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: core
Source: https://github.com/memoirlabs/mog/tree/main/.agents/skills/core
Command: npx skills add https://github.com/memoirlabs/mog --skill core-memoirlabs

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about core

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I constrain AI-generated JSON specs for UI rendering?

To constrain AI-generated JSON specs for UI rendering, define strict schemas and catalogs that enforce the exact structure your output must follow. This ensures the AI-generated JSON matches your required component shapes, props, and visibility rules.

How do I stream JSONL patch compilations for AI-assisted spec authoring?

Streaming JSONL patch compilations for AI-assisted spec authoring is handled using SpecStream utilities. These tools incrementally build or patch JSON specs by processing JSONL chunks from the model into a final validated structure.

What is the best way to make JSON render specs react to runtime state?

Making JSON render specs react to runtime state requires using state-aware dynamic props like $state, $bindState, $computed, and $cond. You integrate external state stores via a StateStore interface to drive conditional visibility and prop values.

How do I validate and auto-fix AI-generated JSON specs?

Validating and auto-fixing AI-generated JSON specs is done using built-in validation functions. You apply validateSpec to check structure against your schema and autoFixSpec to automatically correct mismatched fields and enforce declared rules.

Can I generate AI system prompts from a catalog of UI components?

Generating AI system prompts from a catalog of UI components is supported using defineCatalog. This makes components and actions discoverable and automatically converts them into consistent AI prompts constrained to your schema.

Does this schema validation approach work with TypeScript projects?

Yes, this schema validation approach works directly within TypeScript projects. It provides typed schema definition, state-store integration primitives, and streaming compilation utilities designed for TypeScript-based UI and video-like render workflows.