Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
GitHub Docs

Creating custom agents

You can create specialized agents with tailored expertise for specific development tasks.

Who can use this feature?

Copilot coding agent is available with the GitHub Copilot Pro, GitHub Copilot Pro+, GitHub Copilot Business and GitHub Copilot Enterprise plans. The agent is available in all repositories stored on GitHub, except repositories owned by managed user accounts and where it has been explicitly disabled.
Sign up for Copilot

Custom agents allow you to create specialized agents with tailored expertise for specific tasks. For a conceptual overview of custom agents, seeAbout custom agents.

Note

Custom agents are in public preview for JetBrains IDEs, Eclipse, and Xcode, and subject to change.

Creating a custom agent profile in a repository on GitHub

  1. Navigate to the agents tab athttps://github.com/copilot/agents.

  2. Using the dropdown menu in the prompt box, select the repository you want to create the custom agent profile in.

    Note

    Organization and enterprise owners can create organization and enterprise-level custom agents in a.github-private repository that are available across all repositories within their organization or enterprise. For more information, seePreparing to use custom agents in your enterprise andPreparing to use custom agents in your organization.

  3. Optionally, select the branch you want to create the agent profile in. The default is the main branch.

  4. Click, then click Create an agent. This will open a template agent profile calledmy-agent.agent.md in the.github/agents directory of your target repository.

  5. If you are creating an organization or enterprise-level custom agent, delete the.github/ portion of the file path to move your template to the rootagents directory.

  6. Edit the filename (the text before.agent.md), selecting a unique, descriptive name that identifies the agent's purpose. Note that the filename may only contain the following characters:.,-,_,a-z,A-Z,0-9.

  7. Configure the agent profile, including the name, description, tools, and prompts. For more information on what the agent profile can include, seeConfiguring an agent profile.

  8. Commit the file to the repository and merge it into the default branch. Go back to the agents tab and refresh the page if needed. Your custom agent will now appear in the dropdown when you click in the prompt box.

Creating a custom agent profile in Visual Studio Code

  1. Open GitHub Copilot Chat in Visual Studio Code.
  2. From the agents dropdown at the bottom of the chat view, clickConfigure 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, seeConfiguring an agent profile.
    • You can use theConfigure 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. ClickOK to add selected tools to the agent profile.
    • To set which AI model the agent uses, add amodel: property and select your preferred model from the autocomplete dropdown.

To update an agent profile, selectConfigure 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, seeCustom agents in VS Code.

Creating a custom agent profile in JetBrains IDEs

  1. Open the GitHub Copilot Chat window in your JetBrains IDE.
  2. From the agents dropdown at the bottom of the chat view, clickConfigure Agents..., then in the settings window, under "Chat Agents", clickWorkspace.
  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, seeConfiguring an agent profile.
    • You can use theConfigure 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. ClickApply to add selected tools to the agent profile.
    • To set which AI model the agent uses, add amodel: property and select your preferred model from the autocomplete dropdown.

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

Creating a custom agent profile in Eclipse

  1. Open the GitHub Copilot Chat window in Eclipse.
  2. From the agents dropdown at the bottom of the chat view, clickConfigure Agents..., then clickAdd....
  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, seeConfiguring an agent profile.
    • You can use theConfigure 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. ClickApply to add selected tools to the agent profile.
    • To set which AI model the agent uses, add amodel: property and select your preferred model from the autocomplete dropdown.

To update an agent profile, selectConfigure Agents... from the agents dropdown, and then select the agent you want to modify and clickEdit.

Creating a custom agent profile in Xcode

  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, seeConfiguring an agent profile.
    • You can use theCustomize 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 thehandoffs property for transitioning between custom agents. ClickApply 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 is a Markdown file with YAML frontmatter that specifies the custom agent's name, description, available tools, and MCP server configurations (for organization/enterprise level agents). Configuring an agent profile involves defining the agent's identity, capabilities, tool access, and behavioral instructions.

For detailed configuration information about YAML properties, tools, MCP server setup, tool aliases, and how custom agents are processed, seeCustom agents configuration.

To configure your agent profile:

  1. Optionally, write aname for your custom agent. If unset, the name will default to the filename (without the.md or.agent.md suffix).
  2. Write a briefdescription (required) explaining what your agent does and its specific capabilities or domain expertise.
  3. In thetools property, define which tools the agent can use. This is a list of tool names or aliases, including tools from MCP servers configured in the repository settings or the agent profile (for example,tools: ["read", "edit", "search", "some-mcp-server/tool-1"]). If you omit this property, the agent will have access to all available tools.
  4. If creating an organization or enterprise level agent on GitHub, you can use themcp-servers property to optionally configure MCP servers that will be available only to this agent to extend its capabilities.
  5. If you are creating and using the agent profile in VS Code, JetBrains IDEs, Eclipse, or Xcode, you can also use themodel property to control which AI model the agent should use.
  6. Optionally, set thetarget property to eithervscode orgithub-copilot if you want to only use the agent in a specific environment. The agent will be available in both environments if you omit the property.
  7. Write the agent's prompt. Define the agent's behavior, expertise, and instructions in the Markdown content below the YAML frontmatter.

Example agent profiles

The following examples demonstrate what an agent profile could look like for the common tasks of writing tests or planning the implementation of a project. For additional inspiration, see theCustom agents examples in the customization library. You can also find more specific examples in theawesome-copilot community collection.

Testing specialist

This example enables all tools by omitting thetools property.

Text
---name: test-specialistdescription: 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 requestedAlways include clear test descriptions and use appropriate testing patterns for the language and framework.

Implementation planner

This example only enables a subset of tools.

Text
---name: implementation-plannerdescription: Creates detailed implementation plans and technical specifications in markdown formattools: ["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 followAlways 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

Once you've created a custom agent, you can use it wherever Copilot coding agent is available.

  • When prompting Copilot coding agent with a task on GitHub.com, use the dropdown menu in the agents panel or agents tab to select your custom agent instead of the default coding agent.
  • When assigning Copilot coding agent to an issue, you can select your custom agent from the dropdown menu to handle the issue with your specialized configuration.
  • When using the GitHub Copilot CLI, you can choose to use a particular custom agent by using the/agent slash command or referencing the agent in a prompt or via a command-line argument. For more information, seeUsing GitHub Copilot CLI.

When Copilot opens pull requests, it will note which custom agent was used to complete the work in the pull request description.

For more information on using Copilot coding agent, seeAsking GitHub Copilot to create a pull request.

Using custom agents in your IDE

You can also use your custom agent profiles directly in supported IDEs, including Visual Studio Code, JetBrains IDEs, Eclipse, and Xcode. 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.

Note that some properties may function differently, or be ignored, between the GitHub.com and IDE environments. For more information on supported properties, seeCustom agents configuration.

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

Next steps


[8]ページ先頭

©2009-2025 Movatter.jp