{"meta":{"title":"关于自定义代理","intro":"Custom agents 通过量身定制的协助增强 Copilot。","product":"GitHub Copilot","breadcrumbs":[{"href":"/zh/enterprise-cloud@latest/copilot","title":"GitHub Copilot"},{"href":"/zh/enterprise-cloud@latest/copilot/concepts","title":"概念"},{"href":"/zh/enterprise-cloud@latest/copilot/concepts/agents","title":"智能体"},{"href":"/zh/enterprise-cloud@latest/copilot/concepts/agents/cloud-agent","title":"Cloud agent"},{"href":"/zh/enterprise-cloud@latest/copilot/concepts/agents/cloud-agent/about-custom-agents","title":"自定义代理"}],"documentType":"article"},"body":"# 关于自定义代理\n\nCustom agents 通过量身定制的协助增强 Copilot。\n\n## 关于 custom agents\n\nCustom agents 是专用版本的 Copilot 代理，可针对独特的工作流、编码约定和用例进行定制。 他们的行为就像定制团队成员一样，遵循你的标准，使用正确的工具，并实施团队特定的做法。 定义这些代理一次，而不是重复提供相同的指令和上下文。\n\n使用名为 custom agents 的 Markdown 文件进行定义agent profiles。 这些文件指定提示、工具和 MCP 服务器。 这样，就可以将约定、框架和所需结果直接编码为 Copilot。\n\nagent profile定义custom agent的行为。 将代理分配到任务或问题时，它会实例化custom agent。\n\n## Agent profile 格式\n\nAgent profiles 是带有 YAML frontmatter 的 Markdown 文件。 在最简单的形式中，它们包括：\n\n* **名称** （可选）：用于custom agent的显示名称。 如果省略，代理的文件名将用作其标识符和默认显示名称。\n* **说明**：说明代理的用途和功能。\n* **提示**：定义代理的行为和专业知识的自定义说明。\n* **工具** （可选）：代理可以访问的特定工具。 默认情况下，代理可以访问所有可用的工具，包括内置工具和 MCP 服务器工具。\n\nAgent profiles 还可以使用 `mcp-servers` 属性包含 MCP 服务器配置。\n\n### 示例 agent profile\n\n此示例是一个基本的 agent profile，配置了名称、描述和提示。\n\n```text\n---\nname: readme-creator\ndescription: Agent specializing in creating and improving README files\n---\n\nYou are a documentation specialist focused on README files. Your scope is limited to README files or other related documentation files only - do not modify or analyze code files.\n\nFocus on the following instructions:\n- Create and update README.md files with clear project descriptions\n- Structure README sections logically: overview, installation, usage, contributing\n- Write scannable content with proper headings and formatting\n- Add appropriate badges, links, and navigation elements\n- Use relative links (e.g., `docs/CONTRIBUTING.md`) instead of absolute URLs for files within the repository\n- Make links descriptive and add alt text to images\n```\n\n## 可配置 custom agents 的位置\n\n可以在不同级别定义 agent profiles ：\n\n* **存储库级别**：在存储库中创建项目特定的代理`.github/agents/CUSTOM-AGENT-NAME.md`。\n* **组织级别**： `/agents/CUSTOM-AGENT-NAME.md` 在组织 `.github` 或 `.github-private` 存储库中创建，以便在组织内获得更广泛的可用性。\n* **企业级**：在企业所有者于企业设置中指定的组织的 `.github-private` 仓库中创建 `/agents/CUSTOM-AGENT-NAME.md`，以便在企业中的所有仓库中可用。\n\n有关详细信息，请参阅 [准备在组织中使用自定义代理](/zh/enterprise-cloud@latest/copilot/how-tos/administer-copilot/manage-for-organization/prepare-for-custom-agents) 和 [准备在企业中使用自定义代理](/zh/enterprise-cloud@latest/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-agents/prepare-for-custom-agents)。\n\n## 可在何处使用 custom agents\n\n> \\[!NOTE]\n> Custom agents 位于适用于 JetBrains IDE、Eclipse 和 Xcode 的 公开预览 中，并且可能会更改。\n\n创建custom agents后，这些将可用于以下方面：\n\n* **Copilot cloud agentGitHub.com 上**：智能体选项卡和面板、问题分配和拉取请求\n* **Copilot cloud agentIDE 中**：Visual Studio Code、JetBrains IDE、Eclipse 和 Xcode\n* **GitHub Copilot CLI**\n\n可以直接在 JetBrains IDE、Eclipse 和 Xcode 中使用agent profilesVisual Studio Code。 某些属性可能以不同的方式运行，或在环境之间被忽略。\n\n有关在 custom agents 中使用 Visual Studio Code 的详细信息，请参阅 [Custom agents 中的 VS Code](https://code.visualstudio.com/docs/copilot/customization/custom-agents)。\n\n## 后续步骤\n\n若要创建自己的 custom agents帐户，请参阅：\n\n* [为Copilot cloud agent创建自定义代理](/zh/enterprise-cloud@latest/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/create-custom-agents)\n* [为 GitHub Copilot CLI 创建和使用自定义智能体](/zh/enterprise-cloud@latest/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli)\n* [Copilot自定义备忘单](/zh/enterprise-cloud@latest/copilot/reference/customization-cheat-sheet)"}