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 находятся в Публичный предварительный просмотр для IDEs JetBrains, 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

An agent profile — это файл Markdown с YAML-фронтматией, который указывает custom agentимя, описание, доступные инструменты и конфигурации MCP-серверов. Настройка an agent profile включает определение идентичности агента, его возможностей, доступа к инструменту и поведенческих инструкций.

Для подробной информации о конфигурации YAML-свойств, инструментов, настройки MCP-сервера, псевдонимов инструментов и способах custom agents обработки см. Настройка пользовательских агентов.

Чтобы настроить ваш agent profile:

  1. По желанию напишите a name для вашего custom agent. Если этот параметр не установлен, по умолчанию будет использоваться имя файла (без суффикса .md or .agent.md ).
  2. Напишите краткое description описание (обязательно) с объяснением того, чем занимается ваш агент, а также его конкретные возможности или опыт в предметной области.
  3. В свойстве tools определите, какие инструменты может использовать агент. Это список имён инструментов или псевдонимов, включая инструменты с MCP-серверов, настроенных в настройках репозитория или agent profile (например, tools: ["read", "edit", "search", "some-mcp-server/tool-1"]). Если вы исключите это свойство, агент получит access ко всем доступным инструментам. См. раздел «Инструменты» в AUTOTITLE.
  4. Опционально, в mcp-servers этом свойстве можно настроить MCP-серверы, доступные только этому агенту, чтобы расширить его возможности. См. раздел «Детали конфигурации сервера MCP» в AUTOTITLE.
  5. Если вы создаёте и используете agent profile встроенные VS CodeIDE JetBrains, Eclipse или Xcode, вы также можете использовать это model свойство, чтобы управлять, какую AI-модель должен использовать агент.
  6. По желанию установите свойство target на vscode или github-copilot, если хотите использовать агента только в определённой среде. Агент будет доступен в обеих средах, если вы опустите свойство.
  7. Напишите подсказку агента. Определите поведение, опыт и инструкции агента в содержимом Markdown под внешним элементом YAML. Запрос может составлять максимум 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 задачи вы можете выбрать Your custom agent в выпадающем меню, чтобы решить проблему с вашей специализированной конфигурацией.
  • При использовании GitHub Copilot CLI, вы можете выбрать определённый custom agent пункт, используя /agent команду слэш или ссылаясь на агента в строке или через аргумент командной строки. Дополнительные сведения см. в разделе Использование GitHub Copilot CLI.

Когда Copilot открываются pull requests, в описании 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

  • Для практического обучения по созданию первого custom agentтекста см. АВТОТИТР.
  • Для получения подробной информации о конфигурации см. AUTOTITLE.
  • Для получения информации об использовании облачных агентов, включая ваш custom agents, для запуска Copilot сессий смотрите Начало сессий GitHub Copilot.