refactor-planner

refactor-planner is a skill for Claude Code from Ozzeron/prompt-pack. It costs 95 tokens per session (2,237 once invoked), scanned A, original, MIT.

A guide for turning a large code change into small, reversible steps. It uses an expand-then-contract approach: add the new structure, move users of the old one gradually, then remove it.

In plain words
What is it for?
Use it for splitting large files, changing libraries or frameworks, restructuring modules, removing duplication, or moving between API patterns.
Why use it?
It lowers the chance that an all-at-once rewrite will break many parts of the application. Each step is intended to remain shippable and have a rollback path.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: built for openclaw.

Part of the fullstack plugin — 20 skills shipped together , and of all-skills

Good fit Use it for splitting large files, changing libraries or frameworks, restructuring modules, removing duplication, or moving between API patterns.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ozzeron/prompt-pack/refactor-planner
Install

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.

Any agent
npx skills add Ozzeron/prompt-pack --skill refactor-planner
Clone the repo
git clone --depth 1 https://github.com/Ozzeron/prompt-pack

Made for: Claude Code.

Or install fullstack, the plugin that ships this one along with the rest of its 20 skills.

Wrote 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.

agentmods badge for refactor-planner

README.md
[![agentmods](https://agentmods.dev/badge/skills/ozzeron/prompt-pack/refactor-planner.svg)](https://agentmods.dev/skills/ozzeron/prompt-pack/refactor-planner)
Your own site
<a href="https://agentmods.dev/skills/ozzeron/prompt-pack/refactor-planner"><img src="https://agentmods.dev/badge/skills/ozzeron/prompt-pack/refactor-planner.svg" alt="Measured on agentmods" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,237 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 180
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Excessive Agency · line 196
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00095 $0.02237
Opus 5 $0.00048 $0.01118
Sonnet 5 $0.00019 $0.00447
Haiku 4.5 $0.00010 $0.00224

Measured yesterday against content hash 26dcf4b49793, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

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 yesterday.

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.

prompts/architecture/refactor-planner/SKILL.md · 205 lines

How it starts

The opening of the file, as written. The whole thing — 205 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Refactor Planner

You take a "we should refactor X" request and turn it into a sequence of small, safe, shippable steps. The default for refactors is expand-then-contract, the same pattern that keeps database migrations safe: introduce the new shape alongside the old, switch consumers piece by piece, remove the old shape only after everything is on the new one.

The most common refactor failure isn't getting the design wrong — it's the all-at-once rewrite that breaks 12 things and gets reverted. This skill exists to prevent that.

When to use

  • "Split this 1,200-line file into modules"
  • "Move from React Context to Zustand" (or any library swap)
  • "Rename / restructure this module"
  • "Extract this duplicated logic"
  • "Collapse these three near-duplicate components"
  • "Migrate from REST to tRPC" / "from Pages Router to App Router" / similar
  • After review/frontend-audit or review/database-review produces findings that need multi-step execution

Do not invoke for:

  • One-line edits or trivial renames (just do them)
  • Greenfield work (use architecture/frontend-feature / architecture/backend-api)
  • The actual code-writing — this skill produces the plan, the architecture skills execute

Scope

In scope:

  • Step-by-step plan with each step independently shippable
  • Risk and rollback strategy per step
  • Order of operations to keep the codebase green throughout
  • Estimated size of each step (S/M/L)
  • Dependencies between steps
  • Tests / verification needed at each step
  • What stays in scope vs explicit out-of-scope

Out of scope:

  • Executing the plan — refactor-planner produces the plan, not the diff
  • Architectural redesign that hasn't been agreed on — confirm the destination with the user before planning the journey
  • Renames / cleanups outside the stated scope — propose as follow-ups, don't bundle

Inherits

  • meta/engineering-principles — DRY, file size, single responsibility shape what is being refactored toward.
  • meta/reuse-before-create — a refactor that introduces brand-new abstractions instead of consolidating into existing ones is the failure mode this skill exists to prevent; the destination must reuse before it creates.
  • meta/token-discipline — read the target area, not the whole repo.

Read the full file on GitHub · 205 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. yesterday Changed · -44 lines · +67 tokens per session 26dcf4b49793
  2. 7d ago First seen · 249 lines · 28 tokens per session scan A 3cfb53308923

Subscribe to this mod's changes

refactor-planner is a skill published in the GitHub repository Ozzeron/prompt-pack (8 stars, last pushed yesterday), licensed MIT. It adds 95 tokens to every session and 2,237 once invoked, about $0.0005 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.