本文へスキップ
Skillpedia
一般的なプログラミング40k · #7395

refactor-plan

できること

このエージェントは、複数のコードファイルを変更する前に、詳しい計画を作成します。既存のコードを分析し、影響を受けるファイルを特定して、安全な変更の順番を提案します。

使う場面

  • ✓大きなコード変更を計画したいとき。
  • ✓一度に複数のファイルに手を入れる前。
  • ✓コードの変更を安全かつ整理された形で行いたいとき。

スキルのリンク

https://github.com/github/awesome-copilot/blob/main/skills/refactor-plan/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/github/awesome-copilot/blob/main/skills/refactor-plan/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“ログインの仕組みをリファクタリングしたいです。その計画を作成してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

まず、コードがどのように動いているかを理解します。そのあと、型、実装、テスト、整理といった安全な段階に分けて変更を計画します。また、何か問題が起きたときに確認して元に戻す手順も含めます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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

## 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?"

よくある質問

「リファクタリング」とは何ですか?

外部から見た動作を変えずに、既存のコードを整理し直すことです。理解しやすく、保守しやすくするために行います。

なぜコードを変更する前に計画するのですか?

計画によってミスを防ぎ、コードのすべての部分が考慮されるようになります。変更の過程も安全で予測しやすくなります。

計画を表示したあとはどうなりますか?

エージェントはあなたの確認を待ちます。確認が取れたら、計画の最初の段階から変更を適用し始めます。

詳細

作者による元の説明

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.

repo: github/awesome-copilot

人気

GitHubのスター
40k
ランキング
#7395
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル