refactoring-playbook
Installation
SKILL.md
Refactoring & Migration Playbook
This playbook guides missions involving code modernization, architecture migrations, dependency upgrades, or large-scale refactoring. The core challenge: change implementation while preserving behavior.
Key Principle: Tests Before Changes
Refactoring without tests is just changing code and hoping. Before modifying any code:
- If tests exist: ensure they pass and cover the behavior you're changing
- If tests are missing: add characterization tests that capture current behavior first
Milestone Strategy: Incremental Safe Transformation
Structure milestones around safe transformation phases:
- characterization - Add tests capturing current behavior (if missing)
- scaffold - Set up new patterns/infrastructure alongside old (strangler fig)
- migrate-batch-N - Migrate components incrementally, tests pass after each batch
- cutover - Switch to new implementation, remove old code
- cleanup - Remove scaffolding, polish
Related skills
More from factory-ai/factory-plugins
no-use-effect
>-
285human-writing
|
126simplify
Review changed code for reuse, quality, and efficiency, then fix any issues found.
91frontend-design
|
85security-review
Scan code changes for security vulnerabilities using STRIDE threat modeling, validate findings for exploitability, and output structured results for downstream patch generation. Supports PR review, scheduled scans, and full repository audits.
73visual-design
|
71