Skip to main content
skill CX Codex

react-19-component-scaffolder — Claude Code skill

react-19-component-scaffolder scaffolds TypeScript files for React 19 components and related code. Use it to start a page, form, hook, or other common project structure from a template.

MIT 174 installs ★ 227 updated 2026-08-15

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add pproenca/dot-skills --skill react-19-component-scaffolder -a claude-code
Open on GitHub

What react-19-component-scaffolder does

The skill generates function components, Server Component pages, client islands, forms built around useActionState, context providers, custom hooks, reducers, and files for document metadata and resource hints. An unqualified component request uses the function-component template; if the request could match several templates, the skill asks which one to use.

Templates can include tests, and the form template creates actions.ts and schema.ts files using Zod. Generated patterns use React 19 conventions, such as accepting ref as a prop and rendering Context directly as a provider. Configure project paths in config.json before generating into a nonstandard layout: the defaults assume a src/-rooted project.

What it helps with

  • scaffold a React 19 component with a test file
  • create a Server Component page with data fetching and Suspense
  • build a form with useActionState and a Zod schema
  • set up shared state with a context provider or typed reducer
  • add a hook that subscribes to external state

Example prompts for the agent

  • Create a UserCard component with a test and name and role props.
  • Add a Server Component page with data fetching and metadata.
  • Build a registration form using useActionState and a Zod schema.

How to install react-19-component-scaffolder

1Skills CLI (Vercel)

npx skills add pproenca/dot-skills --skill react-19-component-scaffolder -a claude-code

2Manually: put the files in place

~/.claude/skills/react-19-component-scaffolder/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/react-19-component-scaffolder/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about react-19-component-scaffolder

How do I install react-19-component-scaffolder in Claude Code?

Run npx skills add pproenca/dot-skills --skill react-19-component-scaffolder -a claude-code. Check for ~/.claude/skills/react-19-component-scaffolder/SKILL.md.

What does react-19-component-scaffolder do?

It generates template-based files for React 19 components, pages, forms, hooks, and other common structures. The templates apply conventions for refs, Context, and form actions.

What should I configure before generating files?

Set the project paths in config.json on first use. For a custom component directory, set module_path; page and hook locations use route_path and hooks_path.

Source text

SKILL.md · MIT
---
name: react-19-component-scaffolder
description: Scaffolds React 19 / React 19.2 code in TypeScript — components, Server Component pages, client islands, form actions with useActionState, context providers, custom hooks, reducers, or document metadata + resource hints. Generates production-grade code that follows React 19 idioms (ref-as-prop, <Context value={...}>, useActionState, inline metadata, useSyncExternalStore) and refuses deprecated React 18 patterns (forwardRef, <Context.Provider>, useFormState, react-dom/test-utils). Trigger even when the user says "create a component", "new page", "add a form", "new hook", or "scaffold X" without explicitly mentioning React 19.
---
# React 19 Component Scaffolder

Generate React 19/19.2 components, pages, hooks, and supporting files from parameterized templates. Every template enforces the patterns codified in the sibling `react` skill — refs as regular props (never `forwardRef`), Context rendered directly as provider (never `.Provider`), form actions with `useActionState` + `useFormStatus`, inline document metadata, `useSyncExternalStore` for external subscriptions, and YMNNAE-compliant hook bodies.

## When to Apply

- Creating a new React component (Server, Client, or unspecified — defaults to Server)
- Adding a new route/page in a React 19 app
- Building a form that needs progressive enhancement, optimistic UI, or pending state
- Setting up a new Context provider with state + dispatch split
- Writing a custom hook that subscribes to external state or wraps async work
- Modeling complex state with a typed reducer
- Adding document metadata (`<title>`, `<meta>`, `<link>`) or resource hints (`preload`, `preconnect`, `prefetchDNS`)
- The user says "scaffold", "boilerplate", "generate", "new component", "new page", "new hook", or names any of the template types

## Available Templates

All filenames are kebab-case; the exported React identifier (`{Name}`, `use{Name}`) is PascalCase / camelCase.

| # | Template | When to use | Files generated |
|---|----------|-------------|-----------------|
| 1 | [function-component](assets/templates/function-component.tsx.template) | Generic reusable component (works in Server or Client) | `{name-kebab}.tsx`, `{name-kebab}.test.tsx` |
| 2 | [server-component-page](assets/templates/server-component-page.tsx.template) | Route page with server data fetch + Suspense + metadata | `page.tsx` |
| 3 | [client-island](assets/templates/client-island.tsx.template) | `'use client'` interactivity nested inside a server page | `{name-kebab}-island.tsx`, `{name-kebab}-island.test.tsx` |
| 4 | [form-action](assets/templates/form-action.tsx.template) | Mutation form with `useActionState` + Zod schema + server action | `{name-kebab}-form.tsx`, `actions.ts`, `schema.ts` |
| 5 | [context-provider](assets/templates/context-provider.tsx.template) | Shared state with state/dispatch split and accessor hook | `{name-kebab}-context.tsx` |
| 6 | [custom-hook](assets/templates/custom-hook.ts.template) | YMNNAE-compliant hook (external subscription or composed effect) | `use-{name-kebab}.ts`, `use-{name-kebab}.test.ts` |
| 7 | [reducer](assets/templates/reducer.ts.template) | Typed reducer with discriminated-union actions + exhaustive switch | `{name-kebab}-reducer.ts`, `{name-kebab}-reducer.test.ts` |
| 8 | [head-and-hints](assets/templates/head-and-hints.tsx.template) | Document metadata + resource hints for above-the-fold assets | `{name-kebab}-head.tsx` |

## How to Use

1. **Identify the template** that matches the user's request. If ambiguous, ask. Default to `function-component` for unqualified "make me a component" requests.
2. **Read the template** at `assets/templates/{name}.template`.
3. **Read the related conventions** at `references/conventions.md` — every template emits code that obeys these conventions.
4. **Collect parameters** (see "Parameters" below). Ask the user only for parameters you cannot infer from context.
5. **Substitute placeholders** in the template. Every placeholder is wrapped in `{curly_braces}`. Empty placeholders (e.g., `{additional_hooks}` when there are none) collapse to empty string.
6. **Write each output file** using the Write tool. Use the path conventions in `config.json` (`module_path`, `route_path`).
7. **Mention the conventions enforced** so the user understands why the generated code looks the way it does (e.g., "I used `ref` as a prop rather than `forwardRef` because…").

## Parameters

Common parameters (most templates accept these):

| Parameter | Required | Default | Description |
|-----------|----------|---------|-------------|
| `name` | yes | — | Component / hook / reducer identifier in PascalCase (or camelCase for hooks/reducers). The scaffolder derives `file_name` (kebab-case) and `name_kebab` automatically. |
| `module_path` | no | `src/components` (or from `config.json`) | Directory under the project root for the generated files |
| `props` | no | `[]` | List of `{name, type, required}` — emitted as the props interface |
| `with_test` | no | `true` | Generate the matching `*.test.tsx` / `*.test.ts` file |
| `with_ref` | no | `false` | Add `ref?: Ref<T>` to props (templates 1 and 3) |

Template-specific parameters are documented in each template's leading comments.

## Setup

On first use, populate `config.json` with project-specific paths so generated files land in the right place. The defaults assume a standard `src/`-rooted project. To override interactively:

- `module_path` — Where components live (e.g., `src/components`, `app/_components`)
- `route_path` — Where Server Component pages live (e.g., `app/`, `src/routes/`)
- `hooks_path` — Where custom hooks live (e.g., `src/hooks`)
- `test_runner` — `vitest` (default) or `jest` (changes the imports in test templates)

## Conforming Existing Code (Multi-File Refactor)

When the user asks to **conform, modernize, or align existing components with this skill's conventions** across one or more files — not to generate new code — follow [`references/_conform-algorithm.md`](references/_conform-algorithm.md) instead of going file-by-file.

Two non-negotiables from that doc:

1. **Judgment over grep.** Every convention is keyed off a syntactic marker (`forwardRef`, `<Context.Provider>`, `react-helmet`, `onSubmit=`, `react-dom/test-utils`). Grep finds the easy cases and *misses* the disguised ones — a manually drilled callback ref because the author dodged `forwardRef`, a bespoke `useState({ pending, error })` that's `useActionState` without the name, a `document.title` hand-roll. Use grep for inventory and post-hoc completeness only, never as the primary detector.
2. **Convention-major, not file-major.** Load all target files first, then sweep one convention at a time across all files in priority order (refs/context/forms first, naming/imports last). Reports group by convention, surfacing cross-file clusters.

For brand-new scaffolds, skip this — go straight to a template.

## React 19 Patterns This Skill Refuses to Generate

- `forwardRef(...)` wrappers — emits `function Name({ ref, ...props })` instead
- `<Context.Provider value={...}>` — emits `<Context value={...}>` instead
- `useFormState` — emits `useActionState` instead
- `onSubmit` handlers for mutations — emits `<form action={serverAction}>` instead
- `useRef<T>()` without an argument — emits `useRef<T>(null)`
- `useEffect` for derived state, parent notification, or POST-on-state-change — refuses entirely (see [conventions: State derivation](references/conventions.md))
- `react-dom/test-utils` — emits `import { act } from '@testing-library/react'` instead
- Manual `<link rel="preload">` JSX — emits `preload()` from `react-dom` instead
- `react-helmet` / `react-helmet-async` — emits inline `<title>`/`<meta>`/`<link>` instead

## Gotchas

See [gotchas.md](gotchas.md). Empty on first release — gotchas accumulate as the skill is used.

## Related Skills

- [`react`](../react/SKILL.md) — Authoritative React 19 best-practices distillation (44 rules). The templates in this skill emit code that conforms to those rules.

© pproenca · MIT · pproenca/dot-skills

Similar skills

All skills for Frontend and UI →
project-scaffolder patricio0312rev project-scaffolder scaffolds complete starter repositories for web and API frameworks with configs, tooling, working baseline routes, and setup guides. CX Codex +1 287installs react-component-architecture aj-geddes react-component-architecture — a skill that tells your coding agent how to structure React components: function components, hooks, composition and TypeScript. Useful once a shared component library starts growing. CX Codex +1 687installs webflow-code-component:local-dev-setup webflow webflow-code-component:local-dev-setup is a skill that scaffolds a fresh Webflow Code Components project with folders, dependencies, webflow.json, and a starter component. CX Codex +1 1,000installs react-container-presentation-component official github The react-container-presentation-component skill scaffolds React components with the Container/Presentation pattern and follows the project’s TypeScript, Storybook, and SCSS conventions. CX Codex +1 65installs react-component-generator OneWave-AI react-component-generator — a skill for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode that produces React components with typed props, hooks, and accessibility attributes. CX Codex +1 338installs Project Scaffolder microsoft Project Scaffolder generates a working full-stack Azure AI Foundry project: React frontend, FastAPI backend, azd infrastructure. Useful when you want code that runs, not an empty folder. CX Codex +1 ★ 3,232repo stars

From the same set139

The whole set →
computer-science-algorithms computer-science-algorithms selects data structures and classical algorithms while flagging O(n²) bottlenecks in loops. Helps organize caching and streaming sketches. CX Codex +1 205installs marketplace-pre-member-personalisation marketplace-pre-member-personalisation — a skill for Claude Code, Cursor, Codex, GitHub Copilot, and Gemini CLI that maps the full anonymous-to-paid-member funnel on a two-sided trust marketplace. CX Codex +1 204installs design-review The design-review skill reviews existing UI code and, when needed, the live browser result. It helps rank visual, accessibility, and interaction fixes before a merge. CX Codex +1 180installs react-fetch-cache-patterns react-fetch-cache-patterns — a skill with 48 rules for scalable data fetching and caching in React: request orchestration, backend protection, prefetching, error resilience. CX Codex +1 180installs web-rules web-rules enforces 34 strict UX and visual design rules for React 19, Next.js 16 App Router, and Tailwind CSS 4. Keeps components accessible, consistent, and structured around Server Actions. CX Codex +1 173installs algorithmic-complexity-review The algorithmic-complexity-review skill spots code patterns that drive up runtime or memory use, then classifies their Big-O complexity. Use it when reviewing slow code or refactoring a hot path. CX Codex +1 171installs expo-ios-hig expo-ios-hig is a Claude Code skill with Apple Human Interface Guidelines rules for screens, components, and navigation in Expo and React Native. CX Codex +1 169installs web-taste web-taste — a skill that makes the agent work out who the user is and what they need before it writes any React 19, Next.js 16 and Tailwind CSS. CX Codex +1 169installs

Project sponsors

Companies that keep this analytics open