skills/refactoring-plan/SKILL.md
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 skillsauth add mohitagw15856/pm-claude-skills refactoring-planInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
Ask for these only if they aren't already provided:
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 untested code blind.
Target structure — a short sketch of where you're going (the shape, the seams, the names).
Steps (small & sequenced) — each step is behavior-preserving and independently committable:
| # | Step | Refactoring move | Stays green by | Commit after | |---|---|---|---|---| | 1 | … | (extract function / rename / introduce interface / move) | run tests | ✅ |
Order them so risk drops early and each step is reversible.
Definition of done — behavior identical (tests still green), the goal structure reached, no feature changes smuggled in.
Refactoring discipline (Martin Fowler): behavior-preserving transformations, characterization tests, small steps.
business
Analyze why deals are won and lost and turn it into an action plan. Use when asked to run a win/loss analysis, review closed-won and closed-lost deals, understand why the team is losing to a competitor, or summarize sales feedback into patterns. Produces a structured win/loss report with themes, win/loss rates by segment and competitor, representative quotes, and prioritized actions for product, marketing, and sales.
development
Route a fuzzy request to the right skill in this library. Use when the user is unsure which skill fits, asks 'which skill should I use for X', describes a task without naming a skill, or when a request could plausibly match several skills. Produces a best-fit recommendation with the inputs to gather, a runner-up with the tie-breaker, and a workflow recipe when the job spans multiple skills.
testing
Triage a vulnerability or scanner finding — assess real severity, exploitability, and how urgently to fix. Use when asked to triage a CVE, prioritize scanner/pentest findings, assess a vuln's risk, or decide what to patch first. Produces a triage verdict: CVSS-informed severity adjusted for your context, exploitability, real risk, a fix/mitigation, and an SLA — so you fix what matters, not just what's red.
development
Stand up a Voice of Customer (VoC) program that turns feedback into action. Use when asked to build a VoC program, design a customer feedback loop, consolidate feedback sources, or set up a closed-loop feedback process. Produces a VoC program design — objectives, feedback sources and channels, a taxonomy, collection and analysis cadence, closed-loop routing, ownership, and success metrics.