Install
openclaw skills install refactoringDeep refactoring workflow—characterization tests, incremental steps, behavior preservation, design direction, and verification. Use when improving structure without changing external behavior, or paying down tech debt safely.
openclaw skills install refactoringRefactoring changes structure, not behavior. Safety comes from small steps, fast feedback, and verification (tests, golden outputs, or controlled manual checks).
Trigger conditions:
Initial offer:
Use six stages: (1) clarify goal & scope, (2) establish safety net, (3) plan increments, (4) execute with reviewable commits, (5) verify behavior, (6) document & follow-ups). Confirm test coverage and release pressure.
Goal: Why refactor now—reduce coupling, enable feature X, remove dead code, improve naming.
Exit condition: Explicit non-goals (no feature changes in this effort unless separately scoped).
Goal: Prefer characterization tests for legacy; golden outputs for data pipelines; use snapshot tests sparingly.
Goal: Small commits, each leaving the codebase working (not necessarily perfect).
Goal: Each PR/commit tells a story; avoid thousand-line “cleanup” dumps.
Goal: CI green; compare outputs for batch jobs; manual smoke on critical paths when needed.
Goal: ADR or short module README for new boundaries; tickets for remaining debt accepted consciously.