skills/smithery.ai/component-refactoring

component-refactoring

SKILL.md

Component Refactoring Skill

Refactor high-complexity React components with proven patterns and workflows.

Complexity Threshold: Components with cyclomatic complexity > 50 or line count > 300 should be candidates for refactoring.

Use When:

  • bun analyze-component shows high complexity.
  • Users ask for "code splitting", "hook extraction", or "cleanup".
  • A component file exceeds 300 lines of code.

Core Refactoring Patterns

1. Extract Custom Hooks

Goal: Separate UI from State/Logic.

Before:

Installs
3
First Seen
Mar 24, 2026