What problem does it solve?
Logical refactors often risk unintentionally changing behavior, breaking invariants, or expanding scope beyond the intended fix; this workflow helps you update behavior while preserving what must not change.
Core Features & Use Cases
- Ambiguity detection with explicit clarification: flags unresolved acceptance criteria, invariants, environment constraints, and scope irreversibility before editing.
- Change-plan first, then implementation: requires a before/after definition, preserved vs changed invariants, files to modify, and risks before touching code.
- Test-driven safety for behavior equivalence: updates, adds, and verifies regression and characterization tests to ensure preserved invariants remain true.
- Scope control and PR-ready evidence: stops or escalates when the refactor grows, and packages before/after behavior plus test evidence for review.
- Quality guardrails: enforces fan-out discipline for multi-file/high-risk changes and maintains efficiency via the skill’s orchestration outputs.
Quick Start
Use the hatch3r logical refactor workflow to update business logic safely by asking the AI to execute the full refactor plan for your issue and validate invariants with updated and added tests.