vanessamarely/ai-playbook-reposito/react-component-builder

Claude Code and agent skill by vanessamarely/ai-playbook-reposito

Trust tier 3
  • community
Source check pending

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-builder

SKILL.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
  1. Ensure componentName follows PascalCase convention.
  2. Verify targetFolder exists and is within project scope.
  3. 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
  1. Create the component file at <targetFolder>/<componentName>.tsx.
  2. Define TypeScript interface for props with explicit types:
  • Use discriminated unions for variant props
  • Mark readonly properties appropriately
  • Use React.ReactNode for 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 } ``

  1. Implement the component with semantic HTML.
  2. Add accessibility attributes (ARIA roles, labels, keyboard handlers).
  3. Use explicit return type: const Component = (props: Props): JSX.Element => { ... }
  4. Avoid any types - use unknown with type guards if needed.

Refer to:

  • .github/skills/react-components/references/a11y-wcag22.md for WCAG 2.2 requirements
  • .github/copilot-instructions.md for 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
  1. Check for semantic HTML usage.
  2. Verify keyboard event handlers are present for interactive elements.
  3. Ensure focus management for modals or dynamic content.
  4. 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:

  1. For async data components, use AsyncState discriminated union:

```typescript type AsyncState<T> =

{ status: 'idle' }
{ status: 'loading' }
{ status: 'success'; data: T }
{ status: 'error'; error: Error }

```

  1. Add error boundaries for component failures (if top-level component).
  2. Handle loading states with proper ARIA announcements.
  3. Use exhaustive checks with never type for state machines.
Step 7: Generate Test File (Required)

Create comprehensive tests:

  1. Create <componentName>.test.tsx in the appropriate test directory.
  2. Include basic rendering test with RTL.
  3. Include accessibility test using @axe-core/react or jest-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() }) ```

  1. Test keyboard interactions for interactive components.
  2. 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-check
  • npm 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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/vanessamarely/ai-playbook-reposito/react-component-builder/badge)](https://verified-skill.com/skills/vanessamarely/ai-playbook-reposito/react-component-builder)

Something wrong with this skill or its page? Tell us.