agentleFS
kuju63kuju63/skills/react-code-review/SKILL.md

react-code-review

Skill0 starsChanged 3 months agoApache-2.0View on GitHub

Perform comprehensive code reviews for React single-page applications (SPAs) built with modern tech stacks. Use this skill when the user asks to review React/TypeScript code, requests feedback on component design, needs help identifying React anti-patterns or performance issues, wants to improve code quality and maintainability, or submits code for review from projects using React, Vite, Vitest, Testing Library, Tanstack Query, MUI, axios, i18next, Storybook, or React Router. Also use when the user mentions "code review", "review my code", "check my React component", "feedback on my implementation", or similar phrases related to code quality assessment.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. Tenraining/Claude-Skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository4 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

28 rules. About 0 are common, 27 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈27

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Context-aware: Consider team practices and project constraints

    line 17
  2. Distinctive:

    Understand context: Ask about requirements, constraints, or specific concerns if unclear

    line 20
  3. Distinctive:

    Identify patterns: Look for repeated issues across the codebase

    line 21
  4. Very specific:

    Prioritize feedback: Start with critical issues, then high/medium/low priority

    line 22
  5. Distinctive:

    Check proper usage of project libraries.

    line 54
  6. Distinctive:

    Important: Only read reference files for libraries that are actually used in the code being reviewed.

    line 66
  7. Distinctive:

    No memory leaks (cleanup in useEffect)

    line 76
  8. Distinctive:

    No sensitive data in client code

    line 105
  9. Distinctive:

    Ask clarifying questions if context is unclear:

    line 113
  10. Distinctive:

    Always provide code examples for fixes, especially for complex issues

    line 233
  11. Distinctive:

    Don't overwhelm with minor issues.

    line 242
  12. Distinctive:

    Use "we" language when appropriate

    line 248
  13. Distinctive:

    Check component structure and responsibility

    line 272
  14. Distinctive:

    Check state management approach

    line 274
  15. Distinctive:

    Verify error and loading states

    line 275
  16. Distinctive:

    Check for performance issues

    line 276
  17. Distinctive:

    Check data flow and state management

    line 284
  18. Distinctive:

    Verify error handling across the feature

    line 285
  19. Distinctive:

    Check for patterns to improve

    line 287
  20. Distinctive:

    Check if refactoring improves maintainability

    line 293
  21. Distinctive:

    Ensure no performance regressions

    line 294
  22. Distinctive:

    Verify tests still pass/updated

    line 295
  23. Distinctive:

    Look for further improvement opportunities

    line 296
  24. Distinctive:

    Verify bug is actually fixed

    line 301
  25. Distinctive:

    Check if root cause addressed (not just symptom)

    line 302
  26. Distinctive:

    Look for similar issues elsewhere

    line 303
  27. Distinctive:

    Verify tests added to prevent regression

    line 304
  28. Distinctive:

    Check for edge cases

    line 305

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

React Code Review

Conduct thorough, constructive code reviews for React SPA applications with focus on correctness, performance, maintainability, and team collaboration.

Review Approach

Review Philosophy

  • Constructive: Focus on helping improve code quality, not criticizing
  • Educational: Explain the "why" behind suggestions
  • Prioritized: Distinguish between critical issues and nice-to-haves
  • Actionable: Provide specific, implementable suggestions with examples
  • Context-aware: Consider team practices and project constraints

Review Structure

  1. Understand context: Ask about requirements, constraints, or specific concerns if unclear
  2. Identify patterns: Look for repeated issues across the codebase
  3. Prioritize feedback: Start with critical issues, then high/medium/low priority
  4. Provide examples: Show better implementations with code snippets
  5. Reinforce good practices: Acknowledge what's done well

Core Review Areas

1. Functionality & Correctness

  • Does the code work as intended?
  • Are edge cases handled properly?
  • Is error handling comprehensive?
  • Are loading and error states shown to users?

2. React Best Practices

Review against established React patterns:

  • Hook usage (dependencies, cleanup, conditional calling)
  • Component design (single responsibility, composition)
  • State management (local vs global, derived state)
  • Performance (memoization, re-renders)

Reference: See references/react-best-practices.md for comprehensive React patterns

3. Anti-Patterns & Pitfalls

Identify common React mistakes:

  • Memory leaks (unmounted updates, uncleaned effects)
  • Stale closures in effects
  • Infinite effect loops
  • Unnecessary re-renders
  • State management issues

Reference: See references/anti-patterns.md for detailed anti-pattern catalog

4. Technology Stack Usage

Check proper usage of project libraries. Only load references for libraries actually used in the project:

  • Vite: Configuration, build optimization, HMR → See references/vite.md
  • Vitest: Testing setup, mocking patterns → See references/vitest.md
  • Testing Library: Query methods, user interactions → See references/testing-library.md
  • Tanstack Query: Query keys, cache management, mutations → See references/tanstack-query.md
  • MUI: Theme usage, styling patterns, accessibility → See references/mui.md
  • axios: Error handling, interceptors, cancellation → See references/axios.md
  • i18next: Translation keys, interpolation, namespacing → See references/i18next.md
  • React Router: Navigation, data loading, URL state → See references/react-router.md
  • Storybook: Story format, play functions, decorators → See references/storybook.md

Important: Only read reference files for libraries that are actually used in the code being reviewed. This avoids loading unnecessary context.

5. Type Safety

  • TypeScript types are explicit and correct
  • No any without justification
  • Props and return values properly typed
  • External data validated with type guards
  • Event handlers use proper React types

6. Performance

  • No memory leaks (cleanup in useEffect)
  • Expensive calculations use useMemo appropriately
  • Callbacks memoized when needed for memoized children
  • Large lists consider virtualization
  • Code splitting for routes and heavy components

7. Testing Quality

  • Tests cover critical user paths
  • Tests use Testing Library best practices (accessibility queries)
  • Async updates properly handled
  • Tests are maintainable (not testing implementation details)
  • Mock data is realistic

8. Accessibility

  • Semantic HTML elements used
  • Proper ARIA labels where needed
  • Keyboard navigation functional
  • Form labels and error messages clear
  • Color contrast and text alternatives provided

9. Code Organization & Maintainability

  • Single responsibility per component
  • Descriptive naming conventions
  • Code is self-documenting
  • Related code colocated
  • DRY principle followed appropriately
  • No circular dependencies

10. Security

  • No sensitive data in client code
  • User input validated
  • No XSS vulnerabilities
  • API authentication proper

Review Workflow

Step 1: Initial Assessment

  1. Ask clarifying questions if context is unclear:
    • What is this component/feature supposed to do?
    • Are there specific concerns or areas to focus on?
    • Are there team conventions I should be aware of?
  2. Review the overall structure and approach
  3. Identify major patterns or issues

Step 2: Deep Dive Review

  1. Load relevant reference documents:
    • react-best-practices.md for React patterns
    • anti-patterns.md for common mistakes
    • Library-specific files (only for libraries used in the code):
      • vite.md for Vite-specific issues
      • vitest.md for testing configuration
      • testing-library.md for test patterns
      • tanstack-query.md for React Query usage
      • mui.md for Material-UI patterns
      • axios.md for HTTP client usage
      • i18next.md for internationalization
      • react-router.md for routing patterns
      • storybook.md for component stories
    • review-checklist.md for comprehensive checklist
  2. Systematically review each area
  3. Note issues by severity level

Step 3: Provide Structured Feedback

Organize feedback by priority:

CRITICAL (Must fix immediately):

  • Security vulnerabilities
  • Bugs or broken functionality
  • Memory leaks
  • Type safety holes that could cause runtime errors

HIGH (Should fix before merge):

  • React anti-patterns
  • Performance issues
  • Missing error handling
  • Accessibility violations
  • Test coverage gaps

MEDIUM (Nice to have):

  • Code quality improvements
  • Optimization opportunities
  • Better naming or structure
  • Additional test cases

LOW (Consider for future):

  • Refactoring opportunities
  • Documentation improvements
  • Stylistic preferences

POSITIVE (Reinforcement):

  • Good practices to acknowledge
  • Well-designed solutions
  • Effective patterns

Step 4: Provide Examples

For each significant issue:

  1. Show the problematic code
  2. Explain why it's an issue
  3. Provide corrected example
  4. Reference documentation when helpful

Example format:

**ISSUE**: Memory leak - state update after unmount

**CODE**:
```typescript
useEffect(() => {
  fetchData().then(data => setState(data));
}, []);

PROBLEM: If component unmounts before fetch completes, setState will be called on unmounted component.

FIX:

useEffect(() => {
  let mounted = true;
  fetchData().then(data => {
    if (mounted) setState(data);
  });
  return () => { mounted = false; };
}, []);

WHY: This prevents React warning and potential memory leaks. Better yet, use Tanstack Query which handles this automatically.


## Output Format

Structure reviews as:

1. **Summary**: Brief overview of code quality (2-3 sentences)

2. **Critical Issues** (if any): Must-fix items with examples

3. **High Priority Issues** (if any): Should-fix items with examples

4. **Medium Priority Suggestions** (if applicable): Nice-to-have improvements

5. **Low Priority Considerations** (if applicable): Future improvements

6. **Positive Observations**: What's done well (always include)

7. **Overall Recommendations**: Next steps or focus areas

## Tips for Effective Reviews

### Be Specific
❌ "This component has performance issues"
✅ "This component recreates the `style` object on every render. Move it outside the component or use `useMemo`"

### Explain Why
❌ "Use useCallback here"
✅ "Use useCallback here because this handler is passed to a memoized child component. Without it, the child will re-render unnecessarily"

### Show, Don't Just Tell
Always provide code examples for fixes, especially for complex issues

### Consider Context
- Team size and experience level
- Project timeline and constraints
- Existing codebase patterns
- Performance requirements

### Balance Thoroughness with Practicality
Don't overwhelm with minor issues. Focus on what matters most for code quality and team learning.

### Maintain Professional Tone
- Be respectful and collaborative
- Frame as suggestions, not commands
- Acknowledge good work
- Use "we" language when appropriate

## Quick Reference

For specific issues, consult:
- **React patterns**: `references/react-best-practices.md`
- **Common mistakes**: `references/anti-patterns.md`
- **Complete checklist**: `references/review-checklist.md`

Library-specific references (load only as needed):
- **Vite**: `references/vite.md`
- **Vitest**: `references/vitest.md`
- **Testing Library**: `references/testing-library.md`
- **Tanstack Query**: `references/tanstack-query.md`
- **MUI**: `references/mui.md`
- **axios**: `references/axios.md`
- **i18next**: `references/i18next.md`
- **React Router**: `references/react-router.md`
- **Storybook**: `references/storybook.md`

## Example Review Scenarios

### Scenario 1: Component Review
User submits a React component for review.
1. Check component structure and responsibility
2. Review hooks (dependencies, cleanup, order)
3. Check state management approach
4. Verify error and loading states
5. Check for performance issues
6. Review prop types and naming
7. Provide prioritized feedback

### Scenario 2: Feature Implementation Review
User submits multiple files for a feature.
1. Understand feature requirements
2. Review overall architecture
3. Check data flow and state management
4. Verify error handling across the feature
5. Review tests for feature coverage
6. Check for patterns to improve
7. Provide architectural and detailed feedback

### Scenario 3: Refactoring Review
User refactored existing code.
1. Verify functionality preserved
2. Check if refactoring improves maintainability
3. Ensure no performance regressions
4. Verify tests still pass/updated
5. Look for further improvement opportunities
6. Acknowledge successful improvements

### Scenario 4: Bug Fix Review
User fixed a bug.
1. Verify bug is actually fixed
2. Check if root cause addressed (not just symptom)
3. Look for similar issues elsewhere
4. Verify tests added to prevent regression
5. Check for edge cases
6. Suggest preventive patterns

## Remember

- **Be helpful, not harsh**: Code reviews are learning opportunities
- **Prioritize impact**: Critical issues first, style last
- **Provide context**: Explain why something matters
- **Show examples**: Make suggestions actionable
- **Acknowledge quality**: Positive reinforcement matters
- **Stay consistent**: Apply same standards across reviews
- **Consider the team**: Reviews should improve collective code quality

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.