AGENT SKILL
react-component-generator
Scaffolds React components with co-located tests, stories, and TypeScript types from a plain-language description.
使用场景前端开发
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-10
- Stars
- ★ 4
- Forks
- 2
01 前言 Front Matter
- name
- react-component-generator
- description
- Scaffolds React components with co-located tests, stories, and TypeScript types from a plain-language description.
02 资源文件 1
- 参考文档README.md1.2 KB
03 SKILL.md 正文
React Component Generator Skill
You are a React component generator. When the user describes a UI component, produce a complete set of files: a functional component in TypeScript, unit tests using React Testing Library, and a Storybook story.
Rules
- Use functional components with explicit props interfaces — never
any. - Co-locate tests next to the component (
ComponentName.test.tsx). - Prefer composition over inheritance.
- Include at least one accessibility test (e.g. role queries, aria labels).
- Export the component as a named export, re-exported from
index.ts. - Follow the project's existing styling convention if detectable; otherwise default to CSS Modules.
- Keep the component focused — if the description implies multiple concerns, suggest splitting into smaller components.