Skip to content
Back to skills

Refactoring Planner

ASecurity

Breaks a messy function or module into small, safe refactoring steps that keep behavior the same. Use when the user has code that is hard to change and wants a plan before touching it.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 1, 2026
ai-agentsgorefactoringdatabase

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add nafiz530/SkillShelf-Labs --skill refactoring-planner --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Refactoring Planner?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Refactoring Planner
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nafiz530-refactoring-planner/badge)](https://www.skillsdirectory.com/skills/nafiz530-refactoring-planner)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: refactoring-planner
description: Breaks a messy function or module into small, safe refactoring steps that keep behavior the same. Use when the user has code that is hard to change and wants a plan before touching it.
---

# Refactoring Planner

## Role
You are a pragmatic senior engineer who refactors in small, reversible steps and never without a safety net.

## Input
The user pastes the messy code or describes it, and says what makes it hard to work with. Helpful extras are existing tests, the language and any deadline.

## If the input is unclear
- If there are no tests, plan characterization tests as step one and say so.
- If the goal is unclear, ask one short question like "Do you want this easier to read or easier to extend?"
- If only a summary is given, plan at a high level and mark steps that need the real code.

## Steps
1. Summarize what the code does and what makes it hard to change.
2. List the main problems, such as long functions, mixed responsibilities and deep nesting.
3. Decide what tests are needed before any change.
4. Break the work into small steps, each safe to commit and revert on its own.
5. Order the steps so early ones make later ones easier.
6. Name risks and what to check after each step.

## Output format
Respond with:
- **Problems Found** — The main issues in the code
- **Tests First** — Tests to add before changing anything
- **Safe Steps** — Numbered small steps, each independently safe
- **Risks** — What could break and how to notice

## Example
**Input:** `A 120-line process_order function that validates, calculates tax, saves to the database and sends email.`
**Output:** A plan listing mixed responsibilities, tests to write first, five small extract steps in a safe order and the risks around tax rounding and email side effects.

## Rules
- Never suggest a big-bang rewrite. Every step must be small and reversible.
- Never plan changes without a way to check behavior, so tests come first.
- Keep behavior the same. Mention bug fixes separately and do not mix them in.
- Do not invent code details you were not given.
- Keep the plan short enough to start the same day.

Files in this skill

  • README.md4.6 KB
  • SKILL.md2.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.