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 skills add tmj-90/gaffer --skill refactor-modulegit clone --depth 1 https://github.com/tmj-90/gafferWrote 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/tmj-90/gaffer/refactor-module)<a href="https://agentmods.dev/skills/tmj-90/gaffer/refactor-module"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/refactor-module/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/tmj-90/gaffer/refactor-module"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/refactor-module.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.00063 | $0.01044 |
| Opus 5.5 | $0.00025 | $0.00418 |
| Sonnet 5.5 | $0.00013 | $0.00209 |
| Haiku 4.5 | $0.00006 | $0.00104 |
Grade A, and why
refactor-module 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 1mo 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 — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactor a module
A refactoring changes structure, not observable behaviour (Fowler). The discipline that makes it safe is small steps with the tests green between every one of them. You wear one hat at a time: while refactoring you add no feature and fix no bug.
Steps
- Establish the safety net. Run the suite (the
run-testsskill) and confirm it is green BEFORE touching anything; record the command and summary. If the code you will move is thinly tested, first add characterization tests (theadd-unit-testskill) that pin what it does today — including odd behaviour — through the public interface, not its private internals (tests coupled to internals break on every legitimate refactoring). Commit them separately. - Read the lore. Call
search_lorefor module boundaries, layering and naming conventions so the new structure fits the codebase instead of inventing a new one. - Name the target and list the moves. Write the end state in one or two sentences and the sequence of named refactorings that gets there: Extract Function, Inline Variable, Move Function, Rename, Split Phase, Replace Conditional with Polymorphism, Introduce Parameter Object. Each move is small enough to finish and test in minutes.
- Execute one move at a time. After each move: run the fastest relevant tests (and
typecheck if the language has one). Green → commit (
git commit -m "refactor: …") so there is a known-good point to return to. Red → undo that move (git restore --staged --worktree <paths>, andrmany file the move created —git clean -fdis hook-blocked) and take a smaller step. Never debug your way forward through a red refactoring. - When a move fails because something else must change first, use the Mikado method. Note the goal, try the change naively, and when it breaks, write down the prerequisites it revealed, then revert. Work the prerequisites leaf-first, each as its own green commit, then retry the goal. Keep the list in your working notes; it doubles as your scope check.
- Preserve the public interface unless the ticket explicitly allows changing it. If
it does, update every call site in the same change (
grepthe symbol, including string and dynamic references) and note the change in the evidence. - Confirm equivalence. Run the full suite, lint and build once at the end (the
run-testsandrun-lintskills). Compare the test counts with step 1: the same tests, plus any characterization tests you added, must pass. A test you had to edit is a behaviour change unless the edit only follows a rename or a move. - Evidence via the
record-evidenceskill: before and after test summaries, adiff_summarylisting the moves, and any interface change (on a resume that call is refused: do not retry; put this, the AC → test map and the smallest-change note in your final message). Then the runner takes over.
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.
- 1mo ago Changed 07bd810def4a
- 2mo ago Changed · +37 lines f8e215a2e90a
- 3mo ago First seen · 37 lines · 63 tokens per session scan A a0d748c0f5f7
refactor-module is a skill published in the GitHub repository tmj-90/gaffer (1 stars, last pushed 4d ago), licensed Apache-2.0. It adds 63 tokens to every session and 1,044 once invoked, about $0.0003 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.
refactor-module compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| refactor-moduletmj-90/gaffer | Skill | 1 | 4d ago | Apache-2.0 | A | 63 | Claude Code, Codex |
| bulwark-brainstormQBall-Inc/the-bulwark | Skill | 9 | yesterday | MIT | A | 50 | Claude Code |
| plan-creationQBall-Inc/the-bulwark | Skill | 9 | yesterday | MIT | A | 38 | Claude Code |
| anthropic-validatorQBall-Inc/the-bulwark | Skill | 9 | yesterday | MIT | A | 40 | Claude Code |
| create-subagentQBall-Inc/the-bulwark | Skill | 9 | yesterday | MIT | A | 42 | Claude Code |
| test-auditQBall-Inc/the-bulwark | Skill | 9 | yesterday | MIT | A | 0 | Claude Code |
| code-reviewQBall-Inc/the-bulwark | Skill | 9 | yesterday | MIT | A | 61 | Claude Code |