react-code-generator

Generates React TypeScript project code from page, component, and API specification documents.

Updated Jun 5, 2026
One-click install
npx skills add https://github.com/fen-zx/NovelToScript --skill react-code-generator-fen-zx
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: react-code-generator
Source: https://github.com/fen-zx/NovelToScript/tree/main/.agents/skills/react-code-generator
Command: npx skills add https://github.com/fen-zx/NovelToScript --skill react-code-generator-fen-zx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing a full React frontend from design documents requires manually scaffolding pages, components, hooks, API layers, stores, and routes, which is repetitive and error-prone. This Skill converts specification documents directly into a complete, compilable React + TypeScript project structure. ## Core Features & Use Cases - Spec-Driven Code Generation: Reads PAGE_SPECS, COMPONENT_SPECS, and API_SPECS documents and generates pages, components, hooks, types, and routes accordingly. - Standardized Frontend Stack: Enforces a consistent architecture using Vite, React Router, Zustand, TanStack Query, React Hook Form, Zod, Shadcn UI, and Axios. - Built-in Best Practices: Automatically includes loading/error/empty states, JWT interceptors, query key management, permission guards, and file upload handling. - Use Case: Given an API spec with GET /scripts/:id and a page spec for a script editor, generate the full src/ directory including ScriptEditorPage, SceneList component, useScript hook, typed API functions, and route definitions. ## Quick Start Ask the AI to generate a complete React TypeScript project from your PAGE_SPECS.md, COMPONENT_SPECS.md, and API_SPECS.md documents.

Frequently Asked Questions about react-code-generator

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

FAQPage Schema
How do I generate React code from API specifications?▼

Provide API_SPECS defining endpoints like GET /scripts/:id, and the generator creates typed Axios functions, TanStack Query hooks with query keys, and TypeScript interfaces for each endpoint. Each API gets its own function rather than scattered fetch calls.

What state management does this React generator use?▼

It uses Zustand for client-side global state like user info, theme, and selected items, and TanStack Query for all server data. Redux and MobX are explicitly prohibited, and server data must never be placed in Zustand.

Does the generated code support form validation?▼

Yes, forms are generated with React Hook Form combined with Zod schemas via zodResolver. This replaces manual useState-based form management and provides type-safe validation out of the box.

Can I use class components or Redux with this generator?▼

No, class components, Redux, and MobX are explicitly forbidden. The generator only produces function components with hooks, TypeScript strict mode, and the fixed stack of Zustand plus TanStack Query.

What happens when the specification is missing fields?▼

Unknown or unspecified fields are marked with TODO comments in the generated code rather than being guessed. The output is still required to be compilable TypeScript under strict mode.