Skip to main content
skill GitHub Copilot official · GitHub

refactor-plan — GitHub Copilot skill: plan refactors

This skill investigates a codebase and writes a step-by-step multi-file refactor plan before edits begin. Use it when the proposed change needs review first.

Install into GitHub Copilot · Skills CLI (Vercel) All methods and platforms ↓
npx skills add github/awesome-copilot --skill refactor-plan
Open on GitHub

What refactor-plan does

refactor-plan reads implementation code, tests, configuration, and documentation before it proposes changes. It describes the current and target states, then lists affected files, dependencies, ownership boundaries, and likely hidden coupling.

The plan follows phases for types and interfaces, implementation, callers, tests, and cleanup. It includes checks between phases, a final validation command, risks, and recovery steps for risky work. Files stay unchanged during planning.

After showing the plan, GitHub Copilot waits for confirmation before editing code. Install it when a multi-file refactor needs a reviewable route; for a small one-file edit, the extra planning step is likely unnecessary.

What it helps with

  • plan a refactor across multiple files
  • identify coupled modules and dependencies
  • sequence interface and implementation changes
  • add verification steps and rollback actions
  • review the change plan before code edits

Example prompts for the agent

  • Plan a refactor that moves logic from `file.ts` into separate modules.
  • Inspect the project and list the tests affected by this refactor.
  • Create a safe interface-change plan. Do not edit files until I confirm.

How to install refactor-plan

1Skills CLI (Vercel)

npx skills add github/awesome-copilot --skill refactor-plan

2GitHub CLI

gh skill install github/awesome-copilot refactor-plan

3Manually: put the files in place

.github/skills/refactor-plan/SKILL.md

From the same set554

The whole set →
git-commit official github This skill reviews Git changes, stages related files, and creates Conventional Commits. Use it when you want an agent to make one commit or split work into separate commits. GitHub Copilot 47,165installs excalidraw-diagram-generator official github Turn a plain-language description into an Excalidraw diagram. Useful for mapping processes, system structure, and relationships between entities. GitHub Copilot 31,639installs multi-stage-dockerfile official github This skill guides GitHub Copilot in writing multi-stage Dockerfiles for different languages and frameworks. Use it when the final runtime image should contain fewer build dependencies. GitHub Copilot 29,688installs documentation-writer official github Skill that turns the agent into a technical writer following the Diátaxis framework: tutorials, how-to guides, reference, and explanation. Proposes structure before writing. GitHub Copilot 27,757installs prd official github Turns a feature idea into a structured PRD with user stories, technical requirements, and risks. Use it when planning a software feature or an AI-powered one. GitHub Copilot 24,035installs refactor official github This skill reshapes existing code without changing its external behavior. Use it for gradual cleanup of large functions, duplication, weak types, and code smells. GitHub Copilot 22,321installs java-springboot official github Gives GitHub Copilot Spring Boot development practices, from project layout to tests and security. Use it when writing or reviewing Java application code. GitHub Copilot 21,272installs create-readme official github This skill reviews a project and creates a structured README.md. Use it when the repository needs clear documentation based on its actual files and code. GitHub Copilot 19,081installs

Similar

python-performance-optimization Seth Hobson This skill profiles Python code to locate CPU and memory bottlenecks. Use it when an application responds slowly or consumes too many resources. Claude Code CX Codex Cursor 35,675installs install-anti-slop dmmulroy Installs and configures vendored anti-slop Oxlint plugins in your repository. Useful for enforcing strict code style rules and pinning plugin dependencies. Claude Code CX Codex Cursor +1 13,600installs understand-diff Egonex-AI Analyzes Git diffs against the project knowledge graph to identify affected dependencies, architectural layers, and merge risks. Useful before reviewing pull requests. Claude Code CX Codex Cursor +1 3,600installs aspnet-core official openai Guides building, refactoring, and architecting ASP.NET Core apps using official Microsoft patterns. Helpful for Minimal APIs, Blazor, and migrations. Claude Code CX Codex Cursor +1 3,900installs improve-codebase-architecture Matt Pocock This skill scans a codebase for architectural friction, then builds a visual HTML report with refactoring candidates. Use it before a deeper architecture review. Claude Code 1,163,035installs tdd Matt Pocock Guides the red-green TDD loop: ensures tests are written first, keep them at public interfaces, and avoid coupling to implementation details. Claude Code 1,141,062installs triage Matt Pocock This skill moves issues and external PRs through triage states, verification, and agent briefs. It fits maintainers managing an issue queue. Claude Code 990,453installs codebase-design Matt Pocock This skill helps design modules with small interfaces and hidden complexity. Use it when refactoring code, choosing a seam, or making tests easier to write. Claude Code 850,344installs

Questions about refactor-plan

How do I install refactor-plan in GitHub Copilot?

Run npx skills add github/awesome-copilot --skill refactor-plan. You can also use gh skill install github/awesome-copilot refactor-plan.

What does refactor-plan do?

The skill investigates the repository and produces a structured plan for a multi-file refactor. It does not change code before confirmation.

What is included in a refactor-plan output?

Its output covers current and target states, affected files, execution phases, checks, risks, and rollback steps. It asks for confirmation before starting the first phase.

Source text

SKILL.md · MIT
---
name: refactor-plan
description: 'Create a concrete plan before starting a multi-file refactor. Use when the user asks to plan, sequence, scope, or safely execute a refactor across multiple files; always investigate first, output the plan, and wait for confirmation before making code changes.'
---

# Refactor Plan

Create a detailed plan before making any code changes.

## Instructions

1. Do not edit files while preparing the plan.
2. Search the codebase to understand the current state. Read enough implementation, tests, configuration, and docs to make the plan specific to the repository.
3. Identify affected files, ownership boundaries, dependencies, and likely hidden coupling.
4. Plan changes in a safe sequence. Prefer contracts and types first, then implementations, then callers, then tests, then cleanup.
5. Include verification steps between phases and a final validation command.
6. Include rollback or recovery steps for the riskiest phases.
7. Output the complete plan using the format below.
8. Stop after the plan and ask for confirmation before implementing. If the user already asked you to implement, still produce the plan first and wait for confirmation unless they explicitly said to continue without review after the plan.

If the request is too ambiguous to plan safely, ask concise clarifying questions instead of editing files.

## 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]
```

After the plan, ask: "Shall I proceed with Phase 1?"

© github · MIT · github/awesome-copilot

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor