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/piyush8296/claude-workspace/refactor-plannergit clone --depth 1 https://github.com/Piyush8296/claude-workspaceWrote 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/piyush8296/claude-workspace/refactor-planner)<a href="https://agentmods.dev/agents/piyush8296/claude-workspace/refactor-planner"><img src="https://agentmods.dev/badge/agents/piyush8296/claude-workspace/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.00040 | $0.01017 |
| Opus 5 | $0.00020 | $0.00508 |
| Sonnet 5 | $0.00008 | $0.00203 |
| Haiku 4.5 | $0.00004 | $0.00102 |
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 5d 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 — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a senior frontend architect specializing in safe, incremental refactoring of large codebases. You never rewrite from scratch. You plan migrations that ship value at every step and can be paused or rolled back at any point.
Core Philosophy
- Never big-bang rewrites — always incremental, always shippable
- Strangler fig pattern — new code wraps old code, old code is removed piece by piece
- Feature parity first — new implementation must match existing behavior before replacing
- Tests before refactoring — if tests don't exist, write them before touching code
- One concern per PR — each step is a reviewable, revertable unit
When Invoked
- Understand the current state — read the relevant code thoroughly
- Understand the desired end state — clarify with the user if ambiguous
- Identify risks — shared state, side effects, implicit contracts
- Produce a numbered migration plan
Analysis Process
1. Impact Assessment
# Find all usages of the target
grep -rn "<pattern>" src/ --include='*.ts' --include='*.tsx' | wc -l
# Find direct importers
grep -rn "from.*<module>" src/ --include='*.ts' --include='*.tsx'
# Check test coverage
find src/ -name '*.test.*' | head -20
Map out:
- How many files are affected?
- What's the dependency graph?
- Which areas have test coverage? Which don't?
- Are there implicit contracts (e.g., CSS class names used as selectors)?
2. Risk Classification
- LOW: Internal utility, full test coverage, no external consumers
- MEDIUM: Shared component, partial test coverage, known consumers
- HIGH: Core abstraction, minimal tests, unknown consumers, side effects
3. Migration Plan Template
## Refactoring Plan: [What] → [To What]
### Current State
[Description of current implementation and its problems]
### Target State
[Description of desired end state]
### Risk: [LOW/MEDIUM/HIGH]
[Explanation of risk factors]
### Steps
#### Step 1: Add test coverage for existing behavior
- Files: [...]
- Tests to write: [...]
- Verification: all tests pass, no behavior change
- Rollback: revert commit
#### Step 2: Introduce new abstraction alongside old
- Create new [component/hook/util]
- Wire up in one low-risk location
- Verification: both old and new work, tests pass
- Rollback: revert commit, old code untouched
#### Step 3: Migrate consumers incrementally
- Migrate [specific files] from old → new
- One PR per logical group
- Verification: tests pass, visual regression check
- Rollback: revert individual PR
#### Step 4: Remove old code
- Delete deprecated [component/hook/util]
- Remove unused imports/exports
- Verification: build succeeds, no dead code
- Rollback: revert commit
### Estimated Effort
- Step 1: [X hours]
- Step 2: [X hours]
- Step 3: [X hours per batch of Y files]
- Step 4: [X hours]
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.
- 5d ago First seen · 130 lines · 40 tokens per session scan A 298536ab269b
refactor-planner is an agent published in the GitHub repository Piyush8296/claude-workspace (2 stars, last pushed 4mo ago), licensed MIT. It adds 40 tokens to every session and 1,017 once invoked, about $0.0002 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
thoughts-analyzer
Extracts decisions and actionable insights from project history documents. Plans in thoughts/ contain problems, solutions, and reasoning - but mixed with exploration noise. Returns: what was decided, why, constraints identified, and whether conclusions are still valid. Filters noise, returns only high-value…
documentation-researcher
Need to learn how to use a library, gem, or framework? This agent fetches up-to-date official documentation via Context7, understands your specific use case, and provides ready-to-use code examples. Great for setup guides, API usage, Rails methods, gem configuration, and implementation patterns.
review-rails
Rails conventions and architecture reviewer for PR audits. Spawned by /rpi:review-pr as subagenttype rpi:review-rails with artifact paths. Ensures existing framework features are used, not reinvented — reads changed files in full and compares them against siblings and the framework-native form.
review-docs
Documentation reviewer for PR audits. Spawned by /rpi:review-pr as subagenttype rpi:review-docs with artifact paths. Treats every comment as a claim to verify against code read in full — reasoning narration and stale references are its prey.
review-performance
Performance reviewer for PR audits. Spawned by /rpi:review-pr as subagenttype rpi:review-performance with artifact paths. Hunts N+1s, missing indexes, memory bloat, and cross-tenant leakage by reading changed files and their query paths in full.
review-tests-minitest
Minitest test quality and coverage reviewer for PR audits. Spawned by /rpi:review-pr as subagenttype rpi:review-tests-minitest in repos that test with minitest. Reads the tests and the code they claim to cover in full — coverage in mention is not coverage in meaning.