Agent skill
react-best-practices-mdbabumiamssm-llms-universal-life-
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/react-best-practices-mdbabumiamssm-llms-universal-life-
SKILL.md
---name: react-best-practices description: A comprehensive guide and rule set for writing clean, performant, and maintainable React code. license: MIT metadata: author: AI Group version: "1.0.0" category: Software_Engineering compatibility:
- system: React 18+
- system: TypeScript 5+ allowed-tools:
- read_file
- replace
- write_file
keywords:
- react-best-practices
- automation
- biomedical measurable_outcome: execute task with >95% success rate. ---"
React Best Practices
This skill provides a set of architectural and coding standards for React applications. It is designed to be used by agents when generating, refactoring, or reviewing React code to ensure alignment with modern industry standards.
When to Use This Skill
- Code Generation: When asked to create new React components or hooks.
- Code Review: When analyzing existing React code for anti-patterns.
- Refactoring: When optimizing performance or improving readability.
- Migration: When upgrading from class components to functional components + hooks.
Core Capabilities
- Component Architecture: Enforces separation of concerns (Container/Presentational) or Composition patterns.
- Hooks Usage: Validates rules of hooks, custom hook extraction, and dependency array correctness.
- State Management: Guidance on
useStatevsuseReducervs Context vs External Stores (Zustand/Redux). - Performance Optimization: Identifies unnecessary re-renders and suggests
useMemo/useCallbackusage appropriately.
Workflow
- Analyze Context: Determine if the task involves a single component or a complex feature.
- Consult Rules: Refer to
references/rules.mdfor specific guidelines on naming, file structure, and typing. - Generate/Refactor: Apply the rules to the code.
- Validate: Ensure no "prop drilling" or "huge components" are introduced.
Example Usage
User: "Create a user profile component that fetches data."
Agent Action:
- Reads
references/rules.mdto check data fetching patterns (e.g., "Use React Query or SWR over useEffect for data"). - Generates the component:
tsx
// user-profile.tsx import { useQuery } from '@tanstack/react-query'; // ... implementation following rules ...
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?