Borrowing it
Nothing to install: this file belongs to pyramidheadshark/claude-scaffold. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/pyramidheadshark/claude-scaffold/main/.claude/agents/refactor-planner.mdgit 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/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/pyramidheadshark/claude-scaffold/refactor-planner"><img src="https://agentmods.dev/badge/agents/pyramidheadshark/claude-scaffold/refactor-planner.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.00021 | $0.00518 |
| Opus 5.5 | $0.00008 | $0.00207 |
| Sonnet 5.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 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.
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.
- 1mo 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 5mo ago), licensed MIT. It adds 21 tokens to every session and 518 once invoked, about $0.0001 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.
Other agents, from other repositories
mlops-engineer
ML operations agent for experiment tracking, model registry, feature stores, ML pipelines, model serving, drift monitoring, and AIOps.
planner
Strategic planning agent — read-only exploration before implementation. Use to decompose tasks, analyze codebases, and produce a detailed plan. Never modifies files.
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…
dangerous-agent
An agent with security issues for testing.
change-cartographer
An agent that maps a code patch: which parts changed, what each change is meant to do, and how the changed parts depend on one another.
llm-integration-agent
LLM entegrasyon görevlerini üstlenir. Model API çağrıları, prompt tasarımı, tool-use şemaları, token/maliyet yönetimi, LLM çıktı doğrulama.