Scaffold Flat
This skill automates the creation of React components in this project's specific "Flat Structure."
The Convention
- •No
src/directory: All code lives in root folders (components/,hooks/, etc.). - •Co-located Tests: Unit tests live next to the component (e.g.,
Header.tsxandHeader.test.tsxare in the same folder), NOT in a separatetest/folder. - •Strict Typing: All components use
React.FC<Props>and defined interfaces.
Usage
Create a Component
This command generates the component file and its co-located test file.
bash
node .gemini/skills/scaffold-flat/scripts/create_component.cjs <ComponentName>
Example
To create a UserProfile component:
bash
node .gemini/skills/scaffold-flat/scripts/create_component.cjs UserProfile
Output:
- •
components/UserProfile.tsx(React 19 + Tailwind 4) - •
components/UserProfile.test.tsx(Vitest + Testing Library)
Workflow
- •Scaffold: Run the command.
- •Verify: Run
pnpm testto ensure the new test passes. - •Customize: Edit the Props interface and implementation.