{"meta":{"title":"Copilot cloud agent用のカスタム エージェントの作成","intro":"特定の開発タスクに合わせて調整された専門知識を持つ特殊なエージェントを作成できます。","product":"GitHub Copilot","breadcrumbs":[{"href":"/ja/copilot","title":"GitHub Copilot"},{"href":"/ja/copilot/how-tos","title":"方法"},{"href":"/ja/copilot/how-tos/copilot-on-github","title":"Copilot で GitHub"},{"href":"/ja/copilot/how-tos/copilot-on-github/customize-copilot","title":"Copilot のカスタマイズ"},{"href":"/ja/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent","title":"cloud agent のカスタマイズ"},{"href":"/ja/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/create-custom-agents","title":"カスタム エージェントを作成する"}],"documentType":"article"},"body":"# Copilot cloud agent用のカスタム エージェントの作成\n\n特定の開発タスクに合わせて調整された専門知識を持つ特殊なエージェントを作成できます。\n\nCustom agents を使用すると、特定のタスクに合わせて Copilotの専門知識を調整できます。\ncustom agentsの概念の概要については、「[AUTOTITLE」](/ja/copilot/concepts/agents/cloud-agent/about-custom-agents)を参照してください。\n\n> \\[!NOTE]\n> Custom agents は、JetBrains IDE、Eclipse、Xcode 用 パブリック プレビュー にあり、変更される可能性があります。\n\n## リポジトリに custom agent プロファイルを作成する GitHub\n\n1. [\n   https://github.com/copilot/agents\n   ](https://github.com/copilot/agents?ref_product=copilot\\&ref_type=engagement\\&ref_style=text)の\\[エージェント]タブに移動します。\n\n2. プロンプト ボックスのドロップダウン メニューを使用して、 custom agent プロファイルを作成するリポジトリを選択します。\n\n   > \\[!NOTE]\n   > 組織の所有者は、組織内のすべてのリポジトリで使用できる組織レベルの custom agents を、組織の `.github` または `.github-private` リポジトリに作成できます。 エンタープライズ所有者は、エンタープライズ設定で指定された組織のcustom agents リポジトリにエンタープライズ レベルの`.github-private`を作成できます。これは、企業内のすべての組織で使用できます。 詳細については、「[組織でカスタム エージェントを使用する準備](/ja/copilot/how-tos/administer-copilot/manage-for-organization/prepare-for-custom-agents)」および「[企業でカスタム エージェントを使用する準備](/ja/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-agents/prepare-for-custom-agents)」を参照してください。\n\n3. 必要に応じて、 agent profile を作成するブランチを選択します。 既定値はメイン ブランチです。\n\n4. \\[<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-copilot\" aria-label=\"Select a custom agent\" role=\"img\"><path d=\"M7.998 15.035c-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.201-.508-.254-1.084-.254-1.656 0-.87.128-1.769.693-2.484.579-.733 1.494-1.124 2.724-1.261 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095v1.872c0 .766-3.351 3.795-8.002 3.795Zm0-1.485c2.28 0 4.584-1.11 5.002-1.433V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-1.146 0-2.059-.327-2.71-.991A3.222 3.222 0 0 1 8 6.303a3.24 3.24 0 0 1-.544.743c-.65.664-1.563.991-2.71.991-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433ZM6.762 2.83c-.193-.206-.637-.413-1.682-.297-1.019.113-1.479.404-1.713.7-.247.312-.369.789-.369 1.554 0 .793.129 1.171.308 1.371.162.181.519.379 1.442.379.853 0 1.339-.235 1.638-.54.315-.322.527-.827.617-1.553.117-.935-.037-1.395-.241-1.614Zm4.155-.297c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Z\"></path><path d=\"M6.25 9.037a.75.75 0 0 1 .75.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 .75-.75Zm4.25.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 1.5 0Z\"></path></svg>] をクリックし、\\[**エージェントの作成] <svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-plus\" aria-label=\"Plus button\" role=\"img\"><path d=\"M7.75 2a.75.75 0 0 1 .75.75V7h4.25a.75.75 0 0 1 0 1.5H8.5v4.25a.75.75 0 0 1-1.5 0V8.5H2.75a.75.75 0 0 1 0-1.5H7V2.75A.75.75 0 0 1 7.75 2Z\"></path></svg>** クリックします。 これにより、ターゲット リポジトリの`my-agent.agent.md` ディレクトリに`.github/agents`という名前のテンプレート エージェント プロファイルが開きます。\n\n5. 組織レベルまたはエンタープライズ レベルの custom agentを作成する場合は、ファイル パスの `.github/` 部分を削除して、テンプレートをルート `agents` ディレクトリに移動します。\n\n6. エージェントの目的を識別する一意のわかりやすい名前を選択して、ファイル名 ( `.agent.md`前のテキスト) を編集します。 ファイル名には、 `.`、 `-`、 `_`、 `a-z`、 `A-Z`、 `0-9`の文字のみが含まれていることに注意してください。\n\n7. 名前、説明、ツール、プロンプトなど、 agent profileを構成します。\n   agent profileに含めることができる内容の詳細については、「[agent profileの構成」を](#configuring-an-agent-profile)参照してください。\n\n8. ファイルをリポジトリにコミットし、既定のブランチにマージします。 \\[エージェント] タブに戻り、必要に応じてページを更新します。 プロンプト ボックスでcustom agentをクリックすると、ドロップダウンにあなたの<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-copilot\" aria-label=\"copilot\" role=\"img\"><path d=\"M7.998 15.035c-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.201-.508-.254-1.084-.254-1.656 0-.87.128-1.769.693-2.484.579-.733 1.494-1.124 2.724-1.261 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095v1.872c0 .766-3.351 3.795-8.002 3.795Zm0-1.485c2.28 0 4.584-1.11 5.002-1.433V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-1.146 0-2.059-.327-2.71-.991A3.222 3.222 0 0 1 8 6.303a3.24 3.24 0 0 1-.544.743c-.65.664-1.563.991-2.71.991-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433ZM6.762 2.83c-.193-.206-.637-.413-1.682-.297-1.019.113-1.479.404-1.713.7-.247.312-.369.789-.369 1.554 0 .793.129 1.171.308 1.371.162.181.519.379 1.442.379.853 0 1.339-.235 1.638-.54.315-.322.527-.827.617-1.553.117-.935-.037-1.395-.241-1.614Zm4.155-.297c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Z\"></path><path d=\"M6.25 9.037a.75.75 0 0 1 .75.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 .75-.75Zm4.25.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 1.5 0Z\"></path></svg>が表示されます。\n\n## agent profile の設定を行う\n\nagent profileは、custom agentの名前、説明、使用可能なツール、MCP サーバー構成を指定する YAML frontmatter を含む Markdown ファイルです。\nagent profileの構成には、エージェントの ID、機能、ツール アクセス、および動作命令を定義する必要があります。\n\nYAML プロパティ、ツール、MCP サーバーのセットアップ、ツールエイリアス、および custom agents の処理方法の詳細については、 [カスタム エージェントの構成](/ja/copilot/reference/custom-agents-configuration) を参照してください。\n\nagent profileを構成するには:\n\n1. オプションで、`name`用のcustom agentを記述します。 設定を解除すると、名前は既定でファイル名に設定されます ( `.md` または `.agent.md` サフィックスは付けなくなります)。\n2. エージェントの機能と、その特定の機能またはドメインの専門知識を説明する簡単な `description` (必須) を記述します。\n3. `tools` プロパティで、エージェントで使用できるツールを定義します。 これは、リポジトリ設定または agent profile ( `tools: [\"read\", \"edit\", \"search\", \"some-mcp-server/tool-1\"]` など) で構成された MCP サーバーのツールを含む、ツール名またはエイリアスの一覧です。 このプロパティを省略すると、エージェントは使用可能なすべてのツールにアクセスできます。\n   [カスタム エージェントの構成](/ja/copilot/reference/custom-agents-configuration#tools) の「ツール」を参照してください。\n4. 必要に応じて、 `mcp-servers` プロパティで、このエージェントのみが使用できる MCP サーバーを構成して、その機能を拡張できます。\n   [カスタム エージェントの構成](/ja/copilot/reference/custom-agents-configuration#mcp-server-configuration-details) の「MCP サーバー構成の詳細」を参照してください。\n5. agent profile、JetBrains IDE、Eclipse、または Xcode でVS Codeを作成して使用する場合は、`model` プロパティを使用して、エージェントが使用する AI モデルを制御することもできます。\n6. 必要に応じて、特定の環境でのみエージェントを使用する場合は、 `target` プロパティを `vscode` または `github-copilot` に設定します。 このプロパティを省略すると、エージェントは両方の環境で使用できます。\n7. エージェントのプロンプトを書いてください。 YAML frontmatter の下にある Markdown コンテンツで、エージェントの動作、専門知識、および手順を定義します。 プロンプトの最大文字数は 30,000 文字です。\n\n## agent profiles の例\n\n次の例は、agent profile が、テストの記述やプロジェクトの計画に関連する一般的なタスクにおいてどのように見えるかを示しています。 その他のヒントについては、カスタマイズ ライブラリの [Custom agents](/ja/copilot/tutorials/customization-library/custom-agents) の例を参照してください。 さらに具体的な例については、 [awesome-copilot](https://github.com/github/awesome-copilot/tree/main/agents) コミュニティ コレクションを参照してください。\n\n### テストスペシャリスト\n\nこの例では、 `tools` プロパティを省略して、すべてのツールを有効にします。\n\n```text copy\n---\nname: test-specialist\ndescription: Focuses on test coverage, quality, and testing best practices without modifying production code\n---\n\nYou are a testing specialist focused on improving code quality through comprehensive testing. Your responsibilities:\n\n- Analyze existing tests and identify coverage gaps\n- Write unit tests, integration tests, and end-to-end tests following best practices\n- Review test quality and suggest improvements for maintainability\n- Ensure tests are isolated, deterministic, and well-documented\n- Focus only on test files and avoid modifying production code unless specifically requested\n\nAlways include clear test descriptions and use appropriate testing patterns for the language and framework.\n```\n\n### 実装プランナー\n\nこの例では、ツールのサブセットのみを有効にします。\n\n```text copy\n---\nname: implementation-planner\ndescription: Creates detailed implementation plans and technical specifications in markdown format\ntools: [\"read\", \"search\", \"edit\"]\n---\n\nYou are a technical planning specialist focused on creating comprehensive implementation plans. Your responsibilities:\n\n- Analyze requirements and break them down into actionable tasks\n- Create detailed technical specifications and architecture documentation\n- Generate implementation plans with clear steps, dependencies, and timelines\n- Document API designs, data models, and system interactions\n- Create markdown files with structured plans that development teams can follow\n\nAlways 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.\n```\n\n## custom agents の使用\n\ncustom agentを作成したら、Copilot cloud agentが使用可能な場所であればどこでも使用できます。\n\n* Copilot cloud agentのタスクでGitHub.comを求めるメッセージが表示されたら、\\[エージェント] パネルまたは \\[エージェント] タブのドロップダウン メニューを使用して、既定のcustom agentではなくcloud agentを選択します。\n* 問題に Copilot cloud agent を割り当てるときは、ドロップダウン メニューから custom agent を選択して、特殊な構成に関する問題を処理できます。\n* GitHub Copilot CLIを使用する場合は、custom agentスラッシュ コマンドを使用するか、プロンプトでエージェントを参照するか、コマンド ライン引数を使用して、特定の`/agent`を使用するかを選択できます。 詳細については、「[GitHub Copilot CLI の使用](/ja/copilot/how-tos/copilot-cli/use-copilot-cli/overview#use-custom-agents)」を参照してください。\n\nCopilotがプル要求を開くと、pull request の説明で作業を完了するために使用されたcustom agentが表示されます。\n\nCopilot cloud agent の使用について詳しくは、「[GitHub Copilot セッションの開始](/ja/copilot/how-tos/use-copilot-agents/cloud-agent/start-copilot-sessions)」をご覧ください。\n\n## 次のステップ\n\n* 最初の custom agentを作成するための実践的なチュートリアルについては、 [最初のカスタム エージェント](/ja/copilot/tutorials/customization-library/custom-agents/your-first-custom-agent) を参照してください。\n* 詳細な構成情報については、 [AUTOTITLE を](/ja/copilot/reference/custom-agents-configuration)参照してください。\n* custom agentsを含むクラウド エージェントを使用してCopilotセッションを開始する方法については、[GitHub Copilot セッションの開始](/ja/copilot/how-tos/use-copilot-agents/cloud-agent/start-copilot-sessions) を参照してください。"}