Skip to main content
Skip to content

Using custom agents in your IDE

You can create specialized agents with tailored expertise for specific development tasks, and invoke them from chat in your IDE.

Custom agents allow you to tailor Copilot's expertise for specific tasks. For a conceptual overview of custom agents, see カスタム エージェントについて.

メモ

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

Creating a custom agent profile

  1. Open GitHub Copilot Chat in Visual Studio Code.
  2. From the agents dropdown at the bottom of the chat view, click Configure Custom Agents..., then click Create new custom agent.
  3. Choose the location where the agent profile should be created:
    • Workspace: Create the custom agent profile in the .github/agents folder of your workspace to only use it within that workspace.
    • User profile: Create the custom agent profile in the current user profile folder to use it across all your workspaces.
  4. Enter a file name for the custom agent. This is the default name that appears in the agents dropdown.
  5. Configure the agent profile in the newly created .agent.md file, including the description, tools, and prompts. For more information on what the agent profile can include, see Configuring an agent profile.
    • You can use the Configure Tools... button within the editor to open the "Configure Tools" dialog, where you can view and select available tools, including built-in tools and tools from MCP servers. Click OK to add selected tools to the agent profile.
    • To set which AI model the agent uses, add a model: property and select your preferred model from the autocomplete dropdown.

To update an agent profile, select Configure Custom Agents from the agents dropdown, and then click on an agent from the list to modify it. For more information on custom agents in VS Code, see Custom agents in VS Code.

Creating a custom agent profile

  1. Open the GitHub Copilot Chat window in your JetBrains IDE.
  2. From the agents dropdown at the bottom of the chat view, click Configure Agents..., then in the settings window, under "Chat Agents", click Workspace.
  3. Enter a file name for the custom agent. This is the default name that appears in the agents dropdown.
  4. Configure the agent profile in the newly created .agent.md file in the .github/agents directory, including the description, tools, and prompts. For more information on what the agent profile can include, see Configuring an agent profile.
    • You can use the Configure Tools... button within the editor to open the tools dialog, where you can view and select available tools, including built-in tools and tools from MCP servers. Click Apply to add selected tools to the agent profile.
    • To set which AI model the agent uses, add a model: property and select your preferred model from the autocomplete dropdown.

To update an agent profile, select Configure Custom Agents from the agents dropdown, and then click next to the agent you want to modify.

Creating a custom agent profile

  1. Open the GitHub Copilot Chat window in Eclipse.
  2. From the agents dropdown at the bottom of the chat view, click Configure Agents..., then click Add....
  3. Enter a file name for the custom agent. This is the default name that appears in the agents dropdown.
  4. Configure the agent profile in the newly created .agent.md file in the .github/agents directory, including the description, tools, and prompts. For more information on what the agent profile can include, see Configuring an agent profile.
    • You can use the Configure Tools... button within the editor to open the "Configure Tools" dialog, where you can view and select available tools, including built-in tools and tools from MCP servers. Click Apply to add selected tools to the agent profile.
    • To set which AI model the agent uses, add a model: property and select your preferred model from the autocomplete dropdown.

To update an agent profile, select Configure Agents... from the agents dropdown, and then select the agent you want to modify and click Edit.

Creating a custom agent profile

  1. Open the GitHub Copilot Chat window in Xcode.
  2. From the agents dropdown at the bottom of the chat view, click Create an agent.
  3. Enter a file name for the custom agent. This is the default name that appears in the agents dropdown.
  4. Configure the agent profile in the newly created .agent.md file in the .github/agents directory, including the description, tools, and prompts. For more information on what the agent profile can include, see Configuring an agent profile.
    • You can use the Customize Agent button within the file editor to open a dialog, where you can select the AI model for the agent to use, select available tools (including built-in and MCP server tools), and configure the handoffs property for transitioning between custom agents. Click Apply to add selected options to the agent profile.

To update an agent profile, from the agents dropdown, click the pencil icon next to the agent you want to modify.

Configuring an 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 文字です。

Example 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.

Using 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 セッションの開始」をご覧ください。

Using custom agents in your IDE

You can also use your custom agent profiles directly in supported IDEs. You can switch between custom agents using the agent dropdown in the Chat window, allowing you to access specialized configurations for different tasks like planning, code editing, or research.

Some properties may function differently between the GitHub.com and IDE environments. For more information on supported properties, see カスタム エージェントの構成.

For more information on custom agents in VS Code specifically, see Custom agents in VS Code in the VS Code documentation.

Next steps