refactoring
Execute an agreed structural move while preserving behavior. Triggers on "refactor structure", "重构结构".
Files3
View on GitHubSKILL.mdskills/05-tune/refactoring/SKILL.md
GitHubRefactoring
When to use
- Execute an agreed structural move while preserving behavior.
Not for: codebase-design for choosing boundaries; simplify for local clarity.
Steps
Define the move and behavior contract; establish tests or characterization evidence.
Plan incremental file, symbol, import and ownership changes; use automation for repetitive moves.
Move coherent units and run affected checks; separate features and use compatibility only for actual consumers.
Verify old references, exports, packaging, documents and runtime paths.
Verify
- Contracts are preserved; moved symbols resolve and abandoned references are removed.
References
- engineering-principles.md — shared decision boundaries, scope and verification.
- references/refactoring-catalog.md — before→after examples + characterization-test guidance for each move (extract, move, split, merge, change-dependency)