frontend-refactor-planner
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".
Works with
--- 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". license: MIT --- # 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.
More Refactoring skills
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
analyze-project
lllllllama/rigorpilot-skills
Rigor Analyze / Rigor Audit read-only skill for deep learning research repositories. Use when the user wants to read and understand a repository, inspect model structure and training or inference entrypoints, review configs and insertion points, or flag suspicious implementation patterns without modifying code or running heavy jobs. Do not use for active command execution, broad refactoring, speculative code adaptation, or automatic bug fixing.
request-refactor-plan
mattpocock/skills
Create a detailed refactor plan with tiny commits via user interview, then file it as a GitHub issue. Use when user wants to plan a refactor, create a refactoring RFC, or break a refactor into safe incremental steps.

