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

  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

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:

  1. Opcionalmente, escreva um name para o seu custom agent. Se não for definido, o nome assumirá o nome do arquivo por padrão (sem o sufixo .md ou .agent.md).
  2. Escreva um resumo description (obrigatório) explicando o que seu agente faz e seus recursos específicos ou conhecimento de domínio.
  3. 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.
  4. Opcionalmente, na mcp-servers propriedade, 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.
  5. Se você estiver criando e usando o agent profile no VS Code, IDEs do JetBrains, Eclipse ou Xcode, também poderá usar a propriedade model para controlar qual modelo de IA o agente deve usar.
  6. Opcionalmente, defina a propriedade target para vscode ou github-copilot se 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.
  7. 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.

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.

Planejador de implementação

Este exemplo habilita apenas um subconjunto de ferramentas.

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

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 /agent ou 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