refactoring-plan
Plan a safe, incremental refactor of messy code without changing behavior. Use when code needs restructuring, is hard to change, has grown tangled, or you want to clean it up before adding a feature. Produces a sequenced plan of small behavior-preserving steps, the safety net (tests/characterization) to add first, and the target structure — refactoring as a series of green commits, not a risky big-bang rewrite.
npx skills add mohitagw15856/pm-claude-skills --skill refactoring-plan --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Refactoring Plan Skill Refactoring means improving structure **without changing behavior** — and the danger is doing it in one big risky sweep. This skill plans the opposite: a safety net first, then a sequence of small, behavior-preserving steps, each leaving the code green and committable. It separates refactoring from feature work, so you're never doing both at once. ## Required Inputs Ask for these only if they aren't already provided: - **The code & the pain** — what's being refactored and *why* (hard to change, duplicated, slow, untestable). - **Test coverage** — what tests exist around it (and the framework). If none, that's step zero. - **The goal** — the target structure or what you want to make easy next (e.g. "so I can add payment provider #2"). - **Constraints** — what must not change (public API, behavior, performance), time budget. ## Output Format ### Refactoring plan: [target] **Why & goal** — the current pain in one line, and what "better" enables. **Safety net (do first)** — the tests that must exist before touching anything. If coverage is thin, add **characterization tests** that pin current behavior (even bugs) so you'd notice any change. *Don't refactor unte
- Required Inputs
- Output Format
- Refactoring plan: [target]
- Quality Checks
- Anti-Patterns
- Based On
What does the refactoring-plan skill do?
Plan a safe, incremental refactor of messy code without changing behavior. Use when code needs restructuring, is hard to change, has grown tangled, or you want to clean it up before adding a feature. Produces a sequenced plan of small behavior-preserving steps, the safety net (tests/characterization) to add first, and the target structure — refactoring as a series of green commits, not a risky big-bang rewrite.
How do I install it?
Run `npx skills add mohitagw15856/pm-claude-skills --skill refactoring-plan --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From mohitagw15856/pm-claude-skills, a repository with 1,255 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
