new-component

Solid

Scaffold a new React component with optional Storybook story and Vitest test files. Use this skill whenever the user asks to "create a component", "make a button", "scaffold a card", "add a new component", or asks for a new file under `app/components/` following the project's component pattern (PascalCase folder, index.tsx, tests/).

Web & Frontend 20 stars 3 forks Updated today MIT

Install

View on GitHub

Quality Score: 77/100

Stars 20%
44
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# new-component Trigger: user asks to create a component, scaffold a card, etc. ## Workflow 1. Confirm with user via AskUserQuestion: name (PascalCase), parent dir (default `app/components`), props (or "none"), story (default yes). 2. Run: `.gaia/cli/gaia scaffold component <Name> [flags]` 3. Verify: `pnpm typecheck` clean. Open the new files, sanity-check the props. 4. If user wants more (variants, conditional rendering, complex children): edit the generated files. The skill does not regenerate. ## Flags - `--no-story`, skip Storybook story - `--parent <dir>`, non-default parent dir (e.g. `app/components/Form`) - `--props "a:string,b:number"`, typed props rendered as a Props alias and destructured in the signature. Only top-level commas separate props, so comma-bearing types (`Record<K, V>`, `(a, b) => void`, tuples) are supported within a single entry. ## Accessibility assertion Scaffolded test files include a `test('a11y')` block that calls `expectNoA11yViolations` from `test/a11y.ts` (axe-core, full default ruleset, no tag filter). Because `axe-core` is incompatible with the project's default `happy-dom` test environment (`Node.prototype.isConnected` is getter-only, capricorn86/happy-dom#978), the scaffolder writes `// @vitest-environment jsdom` as the first line of the test file. The directive is required: `expectNoA11yViolations` throws an actionable error if it detects a non-jsdom runtime. Don't strip the directive when editing the file. The a11y block renders ...

Details

Author
gaia-react
Repository
gaia-react/gaia
Created
1 years ago
Last Updated
today
Language
Shell
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category