Skip to main content
skill CX Codex

frontend-refactor-planner — Claude Code skill: how to install

Builds phased refactoring roadmaps for legacy frontend code, targeting oversized components, messy state, and accessibility issues.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add patricio0312rev/skills --skill frontend-refactor-planner -a claude-code
Open on GitHub

What frontend-refactor-planner does

This skill structures messy UI overhauls into four stages: stabilizing behavior with tests, extracting sub-components, simplifying state, and auditing performance alongside accessibility. It targets files exceeding 300 lines, prop drilling, and tightly coupled presentation logic.

The plan recommends specific patterns like Context or Zustand for state management, memoization via useMemo and useCallback, virtualization, and semantic markup with ARIA tags. Rollout strategies include feature flags and incremental releases to minimize breaking changes.

Completion criteria are strict. The skill requires test coverage above 80% and an accessibility score of at least 95. If your project lacks tests, the initial phase demands writing them before component refactoring begins.

What it helps with

  • split UI components over 300 lines into smaller modules
  • eliminate prop drilling by migrating state to Zustand or Context
  • apply memoization and code splitting to sluggish interfaces
  • integrate keyboard navigation and ARIA attributes
  • outline safe refactoring stages with rollback plans

Example prompts for the agent

  • Create a refactoring plan for this 450-line UserProfile.tsx component
  • Plan state extraction from props to Zustand for the checkout flow
  • Outline a staged refactor to fix accessibility and keyboard focus in the modal

How to install frontend-refactor-planner

1Skills CLI (Vercel)

npx skills add patricio0312rev/skills --skill frontend-refactor-planner -a claude-code

2Manually: put the files in place

~/.claude/skills/frontend-refactor-planner/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/frontend-refactor-planner/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about frontend-refactor-planner

How do I install frontend-refactor-planner in Claude Code?

Run npx skills add patricio0312rev/skills --skill frontend-refactor-planner -a claude-code in your terminal.

What does frontend-refactor-planner do?

It breaks frontend refactoring into four stages: test stabilization, component extraction, state simplification, and performance audits.

What done criteria does the skill enforce?

It checks for over 80% test coverage, accessibility audit scores of 95 or higher, zero test regressions, approved peer reviews, and updated documentation.

Source text

SKILL.md · MIT
---
name: frontend-refactor-planner
description: Creates safe refactor plans for messy UI code including component splitting strategies, state simplification, performance optimizations, and accessibility improvements. Provides phased approach, risk assessment, and "done" criteria. Use when refactoring "legacy code", "messy components", "performance issues", or "large files".
---

# Frontend Refactor Planner

Create safe, phased refactor plans for complex frontend code.

## Refactor Assessment

**Identify Issues**: Large components (>300 lines), prop drilling, duplicate logic, poor performance, accessibility gaps, tight coupling, untested code
**Prioritize**: By risk (high-traffic pages first) and impact (user-facing bugs prioritized)
**Plan Phases**: Break into small, testable increments

## Common Refactor Patterns

**Component Splitting**: Extract sub-components, create compound components, separate logic from presentation
**State Management**: Lift state up, move to Context/Zustand, remove unnecessary state
**Performance**: Memoization (useMemo/useCallback), code splitting, lazy loading, virtualization
**Accessibility**: Add ARIA labels, keyboard navigation, focus management, semantic HTML
**Testing**: Add tests before refactoring, test after each change

## Phased Approach

**Phase 1 - Stabilize**: Add tests, fix critical bugs, document current behavior
**Phase 2 - Extract**: Pull out utilities, create smaller components, reduce complexity
**Phase 3 - Simplify**: Remove dead code, consolidate duplicates, optimize state
**Phase 4 - Polish**: Performance optimization, accessibility audit, documentation

## Risk Mitigation

Feature flags for gradual rollout, A/B testing refactored vs original, monitor error rates, have rollback plan, peer review all changes, incremental deployment.

## Done Criteria

Code coverage >80%, performance metrics improved, accessibility score 95+, no regressions in tests, code review approved, documentation updated.

© patricio0312rev · MIT · patricio0312rev/skills

Similar skills

All skills for Code review and refactoring →

From the same set36

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor