This guide helps plan frontend refactors by identifying issues, prioritizing them by risk and impact, and breaking work into testable phases. It covers component and state changes, performance, accessibility, testing, rollout safeguards, and criteria for considering the refactor complete.
86%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Create safe, phased refactor plans for complex frontend code.
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
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
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
Feature flags for gradual rollout, A/B testing refactored vs original, monitor error rates, have rollback plan, peer review all changes, incremental deployment.
Code coverage >80%, performance metrics improved, accessibility score 95+, no regressions in tests, code review approved, documentation updated.
sathishssj3/Stereix-Engine
1e0ee85
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.