react-component-scaffolder
Skill3 starsChanged 3 months agoMITView on GitHub
Scaffolds a single React / TypeScript component or route with a typed props interface, a co-located React Testing Library test, an accessibility baseline, and an optional Storybook story. React analog of fastapi-scaffolder — the component/route is the front-end "unit". Use when creating a new React component, adding a route/page, generating a typed presentational or container component, or standing up a component with its test and story.
In this repository86 other files it gives its agents.
- AGENTS.mdAGENTS.md
- project-templates/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- project-templates/CLAUDE.mdCLAUDE.md
- alembic-migration-managerSkill
- architecture-journalSkill
- architecture-reviewSkill
- automated-code-reviewSkill
- axum-scaffolderSkill
- capture-consolidateSkill
- cargo-package-scaffoldSkill
- code-review-coachSkill
- confluence-guide-writerSkill
- dependency-mapperSkill
- doc-syncSkill
- dotnet-architecture-checklistSkill
- dotnet-controller-api-scaffolderSkill
- dotnet-security-reviewSkill
- dotnet-vertical-sliceSkill
- ef-migration-managerSkill
- email-captureSkill
- environment-healthSkill
- evaluate-testsSkill
- fastapi-scaffolderSkill
- fitness-functionsSkill
- jira-comment-writerSkill
- legacy-migration-analyzerSkill
- minimal-api-scaffolderSkill
- nuget-package-scaffoldSkill
- oss-vettingSkill
- pattern-tradeoff-analyzerSkill
- php-api-scaffolderSkill
- php-architecture-checklistSkill
- php-feature-sliceSkill
- php-migration-managerSkill
- php-package-scaffoldSkill
- php-security-reviewSkill
- pr-feedback-writerSkill
- pypi-package-scaffoldSkill
- python-architecture-checklistSkill
- python-feature-sliceSkill
- python-modernization-analyzerSkill
- python-security-reviewSkill
- qraspi-architectureSkill
- qraspi-graduateSkill
- qraspi-implementSkill
- qraspi-planSkill
- qraspi-questionsSkill
- qraspi-researchSkill
- qraspi-skeletonSkill
- qrspi-implementSkill
- qrspi-planSkill
- qrspi-questionsSkill
- qrspi-researchSkill
- qrspi-specSkill
- react-app-scaffolderSkill
- react-architecture-checklistSkill
- react-feature-sliceSkill
- react-modernization-analyzerSkill
- react-security-reviewSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 69
Objective: Create the component with its typed props, test, and (optional) story.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
React Component Scaffolder
"A component is a contract. Make its props explicit, its output accessible, its behavior tested." -- Adapted from API design practice
"Accessibility by default means the inaccessible path requires more work than the accessible one." -- Adapted from OWASP Secure Design Principles
Core Philosophy
A React component is the front-end unit the way an endpoint is the back-end unit. Like an endpoint, it has a contract (its props), an output that must be safe and well-formed (accessible, escaped JSX), and a test that proves it behaves. A component shipped without a typed props interface, a test, and an accessibility baseline is a black box that future changes will break silently.
Accessibility by default means semantic HTML and keyboard support are the scaffold, not a follow-up
ticket. The inaccessible <div onClick> must be the path that requires extra justification.
Grounding note: the KB has no React corpus. Use
collection="javascript"for TS,collection="ui_ux"for WCAG/ARIA, and cite react.dev for component/hook patterns. Never invent areactcollection.
Non-Negotiable Constraints:
- Typed props — every component has an explicit
Propstype/interface; no implicitany - Test co-located — a
*.test.tsxis created with the component, not after - Accessible by default — semantic elements, labels, keyboard reachability;
eslint-plugin-jsx-a11yclean - Presentational by default — a new component takes data + callbacks via props; data fetching is opt-in and explicit
- No business logic in JSX — branching/logic goes in a hook or a prop callback
What this skill is NOT:
- It is NOT a feature-architecture tool — use
react-feature-sliceto organize many components - It is NOT an app bootstrapper — use
react-app-scaffolderto create the project skeleton - It is NOT a styling system — bring your own (CSS Modules, Tailwind, etc.)
The 10 domain principles, KB lookup queries, AI discipline rules, anti-patterns, and error-recovery
procedures live in references/conventions.md.
Workflow
Phase 1: DETECT
# React + TS + test runner + storybook
grep -E '"(react|typescript|vitest|jest|@testing-library/react|@storybook)"' package.json
# Where components live and the existing convention
find src -type d -name components | head
ls src/features 2>/dev/null
# Test + story file conventions already in use
find src -name "*.test.tsx" | head -3
find src -name "*.stories.tsx" | head -3Record: React version, test runner (Vitest/Jest), whether Storybook is present, naming/location convention.
Phase 2: SCAFFOLD
Objective: Create the component with its typed props, test, and (optional) story.
See references/component-template.md for full skeletons (presentational, container, form).
src/<location>/<Name>/
<Name>.tsx # the component (presentational by default)
<Name>.test.tsx # RTL test (co-located, required)
<Name>.stories.tsx # Storybook story (optional)
index.ts # re-exportPhase 3: ACCESSIBILITY
Objective: Meet the a11y baseline. See references/accessibility-baseline.md.
npx eslint src/<location>/<Name> --plugin jsx-a11yPhase 4: VERIFY
npx tsc --noEmit
npx eslint src/<location>/<Name>
npx vitest run src/<location>/<Name>
# Story renders (if Storybook present):
npx storybook build --quiet >/dev/null 2>&1 && echo "stories build OK"State Block
<react-component-scaffold-state>
phase: DETECT | SCAFFOLD | ACCESSIBILITY | VERIFY | COMPLETE
component_name: [name]
kind: presentational | container | form | route
test_runner: vitest | jest
storybook_present: true | false
props_typed: true | false
test_created: true | false
a11y_clean: true | false | not_run
last_action: [description]
next_action: [description]
</react-component-scaffold-state>Output Template
The scaffold checklist (Contract / Accessibility / Tests / Story / Verification) lives in
references/conventions.md under "Output: Scaffold Checklist". Emit it filled-in at COMPLETE.
Integration with Other Skills
| Skill | Relationship |
react-feature-slice | Provides the feature structure; this skill generates the individual components inside a slice. |
react-app-scaffolder | Stands up the project (Vite + TS + Vitest + Storybook) this skill scaffolds components into. |
react-security-review | After scaffolding, audit link/URL handling and any raw-HTML usage in the component. |
react-architecture-checklist | Quality gate for hooks discipline and render performance across components. |
tdd-loop | Drive the component test-first (RED → GREEN → REFACTOR) instead of scaffolding code ahead of the test. |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

