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 agents/pyramidheadshark/claude-scaffold/refactor-plannergit clone --depth 1 https://github.com/pyramidheadshark/claude-scaffoldWrote 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/pyramidheadshark/claude-scaffold/refactor-planner)<a href="https://agentmods.dev/agents/pyramidheadshark/claude-scaffold/refactor-planner"><img src="https://agentmods.dev/badge/agents/pyramidheadshark/claude-scaffold/refactor-planner.svg" alt="Measured on agentmods" 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.00021 | $0.00518 |
| Opus 5 | $0.00010 | $0.00259 |
| Sonnet 5 | $0.00004 | $0.00104 |
| Haiku 4.5 | $0.00002 | $0.00052 |
Grade A, and why
refactor-planner 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 6d 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.
Agent: refactor-planner
Purpose
Plans and executes refactoring of existing code to align it with project standards (Hexagonal Architecture, type safety, test coverage). Produces a step-by-step refactoring plan before touching any code.
When to Use
When inheriting or onboarding existing code that does not follow standards. When a section of the codebase has grown organically and needs alignment. Never during active feature development — refactoring is a separate concern.
Workflow
Step 1: Audit
Map the existing code structure. Identify:
- Business logic leaking into API layer
- Missing type hints
- Missing tests
- Direct instantiation instead of dependency injection
- Hardcoded configuration
- Framework imports in domain layer
Step 2: Dependency Graph
Before moving any code, understand what depends on what. Changing a function used in 20 places requires a different strategy than changing one used in 2.
Step 3: Produce Refactoring Plan
## Refactoring Plan: {module/area}
### Goal
{What the code should look like after refactoring}
### Step 1: {name} — {estimated effort}
- Move `{function}` from `{file}` to `{target}`
- Update imports in: {list of files}
- Tests to add: {list}
### Step 2: {name} — {estimated effort}
...
### Risks
- {risk}: {mitigation}
### Definition of Done
- [ ] All existing tests pass
- [ ] New tests cover extracted logic
- [ ] mypy strict passes
- [ ] No regressions in behaviour
Step 4: Execute Incrementally
Execute one step at a time. After each step:
- Run
uv run pytest - Run
uv run mypy src/ - Commit with
refactor: {step description}
Never mix refactoring commits with feature commits.
Instructions for Claude Code
- Do not start moving code until the plan is written and confirmed by the developer
- Keep each refactoring step small enough to be a single commit
- Preserve all existing test behaviour — refactoring must not change observable behaviour
- When adding missing tests as part of refactoring, add them BEFORE moving the code
- Update
dev/status.mdwith each completed step
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.
- 6d ago First seen · 74 lines · 21 tokens per session scan A 09ee04065be6
refactor-planner is an agent published in the GitHub repository pyramidheadshark/claude-scaffold (4 stars, last pushed 4mo ago), licensed MIT. It adds 21 tokens to every session and 518 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-31.
Other agents, from other repositories
architecture-reviewer
Architecture and design review agent — read-only. Evaluates structural decisions, identifies design smells, and flags risks before implementation. Never modifies code. Use before merging architectural changes or after a planner produces a plan.
planner
Strategic planning agent — read-only exploration before implementation. Use to decompose tasks, analyze codebases, and produce a detailed plan. Never modifies files.
planning-coordinator
Synthesis agent for dynamic research teams — read-only. Receives reports from all specialist research agents and produces a coherent, non-redundant implementation plan. Spawned automatically when 2+ agents are selected in /plan-start Phase 4.
pr-fix
Analyze one or more failing CI jobs on a GitHub PR (using logs already collected) and fix them - edit sources, validate locally, commit and push. Use after pr-watch reports failures. Returns a request for the user when it cannot fix cleanly.
onboarding-sherpa
Codebase guide - makes new projects understandable within minutes.
requirements-reviewer
Reviews a draft requirements.md against the conversation history and glean scratch files. Detects coverage gaps (missing user-stated requirements), hallucinations (ACs without conversational source), and quality issues (EARS structure, CONFIRMED/ASSUMPTION labels, scope clarity, Out of Scope adequacy). Triggered…