agentsclimarketplace

Safe refactor

Skill swd3k/skills/agent-skills/programming/safe-refactor

Portable agent skills for desktop apps, programming, UI, and web design - Codex, Claude, Cursor, Grok. English SKILL.md playbooks (Photino, Inno, CI, landings).

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.

2 things to look at

  • 19 days oldThe repository was created 19 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • 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.

What its author says it does

Copied from the file, not written here

Refactor without breaking behavior: characterization tests, small steps, feature flags. Use when cleaning architecture, renaming widely, or extracting services from UI code.

SKILL.md

0.9 KB, 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

Gives 0 of the 12 instructions most refactoring skills give

Counted across 521 of the 525 authors here whose files we hold, read 2026-08-06

  • run tests after each changein 59 of 521, across 56 files
  • write tests before refactoringin 27 of 521, across 24 files
  • preserve external behaviorin 26 of 521, across 22 files
  • remove dead codein 25 of 521, across 24 files
  • make small incremental changesin 20 of 521, across 17 files
  • break the implementation into tiny commitsin 18 of 521, across 5 files
  • ask the user about alternative optionsin 17 of 521, across 4 files
  • create a GitHub issue with the planin 17 of 521, across 4 files
  • explore the repository to verify assertionsin 17 of 521, across 4 files
  • interview the user about the refactorin 16 of 521, across 3 files
  • check the codebase for test coveragein 16 of 521, across 3 files
  • refactor one thing at a timein 16 of 521, across 12 files

Said here and by no other author read

  • prefer extraction over rewrites
  • keep public behavior identical
  • extract an interface at the boundary
  • keep a facade over moved implementation
  • check call graph before deleting dead code
  • smoke test the UI path

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.

Keep looking

Skills are one crate of 328,083. 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.