Refactor (behavior-preserving)

A procedure for reorganising code in small steps while keeping its behaviour unchanged.

In plain words
What is it for?
Extracting functions, renaming code, removing duplication, or inlining code while verifying tests or type checks.
Why use it?
It reduces the risk that cleanup work accidentally introduces bugs by requiring tests and checks after each change.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/auravixstudio/caelo/refactor
Any agent
npx skills add AuraVixStudio/caelo --skill refactor
Clone the repo
git clone --depth 1 https://github.com/AuraVixStudio/caelo

Made for: Claude Code, Codex.

Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 243 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00019 $0.00243
Opus 5 $0.00010 $0.00121
Sonnet 5 $0.00004 $0.00049
Haiku 4.5 $0.00002 $0.00024

Measured 3d ago against content hash 22b2d0a3bb91, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

Refactor (behavior-preserving) scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

caelo_core/skills/builtin/refactor/SKILL.md · 27 lines

What it actually says

Refactor (behavior-preserving)

Use this to improve readability/structure without changing what the code does.

Steps

  1. Pin behavior. Make sure there are tests (or add a couple) that capture the current behavior before you touch anything.
  2. Small steps. Make one structural change at a time (extract function, rename, dedup, inline). Keep each step mechanical and reversible.
  3. Verify each step. Run tests / type-check after each change. Never batch many refactors and verify once at the end.
  4. No behavior change. If you spot a bug, note it and fix it in a separate change — not inside the refactor.
  5. Report. Summarize the structural changes and confirm behavior is unchanged.

Notes

  • Match the surrounding style and naming. The diff should read as obviously equivalent.
  • Stop when the code is clear — refactoring has diminishing returns.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 27 lines · 19 tokens per session scan A 22b2d0a3bb91

Subscribe to this mod's changes

Refactor (behavior-preserving) is a skill published in the GitHub repository AuraVixStudio/caelo (22 stars, last pushed 21d ago), licensed Apache-2.0. It adds 19 tokens to every session and 243 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.