Produce a prioritized refactoring plan for the code you just worked with — each suggestion tagged with priority and effort, sorted most- to least-recommended. It recommends and ranks; it does not perform the changes. Use right after finishing a task in a codebase, when the user asks 'what should I refactor', 'what would you clean up here', 'give me a refactor plan', 'what are the follow-up improvements', or wants recommendations grounded in the files already touched during the session. Complements 'oddities' (a reading list) by producing an actionable, ranked plan.
Ships in codebase-analysis. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Produce a ranked refactoring plan for the code you already saw while working on a task — grounded in files you actually read and edited this session, not a fresh scan of the whole repo. Each suggestion carries a priority and an effort estimate, and the list is sorted from most- to least-recommended so the reader can start at the top and stop whenever they run out of appetite.
This runs after the real work is done. The value is that you already understand this code — how it's structured, where it hurt to change, what you had to work around. Capture that hard-won context as concrete, prioritized suggestions before it evaporates.
Trigger this skill when the user, typically just after an agent finished a task, asks to:
Do not use this skill for:
odditiescodebase-ops:refactorauditdead-codepr-reviewDefault scope is the code you engaged with during this session — files you read, edited, or created while completing the task, plus their immediate collaborators (things they import or that import them, when you saw those too).
Ground every suggestion in something you observed while working. The strongest suggestions come from friction you actually hit. Categories:
any, as, @ts-ignore, # type: ignore) covering real uncertainty you noticedSkip anything a linter the project already runs would catch. Skip pure style. Every item must be something a thoughtful engineer would agree is worth doing, not a preference.
Tag every suggestion with both:
Priority — how much it matters:
Effort — rough cost to do it well, including updating call sites and tests:
Sort the whole list from most- to least-recommended. Ranking is not just priority — it's your judgment of overall payoff, which trades priority against effort:
When two items are close, prefer the one that unblocks or de-risks future work. Use your own judgment and make the reasoning visible in the one-liner.
The failure mode of a refactoring plan is generic advice that could be pasted into any codebase: "add more tests," "break up large functions," "improve naming." These are worthless because they carry no information the reader didn't already have. Every suggestion you make should be something only someone who just worked in this code could have written — anchored to a real location and a real observation.
Good — grounded in friction you actually hit, with a specific location and payoff:
payments/refund.ts:88-140 — refund logic is duplicated here and in webhook/handler.ts:200; I changed both today and nearly missed the second. Extract one refundOrder() helper. **P1 · M** — kills the whole "forgot the other copy" class of bug.auth/session.ts:44 — the change I made had to thread userId through four functions because Session doesn't carry it. Add it to the Session type. **P2 · S** — every future auth change gets simpler.report/build.ts:210-340 — this 130-line function now does fetch + transform + render after today's edit; the render half is self-contained. Split out renderReport(). **P2 · M** — makes the next render change testable in isolation.Bad — ungrounded, unanchored, or pure style (avoid these):
If you can't tie a suggestion to a path:line and a thing you observed, it isn't grounded enough — drop it. A plan of three suggestions the reader couldn't have written themselves beats a plan of ten they could.
Use this structure exactly:
# Refactor plan — <scope, e.g. "the payments module you just changed">
<1–2 sentences: what code this covers and why these came up. Note it's grounded in this session's work.>
## Recommended, in order
### 1. <short imperative title> — `P1` · effort `S`
`path/to/file.ts:120-180` — What to change and why, in 1–3 sentences. Anchor it in something you saw: "this file now mixes X and Y after today's change." State the payoff.
### 2. <short imperative title> — `P2` · effort `M`
`path/to/other.ts:44` — …
### 3. <short imperative title> — `P1` · effort `L`
…
<Continue, most- to least-recommended. Aim for the 3–8 items that genuinely earn their place. Fewer sharp suggestions beat a long shallow list.>
## Skipped / not worth it (optional)
- <thing a reader might expect to see> — why you deliberately left it out.
Notes on the format:
P{1,2,3} and effort {S,M,L} in the heading.path:line anchor. If you can't point to a location, the suggestion isn't grounded enough — drop it.path:line.codebase-ops:refactor.What SKILL.md sets; muted values are Claude Code's defaults
/codebase-analysis:refactor-planfrom codebase-analysis
npx claudepluginhub driangle/ai-powers --plugin codebase-analysis7 skills in this plugin
/api-reviewReview a library's public API for clarity, consistency, composability, predictability, edge-case handling, and correctness. Use when the user wants to review an API surface, check API design quality, or evaluate a library's exported interface. Designed for libraries and packages — not services, servers, or full applications./auditPerform a comprehensive codebase audit covering security, privacy, data integrity, architecture, and code quality. Use when the user wants to audit the codebase, check for security issues, or review code quality./audit-docsAudit documentation coverage for a project: discover CLI commands, public APIs, configuration options, and features, then cross-reference against documentation to find gaps, stale content, and missing sections. Use when the user wants to check if docs are up to date, find undocumented features, or verify doc completeness.Other plugins' skills for the same job