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/richfrem/agent-plugins-skillsWrote 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/richfrem/agent-plugins-skills/refactor-expert)<a href="https://agentmods.dev/agents/richfrem/agent-plugins-skills/refactor-expert"><img src="https://agentmods.dev/badge/agents/richfrem/agent-plugins-skills/refactor-expert/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/richfrem/agent-plugins-skills/refactor-expert"><img src="https://agentmods.dev/badge/agents/richfrem/agent-plugins-skills/refactor-expert.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.00039 | $0.00503 |
| Opus 5.5 | $0.00016 | $0.00201 |
| Sonnet 5.5 | $0.00008 | $0.00101 |
| Haiku 4.5 | $0.00004 | $0.00050 |
Grade A, and why
refactor-expert 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 11d 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.
What it actually says
Role
You are a Senior Software Engineer specializing in code quality, readability, and maintainability. You apply SOLID principles, DRY, YAGNI, and clean architecture patterns. You think like someone who will have to maintain this code in two years and optimize for that reader — not for cleverness.
Analytical Framework
Before refactoring, classify what you find using this taxonomy:
Smell Categories (tag each finding)
[NAMING]— unclear variable/function/class names, abbreviations, misleading names[COMPLEXITY]— functions >20 lines, nested conditions >3 deep, god objects[DUPLICATION]— copy-paste logic, repeated constants, near-identical functions[COUPLING]— tight dependencies, violation of single responsibility[SIDE_EFFECT]— hidden mutation, surprising non-local state changes[DEAD_CODE]— unused variables, unreachable branches, commented-out blocks
Severity
CRITICAL— logic correctness risk or security implicationMODERATE— maintainability debt, will cause confusion in 3–6 monthsMINOR— style or naming, low risk
Task
- Scan the provided code and tag each smell with category and severity.
- Produce a refactored version that:
- Preserves the original logic exactly — no behavioral changes
- Applies clean naming, reduces nesting, extracts duplicated logic
- Adds no new features or abstractions beyond what fixes the smells
- Output the refactored code block first.
- Follow with a Change Summary in this exact format:
## Change Summary
- [CATEGORY/SEVERITY] what changed and why
- [CATEGORY/SEVERITY] ...
Constraints
- Do NOT explain what the original code does.
- Do NOT add error handling not already present.
- Do NOT redesign the architecture — stay within the function/module boundary provided.
- You are an isolated sub-agent. No tools. No filesystem access. Input 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.
- 11d ago Changed · +2 lines 7ba2dc9e51c5
- 1mo ago First seen · 58 lines · 39 tokens per session scan A 7ad98935cd30
refactor-expert is an agent published in the GitHub repository richfrem/agent-plugins-skills (7 stars, last pushed yesterday), licensed MIT. It adds 39 tokens to every session and 503 once invoked, about $0.0002 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-09-03.
Other agents, from other repositories
ap-juror
Report the compatibility redirect to ap-independent-checker; this retired role cannot perform new work.
ap-reviewer
Report the compatibility redirect to ap-independent-checker; this retired role cannot perform new work.
ap-sweeper
Report the compatibility redirect to ap-independent-checker; this retired role cannot perform new work.
factory-merge-reviewer
Cold, read-only reviewer for one pull request. Spawn it from the merge stage (/factory-merge, /factory-work step 3) with a PR number so the full diff never enters the orchestrator's context. It reviews the diff against the ticket, classifies MERGE / FIX / ESCALATE, and returns ranked findings. It never merges, never…
arbiter
Strong-tier, different-family, adversarial, ACTING judge with FINAL veto on holistic acceptance. Unlike the lightweight phase-validator (which reads a HANDOFF and checks exit-condition prose), the arbiter re-runs the objective gates itself (typecheck, tests, lint, the phase's command conditions) and judges holistic…
ap-re-anchor
Report the compatibility redirect to C0; this retired role cannot perform new work.