refactor
Installation
SKILL.md
Refactor
Run Command Center's refactoring agent over a diff. Command Center plans the refactoring, spawns its own coding-agent sessions to apply it, and leaves the result as uncommitted edits in the working tree.
When to invoke
The user asks to refactor recent changes using Command Center — the current branch, a commit range, or uncommitted work. Examples:
- "Refactor this branch with Command Center."
- "Run the Command Center refactoring agent on my changes."
- "Deduplicate the code I just wrote using CC."
Before invoking — important
- The refactoring edits the working tree. Do not edit files in the repo while the runner is waiting, and re-read any files you have cached once it finishes (the result lists exactly which files are dirty).
- Prefer a committed baseline. If there is meaningful uncommitted work, suggest committing it first so the refactoring is cleanly reviewable (and revertible) as
git diff. Not a hard requirement —--working-treeexists for refactoring uncommitted changes deliberately. - It takes a while — don't busy-poll. Typically minutes, up to tens of minutes for large diffs, and progress only updates between workflow steps, so quiet stretches of 10+ minutes are normal. The runner emits a heartbeat status line about once a minute during those stretches as proof of life. Run it in the background if your harness supports that, check on it at multi-minute intervals, and don't narrate every empty check to the user — relay progress lines when they appear.