extra: Skill for Claude Code

.claude/skills/refactoring/SKILL.md

refactoring is a skill for Claude Code from extra-org/extra. It costs 26 tokens per session (750 once invoked), scanned A, original, MIT.

A guide to refactoring, which means changing code structure without changing what the program does. It emphasizes small steps, preserved interfaces, and the project’s architectural layers.

In plain words
What is it for?
Use it when extracting functions, splitting large files, renaming code, removing duplication, or reducing complexity before a feature change.
Why use it?
It reduces the risk of breaking existing behavior while improving names, file structure, readability, or duplicated code.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions AGENTS.md.

This is extra-org/extra's own configuration. It tells Claude Code how to work on extra itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything extra configures →

Reuse

Borrowing it

Nothing to install: this file belongs to extra-org/extra. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/extra-org/extra/main/.claude/skills/refactoring/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/extra-org/extra

Made for: Claude Code.

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/extra-org/extra/refactoring/github.svg)](https://agentmods.dev/skills/extra-org/extra/refactoring)
Your own site
<a href="https://agentmods.dev/skills/extra-org/extra/refactoring"><img src="https://agentmods.dev/badge/skills/extra-org/extra/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/extra-org/extra/refactoring"><img src="https://agentmods.dev/badge/skills/extra-org/extra/refactoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 750 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00026 $0.00750
Opus 5.5 $0.00010 $0.00300
Sonnet 5.5 $0.00005 $0.00150
Haiku 4.5 $0.00003 $0.00075

Measured 2mo ago against content hash 1c7df088788e, 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 2mo 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.

.claude/skills/refactoring/SKILL.md · 86 lines

How it starts

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

Skill: Refactoring

Purpose

Change the shape of code without changing its behavior, safely and in small steps, while preserving the project's layers and public contracts.

When to Use This Skill

  • Improving structure, naming, or readability of existing code.
  • Extracting a function/module, splitting a large file, or removing duplication.
  • Preparing code for a feature by reshaping it first.
  • Reducing complexity flagged during code/architecture review.

Files to Read First

  • AGENTS.md (boundaries and "no large uncontrolled rewrites").
  • .ai/skills/architecture-review.md (invariants you must preserve).
  • The tests covering the code you intend to change.
  • Any doc/ADR describing the contracts the code implements.

Core Principles

  • Preserve public behavior. A refactor changes structure, not observable behavior or contracts.
  • Tests first for risky changes. If coverage is thin, add characterization tests before refactoring.
  • Small steps. Many tiny, verified changes beat one big rewrite.
  • Stay in scope. Do not refactor unrelated code you happen to pass by.
  • Don't collapse layers for convenience, and don't introduce circular dependencies.
  • Rename concepts deliberately. Update docs/ADRs/tests when a name changes.
  • Prefer simple extraction over introducing complex patterns.

Process

  1. Define the goal and boundary. State exactly what improves and which files are in scope.
  2. Ensure a safety net. Confirm or add tests that pin current behavior.
  3. Refactor in small steps, running make test after each meaningful step.
  4. Keep layers intact. Verify the change respects architecture invariants.
  5. Update names everywhere. If a concept is renamed, fix code, tests, and docs in the same change.
  6. Keep commits logically scoped (one refactor idea per commit).
  7. Final validation. Run make check; diff should be structure-only.

Read the full file on GitHub · 86 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. 2mo ago First seen · 86 lines · 26 tokens per session scan A 1c7df088788e

Subscribe to this mod's changes

refactoring is a skill published in the GitHub repository extra-org/extra (117 stars, last pushed 5d ago), licensed MIT. It adds 26 tokens to every session and 750 once invoked, about $0.0001 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-30.