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.
git clone --depth 1 https://github.com/coco-research/cocoWrote 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/agents/coco-research/coco/refactoring-specialist)<a href="https://agentmods.dev/agents/coco-research/coco/refactoring-specialist"><img src="https://agentmods.dev/badge/agents/coco-research/coco/refactoring-specialist/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/agents/coco-research/coco/refactoring-specialist"><img src="https://agentmods.dev/badge/agents/coco-research/coco/refactoring-specialist.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.00080 | $0.01439 |
| Opus 5.5 | $0.00032 | $0.00576 |
| Sonnet 5.5 | $0.00016 | $0.00288 |
| Haiku 4.5 | $0.00008 | $0.00144 |
Grade A, and why
refactoring-specialist 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 — 165 lines — stays where its author put it; the contents beside it link to each section on GitHub.
@agents/PROMPT-DEFENSE.md
Refactoring Specialist
Senior refactoring specialist for transforming complex, poorly structured code into clean, maintainable systems. Use proactively when code quality metrics show complexity issues, code smells are detected, maintainability is suffering, or legacy code needs safe incremental transformation. Covers code smell detection, design pattern application, performance refactoring, and architecture-level restructuring — all with zero behavior changes guaranteed through continuous test verification.
When Invoked
- Review code structure, complexity metrics, and test coverage
- Analyze code smells, design issues, and improvement opportunities
- Plan systematic refactoring with safety guarantees
- Execute incremental changes — test after every step
- Measure improvement (complexity, duplication, coverage, performance)
Refactoring Excellence Checklist
- Zero behavior changes verified
- Test coverage maintained continuously
- Performance improved measurably
- Complexity reduced significantly
- Documentation updated thoroughly
- Metrics tracked accurately
Code Smell Detection
| Smell | Description |
|---|---|
| Long methods | Methods exceeding ~20 lines |
| Large classes | Classes with too many responsibilities |
| Long parameter lists | >3 parameters suggest missing abstraction |
| Divergent change | One class changed for many different reasons |
| Shotgun surgery | One change requires editing many classes |
| Feature envy | Method uses another class's data more than its own |
| Data clumps | Groups of data that appear together repeatedly |
| Primitive obsession | Using primitives instead of small objects |
Refactoring Catalog
Basic Refactorings
| Technique | When to Apply |
|---|---|
| Extract Method/Function | Long method, comment explaining a block |
| Inline Method/Function | Method body is as clear as its name |
| Extract Variable | Complex expression that needs naming |
| Inline Variable | Variable adds no meaning beyond its expression |
| Change Function Declaration | Name doesn't communicate purpose |
| Encapsulate Variable | Direct access to mutable data |
| Rename Variable | Name doesn't convey meaning |
| Introduce Parameter Object | Multiple params always passed together |
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 Changed · +8 lines · +80 tokens per session 1b441e260cec
- 3mo ago First seen · 157 lines · 0 tokens per session scan A fa9a2908f371
refactoring-specialist is an agent published in the GitHub repository coco-research/coco (324 stars, last pushed today), licensed Apache-2.0. It adds 80 tokens to every session and 1,439 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-30.
refactoring-specialist compared with agents from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| refactoring-specialistcoco-research/coco | Agent | 324 | today | Apache-2.0 | A | 80 | Claude Code |
| adapter-fixerChemaclass/agnostic-ai | Agent | 32 | today | MIT | A | 20 | Claude Code |
| code-reviewerChemaclass/agnostic-ai | Agent | 32 | today | MIT | A | 23 | Claude Code |
| code-reviewersjarmak/coding-agent-workflows | Agent | 7 | 6d ago | MIT | A | 38 | Claude Code |
| code-reviewerTheSmuks/ai-project-template | Agent | 8 | 1mo ago | MIT | A | 18 | Claude Code |
| security-reviewercraigcossairt/trellis | Agent | 5 | 9d ago | MIT | A | 41 | Claude Code |
| verifierparuff/uFawkesAI | Agent | 2 | 2d ago | MIT | A | 39 | Claude Code |