refactor

refactor is a skill for Claude Code, Codex from greglas75/zuvo. It costs 79 tokens per session (32,821 once invoked), scanned A, original, MIT.

A structured refactoring runner for safely restructuring existing code, such as extracting methods, splitting files, removing circular dependencies, or cleaning up overly large classes. It uses staged checks and can resume interrupted work.

In plain words
What is it for?
It is for running full or batched refactoring workflows with evaluation, tests, implementation, proof, and recorded safety checks.
Why use it?
It adds a repeatable process for proving that a refactor is safe before committing it.

Skill for Claude CodeCodex

Part of the zuvo plugin — 56 skills, 48 agents, 5 hooks shipped together

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/greglas75/zuvo/refactor
Any agent
npx skills add greglas75/zuvo --skill refactor
Clone the repo
git clone --depth 1 https://github.com/greglas75/zuvo

Made for: Claude Code, Codex.

Or install zuvo, the plugin that ships this one along with the rest of its 56 skills, 48 agents, 5 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for refactor

README.md
[![agentmods](https://agentmods.dev/badge/skills/greglas75/zuvo/refactor.svg)](https://agentmods.dev/skills/greglas75/zuvo/refactor)
Your own site
<a href="https://agentmods.dev/skills/greglas75/zuvo/refactor"><img src="https://agentmods.dev/badge/skills/greglas75/zuvo/refactor.svg" alt="Measured on agentmods" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 32,821 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.00079 $0.32821
Opus 5 $0.00039 $0.16411
Sonnet 5 $0.00016 $0.06564
Haiku 4.5 $0.00008 $0.03282

Measured yesterday against content hash 60d2e7f9b91f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

refactor 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 yesterday.

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.

skills/refactor/SKILL.md · 1,559 lines

How it starts

The opening of the file, as written. The whole thing — 1,559 lines — stays where its author put it; the contents beside it link to each section on GitHub.

zuvo:refactor

A senior architect executing a structured refactoring workflow. Every refactoring follows ETAP stages (Evaluate, Test, Act, Prove) with quality gates at each transition.

Definition of Done (non-negotiable — read before you start)

A refactor is BLOCKED until proven, and the proof is the CONTRACT, not your say-so. The canonical order is Prove → record in CONTRACT → Gate → Commit (LAST). The commit is the final action, and an external git hook (refactor-safety-gate, self-installed at Phase 0) enforces this: a git commit whose staged files intersect this refactor's scope fence is rejected until the CONTRACT records a completed Prove step. There is no condensed / light / "5-step" path that skips this — git hooks fire on every harness, so it cannot be narrated past (two ESCAPES exist and are logged, not hidden: ZUVO_ALLOW_ADHOC=1 bypasses the hook entirely, and ZUVO_GATE_TTL_SEC=0 marks any CONTRACT stale so the Prove check is skipped — both are human-attributable env decisions, never something the skill itself sets).

The four SAFETY gates — never skippable, never reducible by "user scope", never "looks small so I skipped it":

  1. Characterization coverage of every moved unit, green on the PRE-refactor code (before touching it).
  2. Independent CQ Auditor (blind audit) → record prove.blind_audit ∉ {skipped,not_run}.
  3. Adversarial review on the final diff → record prove.adversarial ∉ {skipped,not_run}.
  4. Remediation: in-fence bugs the audit/adversarial surface are FIXED in this run (staged before the gated commit), NOT backlogged. Only out-of-fence / user-declined items defer (each documented).

TELEMETRY (CONTRACT, retro, run-log) is cheap — always do it. BUILD SCOPE (targeted vs full turbo build) the user MAY narrow, but only by DECLARING it. Skipping a SAFETY gate, or running it and parking its findings, = the run is BLOCKED(unsafe). Full stop. Everything below is HOW; this is WHAT.

Read the full file on GitHub · 1,559 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 1,559 lines · 79 tokens per session scan A 60d2e7f9b91f

Subscribe to this mod's changes

refactor is a skill published in the GitHub repository greglas75/zuvo (6 stars, last pushed today), licensed MIT. It adds 79 tokens to every session and 32,821 once invoked, about $0.0004 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-09-03.

Related

Other skills, from other repositories

debt-ops-init

Write or refresh a "Tech debt operations" section in the project's AGENTS.md so the team shares one source of truth for debt-ops disciplines. Run ONLY when the user explicitly asks to set up, install, or initialize debt-ops disciplines — never auto-invoke. Idempotent; only the managed section changes, other sections…

bcanfield/agentic-tech-debt · 76 tokens

init

Write or refresh the ## Tech debt operations section in CLAUDE.md so a team shares one source of truth for debt-ops disciplines and cached quality commands. Idempotent. Only the managed section changes; other sections are untouched. Invoked explicitly via /debt-ops:init (solo users get the same content from the…

bcanfield/agentic-tech-debt · 74 tokens

add

Register a deferred decision in the debt registry. Trigger by judgment, not a marker scan, whenever a future reader would ask "why this way?": an unmade decision, stub, loosened type, bypassed check, swallowed error, a default picked "for now", or a TODO/FIXME/HACK/XXX marker. Trigger immediately whenever you defer…

bcanfield/agentic-tech-debt · 110 tokens

metrics

Print a debt-ops health summary from the metrics log, covering registration rate, hook feedback action rate, ADR creation, and AI-authored share. Use when the user asks for "debt-ops metrics", "debt health", "registry stats", or invokes /debt-ops:metrics. Read-only, never writes the log.

bcanfield/agentic-tech-debt · 72 tokens

review

Audit the debt registry, rank survivors by churn × Fowler quadrant, surface a top-N list, then walk paydown on user follow-up. Use when the user asks to review debt, see what to pay down, work through entries, or invokes /debt-ops:review. Stale entries drop with drop A,B,C.

bcanfield/agentic-tech-debt · 70 tokens

debt-ops-add

Register a deferred decision in the tech-debt registry. Trigger by judgment, not a marker scan, whenever a future reader would ask "why this way?": an unmade decision, stub, loosened type, bypassed check, swallowed error, a default picked "for now", or a TODO/FIXME/HACK/XXX marker. Trigger immediately whenever you…

bcanfield/agentic-tech-debt · 115 tokens