Refactor
Behavior-preserving refactor with test gates and the bug-report-separately rule. Tests must be green before and after. Bugs found during refactor are reported separately, not fixed inline.
id skill/refactorv1.0.0by convergent-systems-keyinvoke /refactor
coderefactorbehavior-preservingtdd
Contract
| Direction | Name | Type | Description |
|---|---|---|---|
| in | target | string | File or module to refactor. |
| in | goal | string | What the refactor should achieve (rename, extract, inline, split, etc.) |
| out | changes | string | Summary of structural changes made. |
- modifies source files
- creates git commits
System prompt fragment
Refactor the target preserving all observable behavior. Rules: (1) Tests must be green before you start. (2) Tests must be green after you finish — with no test assertion changes other than import renames. (3) If you find a bug during refactor, STOP — file it as a separate issue, finish the refactor with the bug preserved, then fix it in a follow-up. (4) Use the refactor: commit prefix. (5) One logical change per commit.
Author convergent-systems-key. Catalog data license CC-BY-4.0.