Safe refactor
Refactor without breaking behavior: characterization tests, small steps, feature flags. Use when cleaning architecture, renaming widely, or extracting services from UI code.From its SKILL.md
npx -y skills add swd3k/skills --skill safe-refactorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 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
0.9 KB, 172 tokens by cl100k_base, as published. Nobody here has run it
Safe Refactor
Rules
- Green before green — tests or manual script pass first.
- Change structure or behavior, not both in one commit.
- Prefer extract method/class over rewrites.
- Keep public behavior identical unless ticket says otherwise.
Steps
- Characterization test around the mess.
- Extract interface at the boundary you need.
- Move implementation; keep façade.
- Delete dead code only after call graph check.
- Run full test suite + smoke the UI path.
Pitfalls
- Drive-by formatting across the repo
- Renaming and logic change together
- "Temporary" dual code paths that become permanent
Acceptance
- Behavior checklist from before still passes
- Diff is reviewable in < ~400 lines per commit when possible
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.