codegen

Transforms UI trees from json-render specs into framework-ready JSX/TSX source code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Code generation from UI specifications often becomes error-prone, hard to traverse, and inconsistent across projects; this Skill solves that by providing deterministic utilities to analyze and serialize json-render UI trees into code.

Core Features & Use Cases

  • Spec traversal: Walk json-render UI trees depth-first to inspect element types and structure for downstream generation.
  • Discovery utilities: Collect referenced component types, state paths, and action names so generated code includes only what’s actually used.
  • Code-ready serialization: Serialize props and state-bound values into JSX-friendly attribute syntax, including safe string escaping and configurable quoting.

Quick Start

Use the codegen skill to generate Next.js components and exporters by traversing your json-render spec, collecting used components and state/action references, and serializing props into framework-safe source code.

Frequently Asked Questions about codegen

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

FAQPage Schema
How do I generate React components from a JSON UI spec?

To generate React components from a JSON UI spec, traverse the json-render UI tree depth-first, collect referenced component types and state paths, and serialize props into framework-safe JSX syntax.

Can I generate Next.js and Remix source code from json-render specs?

Yes, you can generate Next.js and Remix source code by traversing json-render UI trees and serializing props, state references, and actions into consistent TSX output across different framework targets.

What is the best way to serialize state references into JSX attributes?

The best way to serialize state references into JSX attributes is to apply deterministic serialization rules for JSX attributes, state path syntax, and safe string escaping with configurable quoting.

How do I collect used component types and actions during UI tree traversal?

You collect used component types and actions by applying discovery utilities during depth-first spec traversal, ensuring generated code includes only the component types, state paths, and action names actually used.

Does code generation from UI specs require specific dependencies?

Code generation from UI specs requires no external dependencies, relying solely on deterministic traversal and collection utilities to analyze json-render UI trees and serialize props into source code.

Why does my generated JSX output include unused state paths and components?

Generated JSX output includes unused state paths when discovery utilities are not applied to filter references during spec traversal, causing the exported code to miss collecting only what is actually used.