refactor-plan

Plan a multi-file refactor with proper sequencing and rollback steps

28,865 stars

Best use case

refactor-plan is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Plan a multi-file refactor with proper sequencing and rollback steps

Teams using refactor-plan should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/refactor-plan/SKILL.md --create-dirs "https://raw.githubusercontent.com/github/awesome-copilot/main/plugins/context-engineering/skills/refactor-plan/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/refactor-plan/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How refactor-plan Compares

Feature / Agentrefactor-planStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Plan a multi-file refactor with proper sequencing and rollback steps

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Refactor Plan

Create a detailed plan for this refactoring task.

## Refactor Goal

{{refactor_description}}

## Instructions

1. Search the codebase to understand current state
2. Identify all affected files and their dependencies
3. Plan changes in a safe sequence (types first, then implementations, then tests)
4. Include verification steps between changes
5. Consider rollback if something fails

## Output Format

```markdown
## Refactor Plan: [title]

### Current State
[Brief description of how things work now]

### Target State
[Brief description of how things will work after]

### Affected Files
| File | Change Type | Dependencies |
|------|-------------|--------------|
| path | modify/create/delete | blocks X, blocked by Y |

### Execution Plan

#### Phase 1: Types and Interfaces
- [ ] Step 1.1: [action] in `file.ts`
- [ ] Verify: [how to check it worked]

#### Phase 2: Implementation
- [ ] Step 2.1: [action] in `file.ts`
- [ ] Verify: [how to check]

#### Phase 3: Tests
- [ ] Step 3.1: Update tests in `file.test.ts`
- [ ] Verify: Run `npm test`

#### Phase 4: Cleanup
- [ ] Remove deprecated code
- [ ] Update documentation

### Rollback Plan
If something fails:
1. [Step to undo]
2. [Step to undo]

### Risks
- [Potential issue and mitigation]
```

Shall I proceed with Phase 1?

Related Skills

review-and-refactor

28865
from github/awesome-copilot

Review and refactor code in your project according to defined instructions

refactor

28865
from github/awesome-copilot

Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.

refactor-method-complexity-reduce

28865
from github/awesome-copilot

Refactor given method `${input:methodName}` to reduce its cognitive complexity to `${input:complexityThreshold}` or below, by extracting helper methods.

java-refactoring-remove-parameter

28865
from github/awesome-copilot

Refactoring using Remove Parameter in Java Language

java-refactoring-extract-method

28865
from github/awesome-copilot

Refactoring using Extract Methods in Java Language

gtm-enterprise-account-planning

28865
from github/awesome-copilot

Strategic account planning and execution for enterprise deals. Use when planning complex sales cycles, managing multiple stakeholders, applying MEDDICC qualification, tracking deal health, or building mutual action plans. Includes the "stale MAP equals dead deal" pattern.

devops-rollout-plan

28865
from github/awesome-copilot

Generate comprehensive rollout plans with preflight checks, step-by-step deployment, verification signals, rollback procedures, and communication plans for infrastructure and application changes

breakdown-plan

28865
from github/awesome-copilot

Issue Planning and Automation prompt that generates comprehensive project plans with Epic > Feature > Story/Enabler > Test hierarchy, dependencies, priorities, and automated tracking.

structured-autonomy-plan

28865
from github/awesome-copilot

Structured Autonomy Planning Prompt

update-implementation-plan

28865
from github/awesome-copilot

Update an existing implementation plan file with new or update requirements to provide new features, refactoring existing code or upgrading packages, design, architecture or infrastructure.

create-implementation-plan

28865
from github/awesome-copilot

Create a new implementation plan file for new features, refactoring existing code or upgrading packages, design, architecture or infrastructure.

create-github-issues-feature-from-implementation-plan

28865
from github/awesome-copilot

Create GitHub Issues from implementation plan phases using feature_request.yml or chore_request.yml templates.