Borrowing it
Nothing to install: this file belongs to Piyush8296/claude-workspace. 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/Piyush8296/claude-workspace/main/.claude/agents/refactor-planner.mdgit 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/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/piyush8296/claude-workspace/refactor-planner"><img src="https://agentmods.dev/badge/agents/piyush8296/claude-workspace/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.00040 | $0.01017 |
| Opus 5.5 | $0.00016 | $0.00407 |
| Sonnet 5.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 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 — 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.
- 1mo 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 6mo ago), licensed MIT. It adds 40 tokens to every session and 1,017 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-08-31.
Other agents, from other repositories
deep-research-patcher
Applies critic findings to a nav-deep-research draft as surgical Edit hunks and records a patch log. Tool-locked so it cannot regenerate the report. Spawned once at step 5 by the nav-deep-research skill.
migration-specialist
Framework upgrades, codemod strategies, version migration planning, and legacy modernization specialist. Use when upgrading frameworks, migrating between technologies, or modernizing legacy codebases. Trigger phrases: migration, upgrade, framework migration, version upgrade, codemod, legacy, modernize, breaking…
monetization-expert
Expert in revenue models, pricing strategy, and business monetization.
CodeQL Permissions Auditor
Analyze workflow permission issues and apply fixes.
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.
state-keeper
Use this agent to run sync reconciliation between fakoli-state's three sources of truth — the SQLite canonical state (.fakoli-state/state.db), the filesystem (packets/, .evidence-buffer/, worktrees), and git (branches, commits, claims). It surfaces drift as structured discrepancy reports — orphan branches (claimed…