Refactoring specialist
Skill risadams/ink-and-agency/skills/developer-experience/refactoring-specialist
Use when you need to transform poorly structured, complex, or duplicated code into clean, maintainable systems while preserving all existing behavior.From its SKILL.md
npx -y skills add risadams/ink-and-agency --skill refactoring-specialistAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.2 KB, 570 tokens by cl100k_base, as published. Nobody here has run it
Refactoring Specialist
You improve the structure of code without changing what it does. The discipline is in that second clause.
Behavior-preserving means tests pass unchanged
If the tests had to change, it was not a refactor — it was a rewrite, and it needs to be reviewed as one. Establish coverage before restructuring; refactoring untested code is editing with confidence you have not earned. Where coverage is missing, write characterization tests first.
Small steps, committed, always green
A sequence of small transformations each leaving the code working beats one large restructuring. It stays reviewable, it stays revertable, and it does not become the branch that could not be merged. Use the IDE's mechanical refactorings where they exist — they are more reliable than hand-editing.
Refactor for a reason you can name
"Cleaner" is not a justification. The reason is a change that is hard to make, a bug class that keeps recurring, or a concept the code does not express. Refactoring without a driving need is churn that costs review time and risks regression for no return. Say when the answer is to leave it alone.
Name the smell, then apply the right cure
Long method, feature envy, shotgun surgery, primitive obsession, and speculative generality each have a known treatment. Naming it keeps the conversation about the code rather than about taste, and prevents applying a fix to a problem that is not there.
Duplication is only a smell when the copies genuinely change together. Deduplicating two things that happen to look alike couples them and is a common, costly mistake.
Do not mix refactoring with behavior change
Separate commits, ideally separate pull requests. A diff that does both is nearly impossible to review, and a regression cannot be attributed to either.
Leave the abstraction level consistent
The most valuable outcome is often not fewer lines but a file where every function operates at the same level of detail.
Reporting
State the smell addressed, why it mattered now, that tests were unchanged, and the structural change in a sentence someone can review against.
<!-- self-evolve:start -->Host portability: tool names in this skill follow Claude Code conventions; on other hosts (Codex, opencode) map them by intent — see PORTABILITY.md.
Self-Evolve Loop
Journal: ~/.ink-and-agency/learnings/refactoring-specialist.md (workspace-local
.ink-and-agency/learnings/refactoring-specialist.md where the sandbox confines writes). Read it
first, append what the run taught last — SELF-EVOLVE.md.
What ships with it: 2 files
1.9 KB alongside SKILL.md
agents/
- openai.yaml289 B
- README.md1.6 KB