Skip to main content

Copilot cloud agent用のカスタム エージェントの作成

特定の開発タスクに合わせて調整された専門知識を持つ特殊なエージェントを作成できます。

この機能を使用できるユーザーについて

Copilot cloud agent は、すべての有料 Copilot プランで使用できます。

エージェントは、GitHubが所有し、明示的に無効にされているリポジトリを除き、マネージド ユーザー アカウントに格納されているすべてのリポジトリで使用できます。
Sign up for Copilot

Custom agents を使用すると、特定のタスクに合わせて Copilotの専門知識を調整できます。 custom agentsの概念の概要については、「AUTOTITLE」を参照してください。

メモ

Custom agents は、JetBrains IDE、Eclipse、Xcode 用 パブリック プレビュー にあり、変更される可能性があります。

リポジトリに custom agent プロファイルを作成する GitHub

  1. https://github.com/copilot/agents の[エージェント]タブに移動します。

  2. プロンプト ボックスのドロップダウン メニューを使用して、 custom agent プロファイルを作成するリポジトリを選択します。

    メモ

    組織の所有者は、組織内のすべてのリポジトリで使用できる組織レベルの custom agents を、組織の .github または .github-private リポジトリに作成できます。 エンタープライズ所有者は、エンタープライズ設定で指定された組織のcustom agents リポジトリにエンタープライズ レベルの.github-privateを作成できます。これは、企業内のすべての組織で使用できます。 詳細については、「組織でカスタム エージェントを使用する準備」および「企業でカスタム エージェントを使用する準備」を参照してください。

  3. 必要に応じて、 agent profile を作成するブランチを選択します。 既定値はメイン ブランチです。

  4. [] をクリックし、[エージェントの作成] クリックします。 これにより、ターゲット リポジトリのmy-agent.agent.md ディレクトリに.github/agentsという名前のテンプレート エージェント プロファイルが開きます。

  5. 組織レベルまたはエンタープライズ レベルの custom agentを作成する場合は、ファイル パスの .github/ 部分を削除して、テンプレートをルート agents ディレクトリに移動します。

  6. エージェントの目的を識別する一意のわかりやすい名前を選択して、ファイル名 ( .agent.md前のテキスト) を編集します。 ファイル名には、 .-_a-zA-Z0-9の文字のみが含まれていることに注意してください。

  7. 名前、説明、ツール、プロンプトなど、 agent profileを構成します。 agent profileに含めることができる内容の詳細については、「agent profileの構成」を参照してください。

  8. ファイルをリポジトリにコミットし、既定のブランチにマージします。 [エージェント] タブに戻り、必要に応じてページを更新します。 プロンプト ボックスでcustom agentをクリックすると、ドロップダウンにあなたのが表示されます。

agent profile の設定を行う

agent profileは、custom agentの名前、説明、使用可能なツール、MCP サーバー構成を指定する YAML frontmatter を含む Markdown ファイルです。 agent profileの構成には、エージェントの ID、機能、ツール アクセス、および動作命令を定義する必要があります。

YAML プロパティ、ツール、MCP サーバーのセットアップ、ツールエイリアス、および custom agents の処理方法の詳細については、 カスタム エージェントの構成 を参照してください。

agent profileを構成するには:

  1. オプションで、name用のcustom agentを記述します。 設定を解除すると、名前は既定でファイル名に設定されます ( .md または .agent.md サフィックスは付けなくなります)。
  2. エージェントの機能と、その特定の機能またはドメインの専門知識を説明する簡単な description (必須) を記述します。
  3. tools プロパティで、エージェントで使用できるツールを定義します。 これは、リポジトリ設定または agent profile ( tools: ["read", "edit", "search", "some-mcp-server/tool-1"] など) で構成された MCP サーバーのツールを含む、ツール名またはエイリアスの一覧です。 このプロパティを省略すると、エージェントは使用可能なすべてのツールにアクセスできます。 カスタム エージェントの構成 の「ツール」を参照してください。
  4. 必要に応じて、 mcp-servers プロパティで、このエージェントのみが使用できる MCP サーバーを構成して、その機能を拡張できます。 カスタム エージェントの構成 の「MCP サーバー構成の詳細」を参照してください。
  5. agent profile、JetBrains IDE、Eclipse、または Xcode でVS Codeを作成して使用する場合は、model プロパティを使用して、エージェントが使用する AI モデルを制御することもできます。
  6. 必要に応じて、特定の環境でのみエージェントを使用する場合は、 target プロパティを vscode または github-copilot に設定します。 このプロパティを省略すると、エージェントは両方の環境で使用できます。
  7. エージェントのプロンプトを書いてください。 YAML frontmatter の下にある Markdown コンテンツで、エージェントの動作、専門知識、および手順を定義します。 プロンプトの最大文字数は 30,000 文字です。

agent profiles の例

次の例は、agent profile が、テストの記述やプロジェクトの計画に関連する一般的なタスクにおいてどのように見えるかを示しています。 その他のヒントについては、カスタマイズ ライブラリの Custom agents の例を参照してください。 さらに具体的な例については、 awesome-copilot コミュニティ コレクションを参照してください。

テストスペシャリスト

この例では、 tools プロパティを省略して、すべてのツールを有効にします。

Text
---
name: test-specialist
description: Focuses on test coverage, quality, and testing best practices without modifying production code
---

You are a testing specialist focused on improving code quality through comprehensive testing. Your responsibilities:

- Analyze existing tests and identify coverage gaps
- Write unit tests, integration tests, and end-to-end tests following best practices
- Review test quality and suggest improvements for maintainability
- Ensure tests are isolated, deterministic, and well-documented
- Focus only on test files and avoid modifying production code unless specifically requested

Always include clear test descriptions and use appropriate testing patterns for the language and framework.

実装プランナー

この例では、ツールのサブセットのみを有効にします。

Text
---
name: implementation-planner
description: Creates detailed implementation plans and technical specifications in markdown format
tools: ["read", "search", "edit"]
---

You are a technical planning specialist focused on creating comprehensive implementation plans. Your responsibilities:

- Analyze requirements and break them down into actionable tasks
- Create detailed technical specifications and architecture documentation
- Generate implementation plans with clear steps, dependencies, and timelines
- Document API designs, data models, and system interactions
- Create markdown files with structured plans that development teams can follow

Always structure your plans with clear headings, task breakdowns, and acceptance criteria. Include considerations for testing, deployment, and potential risks. Focus on creating thorough documentation rather than implementing code.

custom agents の使用

custom agentを作成したら、Copilot cloud agentが使用可能な場所であればどこでも使用できます。

  • Copilot cloud agentのタスクでGitHub.comを求めるメッセージが表示されたら、[エージェント] パネルまたは [エージェント] タブのドロップダウン メニューを使用して、既定のcustom agentではなくcloud agentを選択します。
  • 問題に Copilot cloud agent を割り当てるときは、ドロップダウン メニューから custom agent を選択して、特殊な構成に関する問題を処理できます。
  • GitHub Copilot CLIを使用する場合は、custom agentスラッシュ コマンドを使用するか、プロンプトでエージェントを参照するか、コマンド ライン引数を使用して、特定の/agentを使用するかを選択できます。 詳細については、「GitHub Copilot CLI の使用」を参照してください。

Copilotがプル要求を開くと、pull request の説明で作業を完了するために使用されたcustom agentが表示されます。

Copilot cloud agent の使用について詳しくは、「GitHub Copilot セッションの開始」をご覧ください。

次のステップ