skills/team/react-component-scaffolder/SKILL.md
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.
npx skillsauth add michaelalber/ai-toolkit react-component-scaffolderInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
"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
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:
Props type/interface; no implicit any*.test.tsx is created with the component, not aftereslint-plugin-jsx-a11y cleanWhat this skill is NOT:
react-feature-slice to organize many componentsreact-app-scaffolder to create the project skeletonThe 10 domain principles, KB lookup queries, AI discipline rules, anti-patterns, and error-recovery
procedures live in references/conventions.md.
# 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 -3
Record: React version, test runner (Vitest/Jest), whether Storybook is present, naming/location convention.
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-export
Objective: Meet the a11y baseline. See references/accessibility-baseline.md.
npx eslint src/<location>/<Name> --plugin jsx-a11y
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"
<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>
The scaffold checklist (Contract / Accessibility / Tests / Story / Verification) lives in
references/conventions.md under "Output: Scaffold Checklist". Emit it filled-in at COMPLETE.
| 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 | Drive the component test-first (RED → GREEN → REFACTOR) instead of scaffolding code ahead of the test. |
development
Interviews the user relentlessly about a plan, decision, or idea — one question at a time, each with a recommended answer. Shared engine behind "grill-me" and "grill-with-docs". Use on any "grill" trigger phrase or to stress-test thinking. Do NOT use to build the plan; it ends at shared understanding, not implementation.
testing
Runs a relentless interview to sharpen a plan or design, capturing the decisions as ADRs and a glossary along the way. Use when the user wants to be grilled AND wants the session to leave durable domain documentation behind. Do NOT use for a throwaway stress-test with no artifacts; use grill-me instead.
tools
OWASP-based security review of Vue/TypeScript front-ends. Detects framework (Vite/Vue CLI/Nuxt), entry points, and data flows; scans the OWASP Top 10 (2025) mapped to Vue client-side risks (raw-HTML XSS via v-html, URL/protocol injection, bundled secrets, insecure token storage, dependency CVEs, missing CSP, open redirects, router guard bypass); emits an exec summary plus graded findings. Use to audit Vue for vulnerabilities. Not for architecture grading (vue-architecture-checklist).
tools
Analyzes legacy Vue codebases and produces actionable modernization plans. Primary migration paths include Options API to Composition API, Vue 2 to Vue 3, Vue CLI to Vite, JavaScript to TypeScript, Vue Test Utils/Karma/Mocha to Vitest + Vue Testing Library, legacy Vuex to Pinia, and removed-in-Vue-3 pattern cleanup (filters, event bus, `$listeners`). Does NOT perform the migration — assesses, quantifies risk, and plans.