component-scaffold
Create a new React component with co-located test, story, and styles. Use when creating new UI components, when asked to scaffold/generate a component, or when building new pages.
- License 许可
- MIT
- 最近更新
- 2026-11-06
- Stars
- ★ 18
- Forks
- 1
01 前言 Front Matter
- name
- component-scaffold
- metadata
- { "forged-by": "claude-agent", "last-used": "2026-02-27", "forged-from": "session-2026-02-15", "usage-count": "18", "forged-reason": "Scaffolded 4 components in one session — same file structure each time" }
- description
- Create a new React component with co-located test, story, and styles. Use when creating new UI components, when asked to scaffold/generate a component, or when building new pages.
02 资源文件 3
- 参考文档references/anti-analysis-techniques.md5.3 KB
- 参考文档references/sandbox-orchestration.md5.1 KB
- 参考文档references/yara-sigma-rules.md6.3 KB
03 SKILL.md 正文
Component Scaffold
Create a new React component following project conventions.
Inputs
- Component name (PascalCase, e.g.,
UserCard) - Component type:
page|feature|ui - Props (optional: list of prop names + types)
Steps
-
Determine the directory
page→src/pages/{ComponentName}/feature→src/features/{feature-area}/components/{ComponentName}/ui→src/components/ui/{ComponentName}/
-
Create the component file
{dir}/{ComponentName}.tsx- Functional component with TypeScript props interface
- Export as named export (not default)
-
Create the test file
{dir}/{ComponentName}.test.tsx- Import from Vitest + Testing Library
- At minimum: renders without crashing + snapshot
-
Create the story file
{dir}/{ComponentName}.stories.tsx- Default story + one variant per significant prop
-
Create the barrel export
{dir}/index.ts- Re-export the component
Conventions
- All components are functional (no class components)
- Props interfaces are named
{ComponentName}Props - Co-locate everything: component, test, story, styles in one directory
- Use Tailwind for styling (no CSS modules — see archived skill
css-module-setup)
Edge Cases
- Component already exists: Do not overwrite. Ask the user if they want to update or rename.
- Nested feature components: Use the feature area as a parent directory (e.g.,
features/auth/components/LoginForm/)
04 同仓库更多 Skills
skillforge
Create or update a reusable agent skill. Use when you notice a repeated pattern, when a workflow should be persisted for future sessions, or when asked to forge/create/scaffold a new skill.
skillforge
Create or update a reusable agent skill. Use when you notice a repeated pattern, when a workflow should be persisted for future sessions, or when asked to forge/create/scaffold a new skill.
deploy-preview
Deploy a preview branch to the staging environment for review. Use when a feature branch is ready for visual review, when someone asks to "deploy this for review", or before opening a PR.
bug-triage
Triage a bug report into an actionable GitHub issue with severity, reproduction steps, and assignment. Use when a bug is reported, when error logs need investigation, or when asked to file/triage an issue.
api-endpoint
Scaffold a REST API endpoint with route, controller, validation, and tests. Use when creating new API endpoints, adding resources, or when asked to build a new backend route.
finish-the-loop
Close implementation loops with target-bound independent evidence and a portable proof receipt. Use when an agent changes a real system and must earn a completion claim that survives the session.