react-code-smells

📁 pproenca/dot-skills 📅 14 days ago
25
总安装量
25
周安装量
#7853
全站排名
安装命令
npx skills add https://github.com/pproenca/dot-skills --skill react-code-smells

Agent 安装分布

claude-code 20
codex 20
opencode 19
github-copilot 19
gemini-cli 17
cursor 15

Skill 文档

Principal Engineering React Best Practices

Principal-engineer-level refactoring guide for React applications. Contains 42 rules across 8 categories, prioritized by impact from critical (state architecture, composition) to incremental (testability). Each rule includes code smell indicators, before/after examples, and safe transformation steps.

When to Apply

Reference these guidelines when:

  • Refactoring existing React codebases
  • Reviewing PRs for architectural issues
  • Identifying technical debt
  • Planning large-scale refactoring efforts
  • Deciding whether to extract, inline, or restructure components
  • Improving testability of React code

Rule Categories by Priority

Priority Category Impact Prefix
1 State Architecture CRITICAL state-
2 Component Composition CRITICAL comp-
3 Abstraction Quality HIGH abs-
4 Coupling & Cohesion HIGH couple-
5 Hook Hygiene MEDIUM-HIGH hook-
6 Render Patterns MEDIUM render-
7 Side Effect Management MEDIUM effect-
8 Testability LOW-MEDIUM test-

Quick Reference

1. State Architecture (CRITICAL)

2. Component Composition (CRITICAL)

3. Abstraction Quality (HIGH)

4. Coupling & Cohesion (HIGH)

5. Hook Hygiene (MEDIUM-HIGH)

6. Render Patterns (MEDIUM)

7. Side Effect Management (MEDIUM)

8. Testability (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Related Skills

  • For React 19 API best practices, see react skill
  • For React core principles, see react-principle-engineer skill
  • For form handling, see react-hook-form skill

References

  1. react.dev – Official React documentation
  2. kentcdodds.com – Advanced React patterns
  3. patterns.dev – Design patterns in JavaScript
  4. testing-library.com – Testing best practices