agentsclimarketplace

Safe refactor

Skill swd3k/skills/agent-skills/programming/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

Install
npx -y skills add swd3k/skills --skill safe-refactor

Assembled 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

  1. Green before green — tests or manual script pass first.
  2. Change structure or behavior, not both in one commit.
  3. Prefer extract method/class over rewrites.
  4. Keep public behavior identical unless ticket says otherwise.

Steps

  1. Characterization test around the mess.
  2. Extract interface at the boundary you need.
  3. Move implementation; keep façade.
  4. Delete dead code only after call graph check.
  5. 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.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.