Skip to content

Commit 6a8739d

Browse files
committed
Add guidelines for context-isolated subagents and handoffs in VS Code
1 parent 11c5506 commit 6a8739d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/agents/copilot-customization-builder.agent.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,31 @@ Frontmatter guidelines:
8585
- Avoid destructive terminal commands; if terminal is required, explain why and keep commands narrowly scoped.
8686
- Keep tool sets under control; there are practical limits on how many tools can be enabled at once.
8787

88+
## Subagents and handoffs (important)
89+
90+
### Context-isolated subagents (VS Code)
91+
92+
VS Code supports **context-isolated subagents** via the `runSubagent` tool. To use subagents reliably:
93+
94+
- Ensure `runSubagent` is enabled (either via the tools picker, or via `tools: [...]` in the agent/prompt frontmatter).
95+
- If you want a subagent to run as a *specific custom agent*, enable the experimental setting `chat.customAgentInSubagent.enabled`.
96+
- A custom agent can be blocked from subagent usage by setting `infer: false` in its `*.agent.md` frontmatter.
97+
98+
### Handoffs (VS Code)
99+
100+
VS Code custom agents support a `handoffs:` frontmatter property to guide users through a multi-step workflow (for example: Plan → Implement → Review).
101+
102+
### Cross-environment note (VS Code vs GitHub Copilot)
103+
104+
Some frontmatter fields have different behavior depending on where the agent runs.
105+
106+
- `infer`:
107+
- In **VS Code**, `infer` controls whether the agent can be used as a subagent (defaults to `true`).
108+
- In **GitHub Copilot coding agent**, `infer: false` disables automatic agent selection (the agent must be chosen manually).
109+
- `handoffs`:
110+
- Supported in **VS Code**.
111+
- Currently **ignored** by **GitHub Copilot coding agent** for compatibility.
112+
88113
## Reference docs
89114

90115
- VS Code Copilot overview: https://code.visualstudio.com/docs/copilot/overview
@@ -104,9 +129,11 @@ Frontmatter guidelines:
104129
- Context engineering guide: https://code.visualstudio.com/docs/copilot/guides/context-engineering-guide
105130
- Prompt engineering guide: https://code.visualstudio.com/docs/copilot/guides/prompt-engineering-guide
106131
- Security considerations (VS Code): https://code.visualstudio.com/docs/copilot/security
132+
- Subagents / chat sessions (VS Code): https://code.visualstudio.com/docs/copilot/chat/chat-sessions
107133

108134
GitHub Copilot (cloud) custom agents:
109135
- Creating custom agents (GitHub docs): https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/create-custom-agents
136+
- Custom agents configuration (GitHub reference): https://docs.github.com/en/copilot/reference/custom-agents-configuration
110137

111138
## Deliverables style
112139

0 commit comments

Comments
 (0)