$npx -y skills add microsoft/skills-for-copilot-studio --skill add-other-agentsAdd child agents, connected agents, or other multi-agent patterns to a Copilot Studio agent. Use when the user asks to create a sub-agent, child agent, connected agent, or call another agent.
| 1 | # Add Other Agents |
| 2 | |
| 3 | Add multi-agent capabilities to a Copilot Studio agent. Two patterns are supported: |
| 4 | |
| 5 | | Pattern | Use when | What it creates | |
| 6 | |---------|----------|----------------| |
| 7 | | **Child agent** | The agent needs a specialist sub-agent owned by the same parent | `AgentDialog` in `agents/` subdirectory | |
| 8 | | **Connected agent** | The agent needs to call an external, independently-managed agent | `InvokeConnectedAgentTaskAction` in a topic (TaskDialog) | |
| 9 | |
| 10 | Ask the user which pattern they need if unclear. |
| 11 | |
| 12 | --- |
| 13 | |
| 14 | ## Pattern 1: Child Agent |
| 15 | |
| 16 | Create a new child agent (AgentDialog) that the parent agent's orchestrator can delegate to. |
| 17 | |
| 18 | ### Instructions |
| 19 | |
| 20 | 1. **Auto-discover the parent agent directory**: |
| 21 | ``` |
| 22 | Glob: **/agent.mcs.yml |
| 23 | ``` |
| 24 | Use the top-level agent (not one inside an `agents/` subdirectory). NEVER hardcode an agent name. |
| 25 | |
| 26 | 2. **Look up the AgentDialog schema**: |
| 27 | ```bash |
| 28 | node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js resolve AgentDialog |
| 29 | node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js resolve OnToolSelected |
| 30 | ``` |
| 31 | |
| 32 | 3. **Determine from the user**: |
| 33 | - Child agent name and display name |
| 34 | - What the child agent specializes in (for the description and instructions) |
| 35 | - What inputs the child agent needs (if any) |
| 36 | - Whether it will need its own knowledge sources (handled in Phase 2 — see below) |
| 37 | |
| 38 | 4. **Create the child agent directory** (Phase 1 — plain agent only, NO knowledge): |
| 39 | ``` |
| 40 | <parent-agent>/agents/<ChildAgentName>/ |
| 41 | └── agent.mcs.yml |
| 42 | ``` |
| 43 | |
| 44 | 5. **Generate `agent.mcs.yml`** using `${CLAUDE_SKILL_DIR}/../../templates/agents/child-agent.mcs.yml` as the starting template. Read the template, then customize all placeholder values (`<...>`) based on the user's requirements. |
| 45 | |
| 46 | Key structure: |
| 47 | - `kind: AgentDialog` — marks this as a child agent |
| 48 | - `beginDialog.kind: OnToolSelected` with a `description` — tells the parent orchestrator when to route here |
| 49 | - `settings.instructions` — the child agent's system prompt |
| 50 | - `inputType` — context the orchestrator passes in |
| 51 | - `outputType` — what the child agent returns (use `outputType: {}` if no structured output is needed) |
| 52 | |
| 53 | **CRITICAL: AgentDialog must NOT have `beginDialog.actions`.** Child agents use generative orchestration — all behavior is driven by `settings.instructions`. Do NOT add action nodes (Question, SendActivity, BeginDialog, ConditionGroup, etc.) to the actions array. If the user's scenario requires hardcoded action flows, it should be an AdaptiveDialog topic in the parent agent, not a child agent. |
| 54 | |
| 55 | 6. **Key fields explained**: |
| 56 | - `beginDialog.description` — This is what the parent orchestrator reads to decide when to route. Be specific and action-oriented (e.g., "This agent handles billing inquiries, refund requests, and payment issues"). |
| 57 | - `settings.instructions` — The child agent's system prompt. Define its personality, scope, and behavior guidelines. |
| 58 | - `inputType` — for context the orchestrator should pass. The parent fills these automatically. |
| 59 | |
| 60 | ### Two-Phase Workflow (Important) |
| 61 | |
| 62 | Child agents MUST be created in two phases: |
| 63 | |
| 64 | **Phase 1 — Create the plain agent** (steps 1-6 above): |
| 65 | - Create ONLY `agent.mcs.yml` with configuration, instructions, inputs, and outputs. |
| 66 | - Do NOT create a `knowledge/` directory or any knowledge sources yet. |
| 67 | - Tell the user: "The child agent has been created. Please push these changes to your environment using the Copilot Studio VS Code Extension before we can add knowledge sources to it." |
| 68 | |
| 69 | **Phase 2 — Add knowledge sources** (only after the user confirms they pushed): |
| 70 | - Once the user confirms the child agent has been pushed and exists in the environment, you can add knowledge sources to it using `/add-knowledge`. |
| 71 | - Create the `knowledge/` directory under the child agent and add knowledge source files there. |
| 72 | |
| 73 | This constraint exists because knowledge sources reference the agent they belong to — the child agent must exist in the environment first. |
| 74 | |
| 75 | ### Example: Customer Support Child Agent |
| 76 | |
| 77 | ```yaml |
| 78 | kind: AgentDialog |
| 79 | |
| 80 | beginDialog: |
| 81 | kind: OnToolSelected |
| 82 | id: main |
| 83 | description: This agent handles billing inquiries, payment issues, refund requests, and subscription management. Route here when users ask about charges, invoices, or account billing. |
| 84 | |
| 85 | settings: |
| 86 | instructions: | |
| 87 | You are a billing support specialist. Help customers with: |
| 88 | - Understanding their charges and invoices |
| 89 | - Processing refund requests |
| 90 | - Managing subscription plans |
| 91 | - Resolving payment issues |
| 92 | |
| 93 | Always verify the customer's account before making changes. |
| 94 | Escalate to a human ag |