Custom agents allow you to tailor Copilot's expertise for specific tasks. For a conceptual overview of custom agents, see Sobre agentes personalizados.
Observação
Custom agents estão em prévia pública para IDEs JetBrains, Eclipse e Xcode e estão sujeitos a alteraçõ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
Um agent profile é um arquivo Markdown com um frontmatter YAML que especifica o nome do custom agent, a descrição, as ferramentas disponíveis e as configurações do servidor MCP. A configuração de um agent profile envolve a definição da identidade, dos recursos, do acesso à ferramenta e das instruções comportamentais do agente.
Para obter informações detalhadas de configuração sobre propriedades YAML, ferramentas, configuração do servidor MCP, aliases de ferramentas e como custom agents são processados, consulte Configuração de agentes personalizados.
Para configurar seu agent profile:
- Opcionalmente, escreva um
namepara o seu custom agent. Se não for definido, o nome assumirá o nome do arquivo por padrão (sem o sufixo.mdou.agent.md). - Escreva um resumo
description(obrigatório) explicando o que seu agente faz e seus recursos específicos ou conhecimento de domínio. - Na propriedade
tools, defina quais ferramentas o agente pode usar. Esta é uma lista de nomes de ferramentas ou aliases, incluindo ferramentas de servidores MCP configuradas nas configurações do repositório ou no agent profile (por exemplo,tools: ["read", "edit", "search", "some-mcp-server/tool-1"]). Caso você omita essa propriedade, o agente terá acesso a todas as ferramentas disponíveis. Consulte "Ferramentas" em Configuração de agentes personalizados. - Opcionalmente, na
mcp-serverspropriedade, você pode configurar servidores MCP que estarão disponíveis apenas para esse agente para estender seus recursos. Consulte "Detalhes de configuração do servidor MCP" em Configuração de agentes personalizados. - Se você estiver criando e usando o agent profile no VS Code, IDEs do JetBrains, Eclipse ou Xcode, também poderá usar a propriedade
modelpara controlar qual modelo de IA o agente deve usar. - Opcionalmente, defina a propriedade
targetparavscodeougithub-copilotse você deseja usar o agente apenas em um ambiente específico. O agente estará disponível em ambos os ambientes se você omitir a propriedade. - Escreva o prompt do agente. Defina o comportamento, a competência e as instruções do agente no conteúdo Markdown, localizado abaixo do frontmatter YAML. O prompt pode ter no máximo 30.000 caracteres.
Example agent profiles
Os exemplos a seguir demonstram a aparência de um agent profile para as tarefas comuns de escrever testes ou planejar a implementação de um projeto. Para obter inspiração adicional, consulte os exemplos Custom agents na biblioteca de customização. Você também pode encontrar exemplos mais específicos na coleção da comunidade awesome-copilot.
Especialista em testes
Este exemplo habilita todas as ferramentas omitindo a tools propriedade.
--- 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.
Planejador de implementação
Este exemplo habilita apenas um subconjunto de ferramentas.
--- 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
Depois de criar um custom agent, você pode usá-lo sempre que Copilot cloud agent estiver disponível.
- Ao solicitar uma tarefa ao Copilot cloud agent no GitHub.com, use o menu suspenso no painel de agentes ou na guia de agentes para selecionar o seu custom agent em vez do cloud agent padrão.
- Ao atribuir o Copilot cloud agent a um issue, você pode selecionar seu custom agent no menu suspenso para que ele trate o issue com sua configuração especializada.
- Ao usar o GitHub Copilot CLI, você pode escolher usar um custom agent específico usando o comando barra
/agentou referenciando o agente em um prompt ou por meio de um argumento da linha de comando. Para obter mais informações, consulte Usando GitHub Copilot CLI.
Quando o Copilot abre pull requests, ele indica qual custom agent foi usado para concluir o trabalho na descrição do pull request.
Para obter mais informações sobre como usar Copilot cloud agent, confira Iniciando sessões do 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 Configuração de agentes personalizados.
For more information on custom agents in VS Code specifically, see Custom agents in VS Code in the VS Code documentation.
Next steps
- Para obter um tutorial prático para criar seu primeiro custom agent, consulte Seu primeiro agente personalizado.
- Para obter informações de configuração detalhadas, consulte Configuração de agentes personalizados.
- Para obter informações sobre como usar agentes de nuvem, incluindo seu custom agents, para iniciar Copilot sessões, consulte Iniciando sessões do GitHub Copilot.