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.
npx agentmods add skills/extra-org/extra/refactoringnpx skills add extra-org/extra --skill refactoringgit clone --depth 1 https://github.com/extra-org/extraWhat 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 | $0.00026 | $0.00750 |
| Opus 5 | $0.00013 | $0.00375 |
| Sonnet 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 2d 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.
- 2d ago First seen · 86 lines · 26 tokens per session scan A 1c7df088788e
refactoring is a skill published in the GitHub repository extra-org/extra (108 stars, last pushed 4d ago), licensed MIT. It adds 26 tokens to every session and 750 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.
Other skills, from other repositories
skill-doc-delivery
Convert markdown to DOCX, PPTX, XLSX, PDF office documents — use when you need exportable deliverables.
peekaboo
Capture and automate macOS UI with the Peekaboo CLI.
powerpoint
Create designed, editable PowerPoint .pptx presentations with PptxGenJS. Use when the user asks to create, generate, update, or inspect a deck, slide deck, presentation, or .pptx file.
oracle
Best practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
skill-intent-contract
Use when starting a complex or ambiguous task that risks scope drift.
skill-security-framing
URL validation and content sanitization for untrusted sources — use when handling external input safely.