Agent skill

Safe Refactor

by JuliusBrussee in JuliusBrussee/caveman

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

— description from SKILL.md by JuliusBrussee
Apache-2.0Auto-check passedDevelopment

Install Safe Refactor

skills CLI
$ npx skills add JuliusBrussee/caveman --skill safe-refactor -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install JuliusBrussee/caveman safe-refactor --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/JuliusBrussee/caveman.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/safe-refactor .claude/skills/safe-refactor && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
safe-refactor
GitHub stars
110k
Used in
1 other repo
Token cost
~177 tokens
SKILL.md length
62 words
Files
2
Skills in repo
18
Repo updated
First seen
Licence
Apache-2.0

At a glance

  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

About this skill

Safe Refactor is a skill in JuliusBrussee/caveman (110k stars). Its SKILL.md is about 177 tokens, with 1 other file in the folder, and copies of it appear in 1 other owners' repositories. Licence: Apache-2.0.

What it can do on your machine

Read from SKILL.md and the folder at commit 538b491. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Safe Refactor loads about 177 tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 62 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~43
When it runs · the whole SKILL.md, loaded when a task matches
~177

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from JuliusBrussee/caveman at commit 538b491, republished under its Apache-2.0 licence (© JuliusBrussee). 62 words, ~177 tokens.

Download SKILL.mdSave it as .claude/skills/safe-refactor/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
safe-refactor
description
Restructure code while preserving behavior. Use for extraction, consolidation, ownership moves, or cleanup where verification must bracket structural edits.

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.

© JuliusBrussee, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/safe-refactor of JuliusBrussee/caveman.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit 538b491

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in JuliusBrussee/caveman, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Safe Refactor next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Safe Refactor compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Safe Refactor this skillJuliusBrussee/caveman110k1 repos~177Automated safety check: PassApache-2.0
Systematic Code Refactoringluongnv89/claude-howto42k—~3kAutomated safety check: PassMIT
Ponytail Lazy Developer ModeDietrichGebert/ponytail158k—~871Automated safety check: PassMIT
Dignified Python Standardsdocling-project/docling69k—~1.5kAutomated safety check: PassApache-2.0
Clean Code GuardamElnagdy/guard-skills1.3k2 repos~4.3kAutomated safety check: PassMIT
Code Refactoring Workflowluongnv89/claude-howto42k—~3.1kAutomated safety check: PassMIT

Similar skills

  • Systematic Code Refactoring

    luongnv89/claude-howto

    Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.

    42k GitHub stars~3k tokensUpdated 8 days ago
    DevelopmentAuto-check passed
  • Ponytail Lazy Developer Mode

    DietrichGebert/ponytail

    Makes the agent pick the laziest solution that works: skip unneeded work, reuse what exists, prefer the standard library and platform features, and keep diffs small.

    158k GitHub stars~871 tokensUpdated today
    DevelopmentAuto-check passed
  • Dignified Python Standards

    docling-project/docling

    Applies opinionated production Python conventions chosen by the project's Python version: modern type syntax, pathlib, explicit checks and interface guidance.

    69k GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Clean Code Guard

    amElnagdy/guard-skills

    Reviews generated or changed production code against Clean Code, SOLID, DRY, KISS, YAGNI and LLM-specific failure modes before it ships, in any language.

    1.3k GitHub starsUsed in 2 repos~4.3k tokens
    DevelopmentAuto-check passed
  • Code Refactoring Workflow

    luongnv89/claude-howto

    Guides systematic, test-backed refactoring in the style of Martin Fowler, moving through research, planning and small incremental changes with your approval at each phase.

    42k GitHub stars~3.1k tokensUpdated 8 days ago
    DevelopmentAuto-check passed
  • A code-change gate for the iPolloWork repository: search and reuse first, keep one source of truth, justify every new file or dependency, and audit the change.

    6.8k GitHub stars~2.7k tokensUpdated today
    DevelopmentAuto-check passed

More from JuliusBrussee/caveman

All 18 skills in this repo
  • Caveman Workflow Labeler

    JuliusBrussee/caveman

    Finds every LLM workflow in a repository, proposes a labeling table and, once you agree, wires labels so Caveman Cloud groups spend per workflow.

    110k GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Caveman Evidence Review

    JuliusBrussee/caveman

    Read-only review of Caveman Cloud data to explain where LLM spend goes: cost, score, workflows, traces, latency, errors, routing and verified savings.

    110k GitHub starsUsed in 1 repo~927 tokens
    Auto-check passed
  • Caveman Experiment Manager

    JuliusBrussee/caveman

    Reads the state and results of Caveman Cloud experiments and reports one recommendation or a block, without changing an experiment's lifecycle itself.

    110k GitHub starsUsed in 1 repo~975 tokens
    Auto-check passed
  • Caveman Optimization Evaluator

    JuliusBrussee/caveman

    Turns a Caveman report-only optimization observation into one minimal code change and a paired baseline evaluation, after the operator picks which to pursue.

    110k GitHub starsUsed in 1 repo~1.2k tokens
    Auto-check passed
  • Caveman Gateway Setup

    JuliusBrussee/caveman

    Routes every LLM call in a repository through the Caveman Cloud gateway in record mode, so requests and costs are measured without changing behavior.

    110k GitHub starsUsed in 1 repo~2.6k tokens
    Auto-check: warnings
  • Caveman Help Card

    JuliusBrussee/caveman

    Quick-reference card for the three caveman skills and their commands. Trigger: /caveman-help or "caveman help".

    110k GitHub stars~690 tokensUpdated today
    Auto-check passed

Categories

Questions about Safe Refactor

How do I install Safe Refactor in Claude Code?

Run `npx skills add JuliusBrussee/caveman --skill safe-refactor -a claude-code`. Or copy the skill folder (skills/safe-refactor in JuliusBrussee/caveman) into .claude/skills/safe-refactor in your project. Claude Code loads it when a task matches its description.

How do I install Safe Refactor in Codex?

Run `npx skills add JuliusBrussee/caveman --skill safe-refactor -a codex`. Or copy the skill folder (skills/safe-refactor in JuliusBrussee/caveman) into .agents/skills/safe-refactor in your project. Codex loads it when a task matches its description.

Can I use Safe Refactor in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add JuliusBrussee/caveman --skill safe-refactor -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/safe-refactor, .gemini/skills/safe-refactor, .github/skills/safe-refactor and .opencode/skills/safe-refactor in your project.

What does Safe Refactor need to run?

SKILL.md names no scripts, command-line tools or credentials: Safe Refactor is instructions for the agent only.

Does Safe Refactor access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Safe Refactor safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Safe Refactor use?

Safe Refactor is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Safe Refactor use?

About 177 tokens (SKILL.md is roughly 708 characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Safe Refactor?

Skills that share tags, products or a category with Safe Refactor: Systematic Code Refactoring (luongnv89/claude-howto, 42k stars), Ponytail Lazy Developer Mode (DietrichGebert/ponytail, 158k stars), Dignified Python Standards (docling-project/docling, 69k stars) and Clean Code Guard (amElnagdy/guard-skills, 1.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Safe Refactor?

JuliusBrussee (a GitHub user) maintains it in JuliusBrussee/caveman, which has 110,443 GitHub stars. The repository holds 18 skills in this directory. The repository was last updated on October 8, 2026.

Source: JuliusBrussee/caveman on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.