memstack-development-refactor-planner

memstack-development-refactor-planner is a skill for Claude Code from cwinvestments/memstack. It costs 81 tokens per session (3,065 once invoked), scanned A, original, MIT.

A planning aid for improving existing code without changing what it does. It finds problem areas, considers risks, and lays out smaller changes with checks along the way.

In plain words
What is it for?
Use it to reduce duplicate code, simplify overly complicated classes, loosen tightly connected parts, and work through technical debt in stages.
Why use it?
It helps avoid risky rewrites and makes code cleanup easier to carry out safely. It also highlights when tests are needed before changes begin.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the memstack plugin — 87 skills, 2 commands, 6 hooks shipped together

Good fit Use it to reduce duplicate code, simplify overly complicated classes, loosen tightly connected parts, and work through technical debt in stages.

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

Made for: Claude Code.

Or install memstack, the plugin that ships this one along with the rest of its 87 skills, 2 commands, 6 hooks.

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 memstack-development-refactor-planner

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

agentmods 80×15 button for memstack-development-refactor-planner

Your own site · 80×15
<a href="https://agentmods.dev/skills/cwinvestments/memstack/refactor-planner"><img src="https://agentmods.dev/badge/skills/cwinvestments/memstack/refactor-planner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,065 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 pass 7 Sept 2026
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.00081 $0.03065
Opus 5.5 $0.00032 $0.01226
Sonnet 5.5 $0.00016 $0.00613
Haiku 4.5 $0.00008 $0.00307

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

Security

Grade A, and why

memstack-development-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.

skills/development/refactor-planner/SKILL.md · 316 lines

How it starts

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

Refactor Planner: Planning systematic code improvement...

Identifies code smells, assesses refactoring risk, selects appropriate patterns, and builds incremental execution plans with rollback strategies and verification checkpoints.

Activation

When this skill activates, output:

Refactor Planner: Planning systematic code improvement...

Then execute the protocol below.

Context Guard

Context Status
User says "refactor", "refactoring plan", "code cleanup" ACTIVE
User says "tech debt", "god class", "tight coupling", "reduce duplication" ACTIVE
User wants to improve existing code structure without changing behavior ACTIVE
User wants to write a new feature DORMANT: use Feature Spec
User wants to change database schema DORMANT: use Migration Planner

Common Mistakes

Mistake Why It's Wrong
"Big bang rewrite" Rewriting everything at once introduces cascading failures. Incremental changes are safer and shippable.
"Refactor without tests" No test coverage = no safety net. Add characterization tests BEFORE touching code.
"Refactor and add features simultaneously" Mixing behavior changes with structural changes makes bugs impossible to isolate. Separate commits.
"No measurable goal" "Clean up the code" is vague. Define metrics: reduce file from 800 to 200 lines, eliminate 5 duplicate blocks, etc.
"Skip the risk assessment" A function called by 47 files is higher risk than a utility used in 2. Assess blast radius first.

Protocol

Step 1: Gather Refactoring Context

If the user hasn't provided details, ask:

  1. Target: what code needs refactoring? (file, module, class, or system)
  2. Pain point: what's the specific problem? (hard to modify, duplicated, slow, confusing)
  3. Test coverage: does the target code have tests? (yes, partial, none)
  4. Constraints: any deadlines, frozen APIs, or deployment concerns?
  5. Language/framework: what tech stack?

Read the full file on GitHub · 316 lines

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 Changed cf19731dd73b
  2. 1mo ago First seen · 316 lines · 81 tokens per session scan A 44ee0e7a24a1

Subscribe to this mod's changes

memstack-development-refactor-planner is a skill published in the GitHub repository cwinvestments/memstack (425 stars, last pushed 4d ago), licensed MIT. It adds 81 tokens to every session and 3,065 once invoked, about $0.0003 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-30.