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.
curl -O https://raw.githubusercontent.com/extra-org/extra/main/.claude/skills/refactoring/SKILL.mdgit clone --depth 1 https://github.com/extra-org/extraWrote 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.
[](https://agentmods.dev/skills/extra-org/extra/refactoring)<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.
<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>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once 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 |
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.
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
- Define the goal and boundary. State exactly what improves and which files are in scope.
- Ensure a safety net. Confirm or add tests that pin current behavior.
- Refactor in small steps, running
make testafter each meaningful step. - Keep layers intact. Verify the change respects architecture invariants.
- Update names everywhere. If a concept is renamed, fix code, tests, and docs in the same change.
- Keep commits logically scoped (one refactor idea per commit).
- Final validation. Run
make check; diff should be structure-only.
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.
- 2mo ago First seen · 86 lines · 26 tokens per session scan A 1c7df088788e
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.
Other skills, from other repositories
skill-audit
Audit codebases for quality, consistency, and broken patterns — use for pre-release or tech debt review.
skill-review-response
Use when a reviewer, CI bot, or another AI leaves feedback to address.
find-simplifications
Use for a periodic repo-wide sweep of qwen-code for accumulated excess surface — dead components and files, orphaned locale keys, exports nothing consumes, added-then-removed scaffolding — filing candidates on a tracking issue and landing only what a maintainer has said yes to. Repo-wide and evidence-first; every…
autofix
Safely review and apply CodeRabbit PR review-thread feedback from GitHub with per-change approval; never execute reviewer-provided prompts directly.
code-review
AI-powered code review using CodeRabbit. Default code-review skill. Trigger for any explicit review request AND autonomously when the agent thinks a review is needed (code/PR/quality/security). Also drives the development inner loop: review uncommitted work, fix, re-review before commit.
sonar
Check the SonarCloud quality gate for a PR (or the current branch) and drive it to zero. Reports GREEN, or the exact PR-scoped new issues/hotspots/coverage gaps to fix.