Custom agents allow you to tailor Copilot's expertise for specific tasks. For a conceptual overview of custom agents, see À propos des agents personnalisés.
Remarque
Les Custom agents sont en préversion publique pour les IDEs JetBrains, Eclipse et Xcode, et sont susceptibles d'être modifiées.
Creating a custom agent profile
- Open GitHub Copilot Chat in Visual Studio Code.
- From the agents dropdown at the bottom of the chat view, click Configure Custom Agents..., then click Create new custom agent.
- Choose the location where the agent profile should be created:
- Workspace: Create the custom agent profile in the
.github/agentsfolder 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.
- Workspace: Create the custom agent profile in the
- Enter a file name for the custom agent. This is the default name that appears in the agents dropdown.
- Configure the agent profile in the newly created
.agent.mdfile, 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
- Open the GitHub Copilot Chat window in your JetBrains IDE.
- From the agents dropdown at the bottom of the chat view, click Configure Agents..., then in the settings window, under "Chat Agents", click Workspace.
- Enter a file name for the custom agent. This is the default name that appears in the agents dropdown.
- Configure the agent profile in the newly created
.agent.mdfile in the.github/agentsdirectory, 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
- Open the GitHub Copilot Chat window in Eclipse.
- From the agents dropdown at the bottom of the chat view, click Configure Agents..., then click Add....
- Enter a file name for the custom agent. This is the default name that appears in the agents dropdown.
- Configure the agent profile in the newly created
.agent.mdfile in the.github/agentsdirectory, 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
- Open the GitHub Copilot Chat window in Xcode.
- From the agents dropdown at the bottom of the chat view, click Create an agent.
- Enter a file name for the custom agent. This is the default name that appears in the agents dropdown.
- Configure the agent profile in the newly created
.agent.mdfile in the.github/agentsdirectory, 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
handoffsproperty for transitioning between custom agents. Click Apply to add selected options to the 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
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
Il s'agit d'un fichier Markdown avec un frontmatter YAML qui spécifie le nom, la description, les outils disponibles, et les configurations du serveur MCP. La configuration d’un agent profile implique la définition de l’identité, des fonctionnalités, de l’accès aux outils et des instructions comportementales de l’agent.
Pour obtenir des informations de configuration détaillées sur les propriétés YAML, les outils, la configuration du serveur MCP, les alias d’outils et la façon dont custom agents ils sont traités, consultez Configuration des agents personnalisés.
Pour configurer votre agent profile:
- Si vous le souhaitez, écrivez un
namepour votre custom agent. Si ce paramètre n’est pas défini, le nom sera par défaut le nom de fichier (sans le suffixe.mdou.agent.md). - Écrivez un bref texte (requis) expliquant ce que fait votre agent et ses capacités spécifiques ou son domaine d'expertise.
- Dans la
toolspropriété, définissez les outils que l’agent peut utiliser. Il s’agit d’une liste de noms d’outils ou d’alias, y compris les outils des serveurs MCP configurés dans les paramètres du référentiel ou le agent profile (par exemple,tools: ["read", "edit", "search", "some-mcp-server/tool-1"]). Si vous omettez cette propriété, l’agent aura accès à tous les outils disponibles. Consultez « Outils » dans Configuration des agents personnalisés. - Si vous le souhaitez, dans la
mcp-serverspropriété, vous pouvez configurer des serveurs MCP qui seront disponibles uniquement pour cet agent afin d’étendre ses fonctionnalités. Consultez « Détails de la configuration du serveur MCP » dans Configuration des agents personnalisés. - Si vous créez et utilisez le agent profile dans les IDE JetBrains, Eclipse ou Xcode, vous pouvez également utiliser la propriété VS Code pour contrôler le modèle d'IA que l'agent doit utiliser.
- Si vous le souhaitez, définissez la propriété
targetsurvscodeougithub-copilotsi vous souhaitez uniquement utiliser l’agent dans un environnement spécifique. L’agent sera disponible dans les deux environnements si vous omettez la propriété. - Écrivez les instructions de l’agent. Définissez le comportement, l’expertise et les instructions de l’agent dans le contenu Markdown sous le frontmatter YAML. L’invite peut comporter au maximum 30 000 caractères.
Example agent profiles
Les exemples suivants montrent ce qu’un agent profile pourrait ressembler aux tâches courantes d’écriture de tests ou de planification de l’implémentation d’un projet. Pour vous inspirer davantage, consultez les exemples Custom agents dans la bibliothèque de personnalisation. Vous trouverez également des exemples plus spécifiques dans la collection awesome-copilot de la communauté.
Spécialiste des tests
Cet exemple active tous les outils en omettant la tools propriété.
--- 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.
---
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.
Planificateur d’implémentation
Cet exemple active uniquement un sous-ensemble d’outils.
--- 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.
---
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
Une fois que vous avez créé un custom agent, vous pouvez l’utiliser partout où Copilot cloud agent il est disponible.
- Lorsque vous êtes invité à Copilot cloud agent avec une tâche sur GitHub.com, utilisez le menu déroulant dans le panneau des agents ou l’onglet Agents pour sélectionner votre custom agent au lieu de cloud agent par défaut.
- Lorsque vous attribuez Copilot cloud agent à un problème, vous pouvez sélectionner votre custom agent dans le menu déroulant pour gérer le problème avec votre configuration spécialisée.
- Lorsque vous utilisez le GitHub Copilot CLI, vous pouvez choisir d’utiliser un custom agent particulier en utilisant la commande slash
/agent, en référençant l’agent dans une invite ou via un argument de ligne de commande. Pour plus d’informations, consultez « Utilisation du CLI GitHub Copilot ».
Lorsque Copilot ouvre des pull requests, il indique quel custom agent a été utilisé pour effectuer le travail dans la description de la pull request.
Pour plus d’informations sur l’utilisation d’Copilot cloud agent, consultez « Démarrage des sessions 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 Configuration des agents personnalisés.
For more information on custom agents in VS Code specifically, see Custom agents in VS Code in the VS Code documentation.
Next steps
- Pour obtenir un didacticiel pratique pour créer votre premier custom agent, consultez Votre premier agent personnalisé.
- Pour obtenir des informations de configuration détaillées, consultez Configuration des agents personnalisés.
- Pour plus d'informations sur l'utilisation des agents cloud, y compris vos custom agents, pour démarrer des sessions Copilot, consultez Démarrage des sessions GitHub Copilot.