refactor-plan

refactor-plan is a skill for Claude Code from atretyak1985/swarmery. It costs 45 tokens per session (785 once invoked), scanned A, original, Apache-2.0.

A read-only planning assistant for refactoring code, meaning reorganising or improving existing code without changing its intended behaviour. It maps affected files and repositories, orders the work, and records risks and rollback steps.

In plain words
What is it for?
Use it to produce refactoring plans covering affected files, migration order, risks, dependencies, and how to undo the work.
Why use it?
Refactors can affect more parts of a system than expected. An impact analysis and explicit rollback plan help the team understand the change before anyone edits code.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the core plugin — 37 skills, 8 commands, 13 agents shipped together

Good fit Use it to produce refactoring plans covering affected files, migration order, risks, dependencies, and how to undo the work.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/atretyak1985/swarmery/refactor-plan
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 atretyak1985/swarmery --skill refactor-plan
Clone the repo
git clone --depth 1 https://github.com/atretyak1985/swarmery

Made for: Claude Code.

Or install core, the plugin that ships this one along with the rest of its 37 skills, 8 commands, 13 agents.

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-plan

README.md
[![agentmods](https://agentmods.dev/badge/skills/atretyak1985/swarmery/refactor-plan/github.svg)](https://agentmods.dev/skills/atretyak1985/swarmery/refactor-plan)
Your own site
<a href="https://agentmods.dev/skills/atretyak1985/swarmery/refactor-plan"><img src="https://agentmods.dev/badge/skills/atretyak1985/swarmery/refactor-plan/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.

agentmods 80×15 button for refactor-plan

Your own site · 80×15
<a href="https://agentmods.dev/skills/atretyak1985/swarmery/refactor-plan"><img src="https://agentmods.dev/badge/skills/atretyak1985/swarmery/refactor-plan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 785 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.
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.00045 $0.00785
Opus 5.5 $0.00018 $0.00314
Sonnet 5.5 $0.00009 $0.00157
Haiku 4.5 $0.00005 $0.00078

Measured 1mo ago against content hash 5055323e2ef5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

refactor-plan 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.

plugins/core/skills/refactor-plan/SKILL.md · 67 lines

How it starts

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

Purpose

Generate a structured refactoring plan for a proposed code change: current state, cross-repo impact, step-by-step migration order, risks, and rollback. The output is a markdown document reviewed before execution — this skill plans only, never edits code. Success: every cited file was found via Grep/Glob, all affected repos in every stack language are covered, and the rollback is executable without interpretation.

Rules (never violate)

  1. Read-only: Read/Grep/Glob only — no file is ever modified.
  2. Every file cited in the plan is a real Grep/Glob result, never a guess.
  3. Blast radius over 50 files → stop and escalate to the user before continuing.
  4. Save the plan to the workspace task dir (.../plan/README.md), never inside a code repo.
  5. Rollback must be specific — commit references, migration file names, revert order.
  6. Schema changes go through migrations (landing before dependent code), never manual DDL.

Resources

  • Read resources/planning-procedure.md when building the plan: the 7-step procedure with checkpoints, self-check, mistakes, escalation triggers, and what to surface.
  • Read resources/plan-template.md when writing the output: the template, save-location contract, length budget, a full worked rename example, and failure modes.

How to use

What it does

Writes a refactoring plan for a change you are considering — and nothing else. It greps the codebase for every real reference, maps which repos and files are hit, orders steps so nothing lands before its dependency, names the risks, and spells out how to undo each step, all for review before anyone touches code.

When to use it

  • Renaming a type, table, or module and needing to know how far the change reaches.
  • Extracting shared logic or splitting a module across repo boundaries.
  • Changing a streamed (WebSocket/SSE) message format between producer and consumer; migrating one pattern to another across many files.

Not for: executing refactors (functional-design), dependency bumps (deps-check), one-line fixes, or release/environment rollback (the project's infra pack skills).

Read the full file on GitHub · 67 lines

Files

What ships with it

2 files 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. 1mo ago First seen · 67 lines · 45 tokens per session scan A 5055323e2ef5

Subscribe to this mod's changes

refactor-plan is a skill published in the GitHub repository atretyak1985/swarmery (7 stars, last pushed today), licensed Apache-2.0. It adds 45 tokens to every session and 785 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-09-03.