vanessamarely/ai-playbook-reposito/react-component-builder
Claude Code and agent skill by vanessamarely/ai-playbook-reposito
- community
Checking that the SKILL.md file is still in the repository.
Build accessible React components following TypeScript and WCAG 2.2 standards
Install
npx vskill@latest install vanessamarely/ai-playbook-reposito/react-component-builderSKILL.md
The same SKILL.md was published earlier as vanessamarely/ai-playbook-reposito/react-component-builder.
React Component Builder Agent
Purpose
Create or modify React components with TypeScript, ensuring accessibility compliance and adherence to project conventions.
Inputs
componentName: Name of the component (PascalCase).specification: Component behavior, props, and requirements.targetFolder: Location within the project for the new component.
Outputs
- Component file (
.tsx). - Optional: associated test file, Storybook story, or style file.
- Verification command suggestions.
Procedure
Step 1: Validate Inputs
- Ensure
componentNamefollows PascalCase convention. - Verify
targetFolderexists and is within project scope. - Check for naming conflicts with existing components.
Step 2: Load Skill
Read: .github/skills/react-components/SKILL.md
Follow the procedures defined in that skill.
Step 3: Generate Component Structure
- Create the component file at
<targetFolder>/<componentName>.tsx. - Define TypeScript interface for props with explicit types:
- Use discriminated unions for variant props
- Mark readonly properties appropriately
- Use
React.ReactNodefor children - Provide JSDoc comments for complex props
- Example:
``typescript interface ButtonProps { /** Visual style variant */ variant: 'primary' | 'secondary' | 'danger' /** Button click handler */ onClick: (event: React.MouseEvent<HTMLButtonElement>) => void /** Disable button interaction */ disabled?: boolean children: React.ReactNode } ``
- Implement the component with semantic HTML.
- Add accessibility attributes (ARIA roles, labels, keyboard handlers).
- Use explicit return type:
const Component = (props: Props): JSX.Element => { ... } - Avoid
anytypes - useunknownwith type guards if needed.
Refer to:
.github/skills/react-components/references/a11y-wcag22.mdfor WCAG 2.2 requirements.github/copilot-instructions.mdfor TypeScript best practices
Step 4: Apply Project-Specific Overrides
Check for project-specific style guides or component library documentation:
- If the project has
.github/component-library-overrides.md, read and apply those rules. - Otherwise, follow the project's existing code style and conventions.
Step 5: Validate Accessibility
- Check for semantic HTML usage.
- Verify keyboard event handlers are present for interactive elements.
- Ensure focus management for modals or dynamic content.
- Confirm ARIA attributes are valid and necessary.
If eslint-plugin-jsx-a11y is configured, suggest running: npm run lint
Step 6: Error Handling and Edge Cases
Implement proper error handling:
- For async data components, use AsyncState discriminated union:
```typescript type AsyncState<T> =
| { status: 'idle' } |
|---|
| { status: 'loading' } |
| { status: 'success'; data: T } |
| { status: 'error'; error: Error } |
```
- Add error boundaries for component failures (if top-level component).
- Handle loading states with proper ARIA announcements.
- Use exhaustive checks with
nevertype for state machines.
Step 7: Generate Test File (Required)
Create comprehensive tests:
- Create
<componentName>.test.tsxin the appropriate test directory. - Include basic rendering test with RTL.
- Include accessibility test using
@axe-core/reactorjest-axe:
```typescript import { axe, toHaveNoViolations } from 'jest-axe' expect.extend(toHaveNoViolations)
test('should have no accessibility violations', async () => { const { container } = render(<Component {...props} />) const results = await axe(container) expect(results).toHaveNoViolations() }) ```
- Test keyboard interactions for interactive components.
- Test error states if component handles errors.
Step 8: Output Summary
Provide:
- Path to created component file with markdown link:
[ComponentName.tsx](path/to/ComponentName.tsx) - Path to test file with link
- Brief description of implemented functionality
- List of TypeScript patterns used (discriminated unions, type guards, etc.)
- Accessibility features implemented
- Suggested verification commands:
npm run lint(from project folder)npm test -- <componentName>npm run type-checknpm run lint:a11y(if available)
Mission Control Context: When this agent completes, session logs should show:
- Component structure decisions and reasoning
- Accessibility considerations applied
- TypeScript type safety measures
- Any deviations from standard patterns with justification
Error Handling
- Component already exists: Notify and ask if modification or overwrite is intended.
- Invalid props specification: Request clarification on expected types.
- Missing dependencies: Suggest installing required packages.
Related
- Canonical Claude Code source:
.claude/agents/react-component-builder.md - Copilot custom agent equivalent:
.github/agents/react-component-builder.agent.md - Related skill:
.github/skills/react-components/SKILL.md
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingai-playbook/.github/skills/react-component-builder/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/vanessamarely/ai-playbook-reposito/react-component-builder)