/dwin-skills:refactorfrom Dwin Skills
Change the structure of code without changing its behavior. Use when the user asks to refactor, restructure, clean up, simplify, or deepen code, or asks what in a codebase is worth refactoring.
Ships in Dwin Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A refactor changes structure and leaves behavior as it was. A change that adds behavior is a feature. A change that corrects behavior is a bug fix. When the work turns up either one, split it out and finish the structural change first.
Use the design skill's vocabulary for structure and CONTEXT.md for the
domain's names.
Before any structure moves, capture what the code does now in a check you can rerun: a characterization test, a snapshot, or a script that records the outputs for fixed inputs. A passing type check or lint run is not a pin.
Write the pin at the module's interface, so it survives the restructuring. Run it on the unchanged code and see it pass.
State what the modules, types, and call graph would be if the code were written today, knowing everything known now. Design that shape as a whole, then deliver it in steps.
The new shape must remove something: a branch, an invalid state, a layer, a duplicate. A reshape that only adds indirection is not worth making, and code whose shape is already clear and local stays as it is.
When the target changes a module's interface, sketch at least two shapes with
design before moving anything.
By default, keep callers working through the change, as
engineering-principles requires: add the new interface, move callers to it,
and remove the old one once nothing uses it. Every step passes the pin.
Users of the old interface include what a search of this repository does not show: stored data, messages already sent, callers in other repositories, and older instances still running during a staged deployment. While any of them depends on the old interface, keep it, or ask the user to approve the breaking change.
Option: migrate every caller and delete the old interface in one change. This leaves no shim and no period with two ways to do one thing. Use it only when the user asks for it, or agrees after you propose it. Propose it when all of these hold:
With this option, change the tests to assert the new contract, and delete the tests that only protected details of the old implementation.
State the structure that changed, the pin and its result, what was removed, what was reverted, and any feature or bug fix that was split out.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub dwin/skills --plugin dwin-skills52 skills in this plugin
/arenaHave several agents attempt the same task, pick the strongest attempt as the base, and graft the best parts of the others into it. Use for "arena this" or when one attempt at an artifact would lock in the wrong shape./autopilotDrive a branch to a ready pull request. Keeps it current with its base, gets local review from a different model family, marks it ready, and handles CI and AI-reviewer feedback. With `merge`, also merges it. Use when the user invokes autopilot./babysitMonitor or babysit an open pull request through CI, mergeability changes, and review feedback. Use when the user asks to watch a PR, keep checking it, diagnose checks, address in-scope findings, or stay with it until it is merged, closed, or genuinely needs user input.