Safe Refactor skill for Claude

Restructure code while preserving behavior.

When Claude uses it

Use for extraction, consolidation, ownership moves, or cleanup where verification must bracket structural edits.

Safe Refactor SKILL.md

The full skill file from JuliusBrussee/caveman (Apache-2.0).

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.

How to install Safe Refactor

Claude Code

Copy the skill into your personal skills folder (or into .claude/skills/ inside a project):

npx degit JuliusBrussee/caveman/skills/safe-refactor#main ~/.claude/skills/safe-refactor

Codex

npx degit JuliusBrussee/caveman/skills/safe-refactor#main ~/.codex/skills/safe-refactor

Claude.ai and Claude Desktop

Download the skill folder from GitHub, zip it, and upload it under Settings → Capabilities → Skills.

Frequently asked questions

+What does the Safe Refactor skill do?

Restructure code while preserving behavior. Use for extraction, consolidation, ownership moves, or cleanup where verification must bracket structural edits.

+How do I install Safe Refactor in Claude Code?

Copy the skill folder into ~/.claude/skills/safe-refactor, for example with "npx degit JuliusBrussee/caveman/skills/safe-refactor#main ~/.claude/skills/safe-refactor". Claude Code loads it automatically and uses it when a task matches.

+Does Safe Refactor work with ChatGPT or Codex?

Yes. Safe Refactor uses the open SKILL.md format. In Codex, put the folder in ~/.codex/skills/safe-refactor. In Claude.ai, zip the folder and upload it under Settings → Capabilities → Skills.

+Is Safe Refactor free?

Safe Refactor is published on GitHub by JuliusBrussee under the Apache-2.0 license, which allows free use.

Related software development skills

  1. Code Review

    Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's…

    mattpocock/skills★ 327k
  2. Using Agent Skills

    Discovers and invokes agent skills. Use when starting a session, or when you need to decide which skill or workflow applies to the piece of…

    addyosmani/agent-skills★ 119k
  3. Build

    Fully automate a coding task with make-plan, do, and babysit.

    thedotmack/claude-mem★ 118k
  4. Code Review And Quality

    Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human.

    addyosmani/agent-skills★ 119k
  5. Debugging And Error Recovery

    Guides systematic root-cause debugging. Use when tests fail, builds break, something that worked yesterday broke, behavior doesn't match…

    addyosmani/agent-skills★ 119k
  6. Deprecation And Migration

    Manages deprecation and migration. Use when removing old systems, APIs, or features.

    addyosmani/agent-skills★ 119k
  7. Documentation And Adrs

    Records decisions and documentation, and detects when documentation has drifted from the code it describes.

    addyosmani/agent-skills★ 119k
  8. Doubt Driven Development

    Subjects every non-trivial decision to a fresh-context adversarial review before it stands.

    addyosmani/agent-skills★ 119k
  9. Git Workflow And Versioning

    Structures git workflow practices. Use when making any code change.

    addyosmani/agent-skills★ 119k

See all software development skills →

More skills from JuliusBrussee

  1. Surgical Patch

    Fix bugs and small behavior changes at the narrowest responsible layer.

    JuliusBrussee/caveman★ 121k
  2. Ultracave

    Caveman at maximum compression: fragments, one word when one word is enough, each fact once. Invoke only with /ultracave or /caveman ultra.

    JuliusBrussee/caveman★ 121k
  3. Verify And Stop

    Prove existing work meets acceptance conditions without expanding scope.

    JuliusBrussee/caveman★ 121k

All skills by JuliusBrussee →

Give your whole team an AI agent with skills

Cody runs managed AI agents your team can message in Slack, Teams, WhatsApp and the web, with 50+ business integrations, scheduled tasks and memory. No terminal required.