Skip to content
Development
Skill

/new-component

Scaffolds a new React component with its Storybook story, which is the component's test. 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

From plugin
gaia
2619 skills18 agents12 commands

Claude Code

$ npx -y skills add gaia-harness/gaia --skill new-component --agent claude-code

SKILL.md

new-component.SKILL.md
name: new-component
description: Scaffolds a new React component with its Storybook story, which is the component's test. 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 (kebab-case folder, index.tsx, tests/), or asks for a component a shadcn registry item already provides (dialog, tabs, popover, and so on).
model: haiku

new-component

Workflow

1. Registry check first. Before writing any component by hand, check whether shadcn has it: `pnpm shadcn view <name>` for a known item, or `pnpm shadcn search` (for example `pnpm shadcn search dialog`) to look. A registry counterpart means a button, dialog, tabs, popover, select, table and the like. 2. If the registry has it, run `pnpm shadcn add <name>`. The file lands flat in `app/components/ui/<name>.tsx` and is vendored: do not edit it (see `apps/web/.claude/rules/shadcn-ui.md`). Then compose the added component in a GAIA component or page rather than hand-writing a replacement; add `app/components/ui/tests/<name>.stories.tsx` for the new ui file. Stop here unless the user still needs a GAIA component around it. 3. Only when the registry has no counterpart, or the request is app logic around ui parts: confirm with user via AskUserQuestion: name (PascalCase or kebab-case; the folder is kebab-case), parent dir (default `app/components`), props (or "none"). 4. Run from the repo root: `./.gaia/cli/gaia scaffold component <Name> [flags]` (the package comes from the registry, not the working directory). 5. Verify: `pnpm typecheck` clean. Open the new files, sanity-check the props. 6. If user wants more (variants, conditional rendering, complex children): edit the generated files. The skill does not regenerate. Before hand-editing, read one or two existing components with a similar shape and follow their pattern; style with role tokens and `cva` for variants (`apps/web/.claude/skills/tailwind/SKILL.md`).

Adopter notes

  • Registry hooks land in `~/hooks` as kebab-case `use-*.ts` files, which GAIA's layout accepts.
  • The `utils` alias in `components.json` is required by the config schema but unused: registry files import `cn` from the `cn` package, so `shadcn add` writes no util file.

Flags

  • `--no-story` is refused (exit 1, nothing written): the story is the component's test, so a component cannot be scaffolded without one
  • `--parent <dir>`, non-default parent dir, an existing `app/components[/...]` folder (e.g. `app/components/form`) or `app/pages/<path>` to colocate the component in a page folder. A parent equal to or under `app/components/ui`, or outside `app/components` and `app/pages`, is refused; the layout rule is in `apps/web/.claude/rules/coding-guidelines-react.md`
  • `--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.

The story is the test

The scaffold writes `tests/index.stories.tsx` with a `Default` story, a `Renders` story with a `.test()` that asserts the region, and no test file. Stories run as tests under `@storybook/addon-vitest` in headless Chromium (run `pnpm install:browsers` once), and addon-a11y axe-checks every story, so a story that renders a violation fails with no extra test. Import `expect` from `storybook/test`; a `.test()` receives `canvas`, `args` and `userEvent` in its context. The doctrine (a story is a visual state, a behavior is a `.test()` on it) is in `wiki/decisions/Stories as Tests.md`.

With `--props`, the scaffolder fills representative values (`title="title"`, `count={0}`, ...) at the story's render site. Replace the placeholders with realistic ones. The scaffolded test is a starting point, not complete evidence: add a `.test()` for a behavior no test covers yet (interactions, state transitions, error paths) and a story per visual state as the component grows, and for an interactive component assert a keyboard path and a focus outcome. How to write stories and tests: `apps/web/.claude/skills/tdd-react/references/tests-react.md`.

Read more
@gaia-react
Ships withgaia

Claude is raw power. GAIA is order and focus. A serious harness for Claude Code. It keeps Claude-shipped code production-grade as your team scales. The React frontend is handled. You build the rest of your app on top.

2619 skills18 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
26
Star history of gaia-react/gaia on GitHub, a chart by star-history.com

Other skills on gaia.

file-tech-debt

file-tech-debt

Files a new tech-debt GitHub issue for an out-of-scope code-review finding. Builds the dedup key, skips an open or…

@gaia-react@gaia-reactInstall Skill
gaia-wiki

gaia-wiki

Runs GAIA wiki maintenance (sync, consolidate, lint with fixes) in one command and lands it as one commit and PR. Trigger on…

@gaia-react@gaia-reactInstall Skill
naming-conventions

naming-conventions

Applies descriptive, self-documenting naming in any language (TypeScript, bash, workflow YAML, Dockerfiles). Use this skill…

@gaia-react@gaia-reactInstall Skill
release-notes

release-notes

Maintainer-only. Rewrites a version's GAIA CHANGELOG entries as plain-language public release notes for the marketing site…

@gaia-react@gaia-reactInstall Skill
tdd

tdd

Runs test-driven development with a red-green-refactor loop, an opt-in tool for logic where test-first helps. Use when the user…

@gaia-react@gaia-reactInstall Skill
update-deps

update-deps

Remediates dependencies in place of Dependabot version and security updates. Discovers outdated packages and open security…

@gaia-react@gaia-reactInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc11d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about new-component.

Which coding agents can use new-component?
new-component installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.