refactor-plan

Generates a phased multi-file refactoring plan with sequencing, verification, and rollback steps.

Updated Aug 28, 2026
One-click install
npx skills add https://github.com/miyake-san/sogo-agent-platform --skill refactor-plan-miyake-san
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-plan
Source: https://github.com/miyake-san/sogo-agent-platform/tree/main/skills/core/refactor-plan
Command: npx skills add https://github.com/miyake-san/sogo-agent-platform --skill refactor-plan-miyake-san

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Large refactors that touch many files often fail because changes are made in the wrong order, dependencies are missed, and there is no way to recover when something breaks. This Skill turns a refactoring goal into a structured, sequenced execution plan before any code is modified. ## Core Features & Use Cases - Dependency-Aware Sequencing: Orders changes safely — types and interfaces first, then implementations, then tests — so each step builds on a stable foundation. - Structured Output Template: Produces a Markdown plan with current state, target state, an affected-files table with dependency annotations, phased checklists, verification steps, a rollback plan, and a risk list. - Use Case: You need to rename a core domain model used across 40 files. The Skill searches the codebase, maps every affected file and its dependencies, and outputs a phase-by-phase checklist where each step includes a verification command and an undo path. ## Quick Start Ask the assistant to create a refactor plan for your change, for example: plan a refactor to extract the authentication logic from the user service into a standalone module.

Frequently Asked Questions about refactor-plan

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I plan a large multi-file refactor safely?

Start by searching the codebase to map all affected files and their dependencies, then sequence changes so types and interfaces land before implementations and tests. This Skill automates that process and outputs a phased checklist with verification steps after each change.

What order should refactoring changes be made in?

Change types and interfaces first, then update implementations, then update tests, and finish with cleanup of deprecated code. This ordering keeps the codebase compilable at each phase and makes failures easier to isolate.

How do I roll back a failed refactoring step?

The generated plan includes an explicit rollback section listing undo steps for each phase. Combined with per-step verification checks, you can detect a failure early and revert only the affected phase instead of the entire refactor.

When should I not use a phased refactor plan?

For single-file or trivially small changes, a full phased plan adds unnecessary overhead. The approach is designed for refactors spanning multiple files with interdependencies, where sequencing and rollback actually matter.