Guidelines and scaffolding for clean, testable, and accessible React development.

Install

mkdir -p .claude/skills/react-skills-alexander-kastil && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10501" && unzip -o skill.zip -d .claude/skills/react-skills-alexander-kastil && rm skill.zip

Installs to .claude/skills/react-skills-alexander-kastil

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Build clean, accessible React components with TypeScript and Fluent UI. Use when creating new React components, converting designs to code, building reusable UI patterns, optimizing component performance, implementing accessibility guidelines, or structuring React projects. Supports component scaffolding, hook creation, data separation, and testing workflows.
361 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Scaffold components
  • Define prop interfaces
  • Implement custom hooks
  • Ensure accessibility

How it works

Guides the creation of accessible, type-safe React components using industry best practices and Fluent UI.

Inputs & outputs

You give it
Component requirements
You get back
React component files

When to use react-skills

  • Create a new UI component
  • Optimize component accessibility
  • Refactor UI for reusability

About this skill

React Component Development

Create production-quality React components following Microsoft best practices, accessibility standards, and industry patterns.

When to Use This Skill

Generate React components when you need to:

  • Build new UI components from scratch
  • Convert design mockups or prototypes to React code
  • Create reusable UI patterns for projects
  • Optimize existing components for performance
  • Implement accessibility features (WCAG 2.2 compliance)
  • Structure project layout with hooks, data layers, and component separation
  • Set up TypeScript interfaces and prop validation
  • Create template scaffolds for consistent component development

Prerequisites

Ensure your project has:

  • Node.js and npm installed
  • React 18+ (16.13+ minimum)
  • TypeScript configured with strict mode enabled
  • Either Fluent UI or preferred component library already installed
  • ESLint configured for React and TypeScript
  • Tailwind CSS configured (optional but recommended for styling)

Architectural Rules

Follow these guidelines for clean, maintainable components:

Component Structure

  • Break designs into independent, single-responsibility components
  • Avoid large monolithic files; aim for focused, testable components
  • Place each component in its own file under src/components/

Type Safety

  • Every component must export a Readonly TypeScript interface for props named ComponentNameProps
  • Use strict null checking and non-null assertions sparingly
  • Define component return type explicitly as React.ReactElement or JSX.Element

Logic and Data Separation

  • Move event handlers and business logic into custom hooks in src/hooks/
  • Create hooks for state management, side effects, and reusable logic
  • Place all static text, image URLs, lists, and mock data in src/data/mockData.ts
  • Keep components pure; avoid modifying props or external state

Styling Approach

  • Use Fluent UI components for consistent, accessible styling when available
  • Map project design tokens to Tailwind CSS classes for custom styling
  • Extract color values and spacing from a design system file
  • Use theme-mapped Tailwind classes instead of arbitrary hex values
  • For Fluent UI imports, use path-based imports to reduce bundle size: import { Button } from '@fluentui/react/lib/Button' instead of import { Button } from '@fluentui/react'

Performance Optimization

  • Use React.memo for function components to prevent unnecessary re-renders
  • Memoize callbacks with useCallback when passed to child components
  • Optimize expensive computations with useMemo
  • Only call ReactDOM.render when bound properties or framework aspects change
  • Use PureComponent for class components or React.memo for function components

Accessibility (WCAG 2.2 Level AA)

  • Provide keyboard navigation alternatives to mouse/touch events
  • Set proper ARIA attributes for screen readers
  • Ensure sufficient color contrast (4.5:1 for normal text, 3:1 for large text)
  • Implement visible focus indicators on all interactive elements
  • Avoid keyboard traps; ensure logical tab order
  • Use semantic HTML elements and Fluent UI accessible components
  • Provide alt text for images, hide decorative images with aria-hidden
  • Test with keyboard-only navigation and screen readers

Step-by-Step Workflow

  1. Environment Setup

    • Verify node_modules exists; run npm install if needed
    • Check TypeScript configuration (tsconfig.json) targets es2015 or higher
    • Confirm Fluent UI and styling libraries are installed
  2. Create Data Layer

    • Build src/data/mockData.ts with static content referenced by the component
    • Export constants, arrays, and configuration as named exports
    • Use meaningful names; avoid magic strings
  3. Define Component Interface

    • Create a Readonly TypeScript interface named ComponentNameProps
    • Define all props with explicit types (avoid any)
    • Mark optional props with ? and provide JSDoc comments
    • Include event handler prop types (e.g., onClick: () => void)
  4. Build Component

    • Start with a functional component using const syntax
    • Accept props destructured and typed with ComponentNameProps
    • Use Fluent UI components from path-based imports for UI elements
    • Implement any hooks (useState, useCallback, useMemo) needed for interactivity
    • Return JSX with semantic HTML and accessible patterns
    • Export component as default export
  5. Implement Custom Hooks (if needed)

    • Create src/hooks/useComponentLogic.ts for reusable state and effects
    • Use custom hooks for form handling, API calls, or complex state
    • Keep hooks pure and testable
  6. Wire Into Application

    • Import component into App.tsx or parent container
    • Pass required props from parent state or context
    • Map component to route or layout section
  7. Quality Checks

    • Run npm run lint to check for TypeScript and ESLint issues
    • Verify component with npm run dev in local dev environment
    • Test keyboard navigation, screen reader compatibility, focus management
    • Check contrast ratios and visual appearance
    • Validate accessibility with browser dev tools or Accessibility Insights
    • Test performance with React DevTools Profiler
  8. Validate Against Checklist

    • Component exported as default with clear file naming
    • Props interface defined and properly typed
    • All interactive elements are keyboard accessible
    • Accessibility attributes (aria-*, role, alt) are present where needed
    • Styling uses design tokens; no hardcoded hex values in component code
    • Logic separated into custom hooks
    • Static data moved to mockData.ts
    • No console errors, warnings, or linting issues

Troubleshooting

IssueSolution
TypeScript errors with propsEnsure ComponentNameProps interface is defined and props parameter is typed with it
Component not renderingVerify component is exported as default or named export; check parent imports and props
Styling not appliedConfirm Fluent UI or Tailwind CSS packages are installed; check class names match config
Accessibility issuesRun browser accessibility inspector; verify ARIA attributes, focus, and color contrast
Bundle size too largeUse path-based imports from Fluent UI; enable tree-shaking in tsconfig.json
Unnecessary re-rendersAdd React.memo to component or use useCallback for event handlers
Focus not visibleCheck CSS includes clear :focus styles; apply outline or border-based focus indicator
Screen reader not announcingTest ARIA labels, roles, and semantic HTML; use aria-label on unlabeled interactive elements

References

  • Microsoft Learn: Best practices for React code components
  • Fluent UI React documentation and component API
  • WCAG 2.2 accessibility guidelines
  • React official documentation on hooks, performance, and accessibility
  • TypeScript strict mode configuration guide
  • Tailwind CSS configuration and theme mapping

When not to use it

  • When the component is too simple for scaffolding

Prerequisites

React 18+TypeScriptFluent UI

Limitations

  • Accessibility testing is manual

How it compares

Enforces strict architectural rules and accessibility standards rather than ad-hoc component creation.

Compared to similar skills

react-skills side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
react-skills (this skill)05moNo flagsIntermediate
ui-ux-expert-skill919moReviewAdvanced
frontend-ui-engineering01moNo flagsAdvanced
web-artifacts-builder493moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

ui-ux-expert-skill

fercracix33

Technical workflow for implementing accessible React user interfaces with shadcn/ui, Tailwind CSS, and TanStack Query. Includes 6-phase process with mandatory Style Guide compliance, Context7 best practices consultation, Chrome DevTools validation, and WCAG 2.1 AA accessibility standards. Use after Test Agent, Implementer, and Supabase agents complete their work.

91244

frontend-ui-engineering

PM4-SmartFinance

Builds production-quality React 19 UIs that match SmartFinance conventions. Use when creating or modifying components, layouts, forms, charts, or any user-facing interface. Use when accessibility, semantic HTML, or design-token compliance is at risk.

00

web-artifacts-builder

anthropics

Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.

49162

frontend-ui-dark-ts

microsoft

Build dark-themed React applications using Tailwind CSS with custom theming, glassmorphism effects, and Framer Motion animations. Use when creating dashboards, admin panels, or data-rich interfaces with a refined dark aesthetic.

430

designer-skills

llama-farm

Designer subsystem patterns for LlamaFarm. Covers React 18, TanStack Query, TailwindCSS, and Radix UI.

68

react-admin-panel

Survikrowa

React admin panel using Vite, TanStack Router, TanStack Query, and Tailwind CSS. Use this skill when working with the web admin interface in apps/web, creating admin features, forms, or data tables.

00

Search skills

Search the agent skills registry