vanessamarely/ai-playbook-reposito/react-components

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.

Creates and modifies React components using TypeScript, Tailwind CSS, shadcn/ui, and WCAG 2.2 Level AA accessibility patterns. Use when the user wants to build, update, or fix a React UI component, add keyboard navigation, or apply ARIA attributes. Do not use for Node.js services, API endpoints, database schemas, or non-React frontend frameworks (Vue, Svelte, Angular).

Install

npx vskill@latest install vanessamarely/ai-playbook-reposito/react-components

SKILL.md

The same SKILL.md was published earlier as vanessamarely/ai-playbook-reposito/react-components.

Skill: React Components

Purpose

Create or modify React components using TypeScript with strict accessibility compliance (WCAG 2.2 Level AA), semantic HTML, and type safety.

Inputs

  • componentName: PascalCase component identifier
  • functionality: Description of component behavior and interactions
  • props: Expected component props with types
  • accessibility: Specific accessibility requirements (keyboard, screen reader, ARIA)

Outputs

  • Component file (.tsx)
  • TypeScript prop interface
  • Accessibility attributes and handlers
  • Optional: test file, style file

Procedures

1. Validate Component Name

Ensure name follows PascalCase convention.

Check for conflicts with existing components in the target directory.

2. Load Accessibility Guidelines

Read: references/a11y-wcag22.md

Identify applicable WCAG requirements based on component type (button, form, modal, etc.).

3. Define TypeScript Interface

Create interface for component props:

  • Required props without ?
  • Optional props with ?
  • Use specific types (avoid any)
  • Include event handler types (e.g., onClick?: (event: React.MouseEvent) => void)

Refer to: references/react-ts-patterns.md

4. Choose Semantic HTML

Select appropriate HTML element:

  • <button> for actions
  • <a> for navigation
  • <input>, <select>, <textarea> for form fields
  • <nav>, <header>, <main>, <footer> for landmarks
  • <article>, <section> for content structure

Avoid <div> or <span> for interactive elements.

5. Implement Keyboard Support

For interactive components:

  • Add onKeyDown handler for Enter and Space keys.
  • Implement arrow key navigation for lists or menus.
  • Manage focus for modals (trap focus, restore on close).
  • Ensure all interactive elements are reachable via Tab.

Pattern:

tsx
const handleKeyDown = (event: React.KeyboardEvent) => {
if (event.key === 'Enter' || event.key === ' ') {
event.preventDefault()
handleAction()
}
}
6. Add ARIA Attributes

Apply ARIA only when semantic HTML is insufficient:

  • aria-label for icon buttons without visible text
  • aria-labelledby to reference visible labels
  • aria-describedby for additional context
  • aria-expanded for toggles and dropdowns
  • aria-live for dynamic content updates

Validate against: references/a11y-wcag22.md

7. Implement Focus Management

For modals and dialogs:

  1. Move focus to modal when opened.
  2. Trap focus within modal (prevent Tab from escaping).
  3. Restore focus to trigger element when closed.

Use useEffect with ref:

tsx
const modalRef = useRef<HTMLDivElement>(null)
useEffect(() => {
if (isOpen && modalRef.current) {
modalRef.current.focus()
}
}, [isOpen])
8. Apply Project-Specific Conventions

Follow the project's existing style and conventions. Check the project's own CLAUDE.md for local overrides before applying this skill's defaults.

9. Generate Component File

Structure:

  1. Imports
  2. TypeScript interface
  3. Component function with typed props
  4. Return JSX with semantic elements and accessibility attributes
  5. Export
10. Validate Accessibility

Check:

  • Semantic HTML used correctly
  • Keyboard handlers present for interactive elements
  • ARIA attributes valid and necessary
  • Focus management implemented for modals
  • Color contrast meets 4.5:1 for normal text, 3:1 for large text
11. Suggest Testing

Recommend:

  • Unit tests for logic
  • Accessibility tests with @axe-core/react
  • Keyboard navigation manual testing

Commands:

  • npm run lint (if eslint-plugin-jsx-a11y configured)
  • npm test -- <ComponentName>

Error Handling

Non-semantic element used for interaction: Suggest replacing <div> with <button> or appropriate element.

Missing keyboard handler: Add onKeyDown handler for Enter/Space.

Invalid ARIA combination: Refer to references/a11y-wcag22.md for correct usage.

Focus trap missing in modal: Implement focus management with refs and event listeners.

References

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-components/badge)](https://verified-skill.com/skills/vanessamarely/ai-playbook-reposito/react-components)

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