Component Scaffold
Create a new component following the conventions in .context/conventions.md and .context/design-system.md.
When to Use
- •Use this skill when you need a new reusable UI component.
- •Use this skill when you want tests and Storybook stories created together.
Inputs
- •Component name (PascalCase, e.g.
UserCard) - •Target path (default:
src/components/<ComponentName>/) - •Props and variants (if any)
- •Styling approach (Tailwind or tokens)
Instructions
- •Create the component folder and files:
- •
ComponentName.tsx - •
ComponentName.test.tsx - •
ComponentName.stories.tsx - •
index.ts
- •
- •Implement the component with strict TypeScript (no
any). - •Use
forwardRefonly if it is truly needed. - •Export types and component from
index.ts. - •Add at least one interaction test using Testing Library.
- •Add a Storybook story that documents variants and accessibility.
- •Follow naming, import order, and file organization conventions.
Output
- •A new component folder with component, test, story, and index files.
- •Any required updates to barrel exports.
Validation
- •Ensure TypeScript types are explicit and correct.
- •Ensure tests and stories compile without errors.
- •If commands are available, run:
npm run lintandnpm run test.