Install any skill in seconds. Free to start, no credit card required.
Get Started Free →testdouble/refactor
Restructure existing code without changing its behavior, through a test-gated refactoring loop: a named target, a green suite over that target before any edit, a planned sequence of small named refactorings, and the full suite re-run after every step.
2 of 25 test cases passed with the skill.
Tokens, turns and time describe resource use, not a dollar price.
Lift withheld: 3 comparable cases; this report requires 8.
A test case the skill fixed. Same model, same prompt, with and without the skill.
While refactoring `src/finance/tax.ts`, step 1 failed tests and was reverted. Then step 2 also failed tests and was reverted. What is the immediate next action?
| Checked | Without skill | With skill |
|---|---|---|
| Stops execution and asks for user re-scoping after two consecutive reverted steps | Missed | Passed |
The instructions your model reads when the skill loads.
which git 2>/dev/null || echo "not installed"git branch --show-current 2>/dev/null || echo unknowngit status --porcelain 2>/dev/null | head -5find . -maxdepth 1 -name "CLAUDE.md" -type ffind . -maxdepth 3 -name "project-discovery.md" -type fbash "${CLAUDE_PLUGIN_ROOT}/scripts/han-config-dir.sh" 2>/dev/null || echo "$HOME/.claude"cat .han/config.md 2>/dev/null || echo ""As your first action, use the Read tool on .han/config.md inside the personal config directory path above. A read
that returns no file is no personal configuration: continue silently. When that file or the project .han/config.md
probe supplies content, apply it per config-rule.md, which governs precedence
between the two files, relative-path resolution, and what to do with a file that reads but cannot be used.
This skill restructures existing production and test code in your working tree. It is an execution skill, not a document generator. These constraints shape every step and override any instinct to move faster. The canon they derive from, with provenance, is in references/refactoring-discipline.md; pull that reference when a step needs the full rule or a step feels off.
/tdd owns cleanup inside the loop, and restructuring
while a test is red violates the two-hats rule both skills share.test cases passed with the skill
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.