refactoring

refactoring is a skill for Claude Code from scolladon/craft. It costs 38 tokens per session (527 once invoked), scanned A, original, MIT.

A software-maintenance step that reviews the wider codebase for structural improvements while keeping its behavior unchanged. It looks beyond the files directly changed by a feature.

In plain words
What is it for?
Use it to assess whether code should be shared, moved, or reorganized after a feature is built, while avoiding speculative changes.
Why use it?
A feature can reveal duplicated code or responsibilities placed in the wrong layer that a narrow review would miss. It can also record that no safe improvement was needed.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the craft plugin — 22 skills, 4 commands, 10 agents, 3 hooks shipped together

Good fit Use it to assess whether code should be shared, moved, or reorganized after a feature is built, while avoiding speculative changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/scolladon/craft/refactoring
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.

Any agent
npx skills add scolladon/craft --skill refactoring
Clone the repo
git clone --depth 1 https://github.com/scolladon/craft

Made for: Claude Code.

Or install craft, the plugin that ships this one along with the rest of its 22 skills, 4 commands, 10 agents, 3 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 refactoring

README.md
[![agentmods](https://agentmods.dev/badge/skills/scolladon/craft/refactoring/github.svg)](https://agentmods.dev/skills/scolladon/craft/refactoring)
Your own site
<a href="https://agentmods.dev/skills/scolladon/craft/refactoring"><img src="https://agentmods.dev/badge/skills/scolladon/craft/refactoring/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for refactoring

Your own site · 80×15
<a href="https://agentmods.dev/skills/scolladon/craft/refactoring"><img src="https://agentmods.dev/badge/skills/scolladon/craft/refactoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 527 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00038 $0.00527
Opus 5.5 $0.00015 $0.00211
Sonnet 5.5 $0.00008 $0.00105
Haiku 4.5 $0.00004 $0.00053

Measured 10d ago against content hash 5aa753aa44b6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

refactoring 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 10d 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.

skills/refactoring/SKILL.md · 37 lines

How it starts

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

craft:refactoring

Preamble (always runs — non-overridable)

  1. Manifest read (lint if standalone); gates as in implementation's preamble.

Procedure (default body — a manifest override: replaces everything below)

  1. Judgment — session-owned, in-thread: quick candidate scan seeded by the feature's diff, radiating only as far as the feature's concerns reach: duplication now warranting centralization, responsibilities in the wrong layer, the Nth consumer of a pattern that should become shared. Bounded by YAGNI/KISS — no speculative abstraction.
  2. Nothing clears the bar → first-class no-op. Record NO-OP(refactoring): nothing cleared the bar — <justification> in the run record, the 1–3 line justification stating what was considered and why nothing changed; the run record is carried into the PR body (documentation phase), so the no-op is stated, not hidden. This is a recorded outcome symmetric with the decisions phase's NO-OP(decisions): line — same token, kept idiom — not an implicit skip. Spawning an agent merely to conclude no-op is forbidden waste. A silent skip is not allowed.
  3. Candidates survive → scope each into a precise spec (what moves where, which symbols/files, expected mechanical test changes, blast radius), then spawn craft:refactor-executor with the specs, gates, and context files. Integrate-don't-defer: in-scope gains land NOW in this change; only a genuinely feature-sized refactor (own design + rulings) is deferred under the run skill invariant Impacts: fold or defer at discovery. A refactor the executor reports and does not execute (contracts/refinement.md, the "reported in the final message" rule) is an impact.
  4. Re-review, scoped to the refactor diff only, via craft:review's procedure (same dimensions, per-dimension convergence ≤3). Findings implying FURTHER refactoring are deferred, not another loop. gates.phase green to close.
  5. Order rationale: this runs BEFORE validation so validation scores the final shape.

Read the full file on GitHub · 37 lines

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. 10d ago Changed 5aa753aa44b6
  2. 1mo ago Changed · +2 lines e5495b0015f2
  3. 3mo ago First seen · 35 lines · 38 tokens per session scan A 37ca005f8e05

Subscribe to this mod's changes

refactoring is a skill published in the GitHub repository scolladon/craft (2 stars, last pushed 10d ago), licensed MIT. It adds 38 tokens to every session and 527 once invoked, about $0.0002 per session on Opus 5.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-31.

Related

refactoring compared with skills from other repositories

refactoring next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
refactoringscolladon/craftSkill210d agoMITA38Claude Code
orc-debugHigorAlves/orcSkill73d agoMITA56Codex
linked-intent-devjszmajda/lidSkill1223d agoMITA110Claude Code
skeptical-triageavelikiy/great_ctoSkill11714d agoMITA49Claude Code
anti-patternsavelikiy/great_ctoSkill11714d agoMITA59Claude Code
audit-state-machinesdoodledood/manifest-devSkill80todayMITA105Claude Code
observability-baselineavelikiy/great_ctoSkill11714d agoMITA100Claude Code