Safe-refactor is a discipline skill more than a transformation tool. Its core rule is that you establish what behavior must not change, and run the same verification before and after the structural edit, so the proof brackets the change. It's aimed at extraction, consolidation, and moving ownership between modules, the kind of work where a quiet behavior shift hides easily under a cleanup commit. The instructions push you to keep feature work out of the refactor, to move one ownership boundary at a time, and to keep intermediate states buildable. Preserving public interfaces, error behavior, and ordering is spelled out explicitly, which is the part people usually skip. The honest take: it's mostly a set of guardrails rather than automation, so its value depends on you actually having tests worth running. If your suite is thin, the skill can't manufacture confidence for you.

skills.sh installs
121.2K
GitHub stars
118.7K
last updated
Oct 26, 2026

Install

$ npx -y skills add juliusbrussee/caveman --skill safe-refactor --agent claude-code

Installs into .claude/skills of the current project.

Files

Safe refactor

Define behavior-preservation boundary and establish verification before structural edits.

  • Keep feature changes outside refactor.
  • Move one ownership boundary at a time.
  • Preserve public interfaces, failure behavior, ordering, and compatibility unless explicitly scoped.
  • Keep intermediate states buildable and testable.
  • Avoid dependency or configuration growth without correctness need.

Run same proof after change. Stop when behavior matches and requested structure is achieved.

Sponsors

Details

Repository
github.com/juliusbrussee/caveman
Categories
Code Review & Quality, Rust
First seen
Oct 26, 2026

More from juliusbrussee/caveman

All 25
1juliusbrussee avatarcaveman-evidence-reviewjuliusbrussee/cavemanRead-only review of Caveman Cloud evidence: cost, Cave Score, workflows, traces, latency, errors, routing, savings. Use when asked what Caveman found or where L119Kskills.sh installs
2DietrichGebert avatarponytail-helpDietrichGebert/ponytailQuick-reference card for all ponytail modes, skills, and commands. One-shot display, not a persistent mode.52.4Kskills.sh installs
3dietrichgebert avatarponytail-gaindietrichgebert/ponytailShow ponytail's measured impact as a compact scoreboard: less code, less cost, more speed, from the benchmark medians. One-shot display, not a persistent mode, 50.3Kskills.sh installs
4heygen-com avatarstyle-samplingheygen-com/hyperframesMake a new episode in a proven video style - Collage Explainer, Finance Explainer, Animated Science Explainer, 3D Brand Explainer, 3D True Crime - on the person38.8Kskills.sh installs
5googleworkspace avatarrecipe-review-overdue-tasksgoogleworkspace/cliFind Google Tasks that are past due and need attention.30.8Kskills.sh installs
6googleworkspace avatarrecipe-review-meet-participantsgoogleworkspace/cliReview who attended a Google Meet conference and for how long.30.8Kskills.sh installs