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 tozhax/plumbwork --skill refactoringgit clone --depth 1 https://github.com/tozhax/plumbworkWrote 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/tozhax/plumbwork/refactoring)<a href="https://agentmods.dev/skills/tozhax/plumbwork/refactoring"><img src="https://agentmods.dev/badge/skills/tozhax/plumbwork/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/tozhax/plumbwork/refactoring"><img src="https://agentmods.dev/badge/skills/tozhax/plumbwork/refactoring.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.00120 | $0.01245 |
| Opus 5.5 | $0.00048 | $0.00498 |
| Sonnet 5.5 | $0.00024 | $0.00249 |
| Haiku 4.5 | $0.00012 | $0.00125 |
Grade B, and why
refactoring scanned grade B with 1 finding 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.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
Where existing tests do not cover the branches to be restructured, write characterization tests before the first code edit (following `~/.gemini/config/skills/harness/references/test-design.md`): How it starts
The opening of the file, as written. The whole thing — 66 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactoring: Behavior-Preserving Change
A refactor changes internal structure while leaving every observable behavior identical: return values, raised errors, side effects, ordering, and emitted messages. The discipline is to pin the behavior first, restructure in small green steps, and prove that the pins can fail.
1. One Kind of Change Per Change Set
A refactor and a behavior change never share a change set. A defect noticed while refactoring is reported to the user and fixed separately; it is never folded silently into the refactor. If the requested restructuring turns out to require a behavior change, stop and inform the user.
2. Read Before Touching
Answer from the codebase and version history, never from memory:
- What is this code responsible for, and who calls it? Search for all callers, including dynamic references: strings in configuration, registries, re-exports, and reflection.
- Which existing tests define its behavior today?
- Which branches and boundary cases does it contain?
- Why is it written this way? Inspect the commit history of the lines about to change (
git log -L,git blame) before removing or simplifying them.
3. Pin the Behavior With Characterization Tests
Where existing tests do not cover the branches to be restructured, write characterization tests before the first code edit (following ~/.gemini/config/skills/harness/references/test-design.md):
- The existing code is the oracle. A characterization test asserts what the code actually produces today, even if that looks questionable. If the code returns
19.27and a document says19.28, the characterization test asserts19.27and the discrepancy is reported separately. - Literal inputs and literal expected outputs, captured from running the current code.
- Every branch gets a case: each arm of a conditional or switch, plus boundary values (zero, negative, maximum, empty).
- At the public seam (
GEMINI.mdRule 9), so the tests survive the internal restructuring they protect. - A comparison that cannot run is a failure, never a skip. Report how many characterization cases executed; zero executed proves nothing.
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 · 66 lines · 120 tokens per session scan B ec5fabffdc63
refactoring is a skill published in the GitHub repository tozhax/plumbwork (33 stars, last pushed 2d ago), licensed MIT. It adds 120 tokens to every session and 1,245 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-12-02.
refactoring compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| refactoringtozhax/plumbwork | Skill | 33 | 2d ago | MIT | B | 120 | Claude Code, Codex |
| pull-requestspingdotgg/t3code | Skill | 89k | today | MIT | A | 34 | Claude Code, Codex |
| test-reviewdatahub-project/datahub | Skill | 13k | today | Apache-2.0 | A | 0 | Claude Code, Codex |
| grade-testsdotnet/skills | Skill | 6.4k | today | MIT | A | 119 | Claude Code |
| go-testingGentleman-Programming/gentle-ai | Skill | 9.8k | today | MIT | A | 26 | Claude Code, Codex |
| brooks-testhyhmrright/brooks-lint | Skill | 1.6k | 2d ago | MIT | A | 161 | Claude Code |
| dart-mechanical-refactordartsim/dart | Skill | 1.2k | yesterday | BSD-2-Clause | A | 20 | Claude Code |