Skip to main content

safe-refactor

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

CavemanApache-2.0

SKILL.md

Written by Caveman and published in JuliusBrussee/caveman under the Apache-2.0 license. Treq shows it unchanged except for heading levels and links to files on GitHub.

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.

When safe-refactor runs

Claude Code and Codex keep each installed skill's name and description in context. When a request matches the description, the agent loads the full SKILL.md. You can also run it yourself: type /safe-refactor in Claude Code or $safe-refactor in Codex.

The description says when to use it:

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

Install safe-refactor

Claude Code

Copy the safe-refactor folder into .claude/skills/ in your project. To use it in every project, copy it into ~/.claude/skills/ instead.

git clone --depth 1 https://github.com/JuliusBrussee/caveman.git /tmp/JuliusBrussee-caveman
mkdir -p .claude/skills
cp -r /tmp/JuliusBrussee-caveman/skills/safe-refactor .claude/skills/

Codex

Codex reads skills from .agents/skills/ in your repository, and from ~/.agents/skills/ for every repository. It detects new skills on its own. Restart Codex if safe-refactor does not appear.

git clone --depth 1 https://github.com/JuliusBrussee/caveman.git /tmp/JuliusBrussee-caveman
mkdir -p .agents/skills
cp -r /tmp/JuliusBrussee-caveman/skills/safe-refactor .agents/skills/

Treq

Open Settings and select the Skills tab. The tab appears when Skills installation is on under Settings → Feature Preview. Search for safe-refactor and choose Install….

Install for repository writes the skill under .treq/skills/ in the current repository. Install for application makes it available to every repository on this machine. Each new workspace gets a copy in .claude/skills/ and .agents/skills/, so Claude Code and Codex both find it. See Installing Skills from the Library.

Files

safe-refactor ships 2 files, 906 B in total. Select a file to load it from GitHub.

agents/openai.yaml201 BView on GitHub ↗

All skills by Caveman