$npx -y skills add microsoft/skills-for-copilot-studio --skill edit-triggersModify topic triggers — trigger phrases and model description. Use when the user asks to add, remove, or change trigger phrases, or edit a topic's model description.
| 1 | # Edit Topic Triggers |
| 2 | |
| 3 | Modify how a topic gets triggered: **trigger phrases** (`triggerQueries`) and **model description** (`modelDescription`). |
| 4 | |
| 5 | ## Instructions |
| 6 | |
| 7 | 1. **Auto-discover the agent directory**: |
| 8 | ``` |
| 9 | Glob: **/agent.mcs.yml |
| 10 | ``` |
| 11 | NEVER hardcode an agent name. |
| 12 | |
| 13 | 2. **Find the target topic**: |
| 14 | ``` |
| 15 | Glob: <agent-dir>/topics/*.topic.mcs.yml |
| 16 | ``` |
| 17 | If `$ARGUMENTS` specifies a topic name, match it. Otherwise, list all topics and ask which one. |
| 18 | |
| 19 | 3. **Read the topic file** and identify what to change. |
| 20 | |
| 21 | 4. **Check the agent's settings.mcs.yml** for `GenerativeActionsEnabled`. This determines which trigger mechanism matters most. |
| 22 | |
| 23 | 5. **Make the requested changes** using the Edit tool. |
| 24 | |
| 25 | ## Model Description (`modelDescription`) |
| 26 | |
| 27 | The `modelDescription` is a natural language description at the root of an `AdaptiveDialog` that tells the generative orchestrator **when to route to this topic**. When `GenerativeActionsEnabled: true`, this is the **primary way the agent decides which topic to trigger** — even more important than trigger phrases. |
| 28 | |
| 29 | ```yaml |
| 30 | kind: AdaptiveDialog |
| 31 | modelDescription: This topic helps users order a pizza by collecting their preferred size, toppings, and delivery address. |
| 32 | beginDialog: |
| 33 | kind: OnRecognizedIntent |
| 34 | id: main |
| 35 | ... |
| 36 | ``` |
| 37 | |
| 38 | ### Best Practices for Model Description |
| 39 | |
| 40 | - Write a **clear, specific sentence** describing what the topic does and when it should be used |
| 41 | - Focus on the **user's intent**: "Use this topic when the user asks for information about our perfumes" rather than "This topic sends a message" |
| 42 | - Include **key scenarios** the topic covers: "This topic handles billing inquiries, refund requests, and payment issues" |
| 43 | - Keep it **concise but complete** — the orchestrator reads this to decide routing |
| 44 | - Avoid vague descriptions like "This topic handles requests" — be specific about *which* requests |
| 45 | |
| 46 | ### Examples from Real Topics |
| 47 | |
| 48 | ```yaml |
| 49 | # Good — specific about what the topic does and when to use it |
| 50 | modelDescription: Use this topic when the user asks for help or needs assistance with something. Search the SharePoint knowledge base to find relevant information. |
| 51 | |
| 52 | # Good — describes the full flow |
| 53 | modelDescription: This topic takes the user's favorite color, generates a word by concatenating the color with four random digits, and returns the generated word. If the color is white, it also provides information about the wavelength. |
| 54 | |
| 55 | # Good — describes the computation |
| 56 | modelDescription: This sample topic performs the sum between the two numbers in input |
| 57 | ``` |
| 58 | |
| 59 | ### When to Add/Edit Model Description |
| 60 | |
| 61 | - **Always add** a `modelDescription` to topics with `OnRecognizedIntent` when the agent has `GenerativeActionsEnabled: true` |
| 62 | - **Update it** when the topic's purpose or scope changes |
| 63 | - Topics with system triggers (OnError, OnUnknownIntent, OnConversationStart) don't need a `modelDescription` — they're triggered automatically |
| 64 | |
| 65 | ## Trigger Phrases (`triggerQueries`) |
| 66 | |
| 67 | Trigger phrases are used for intent recognition. They live inside `beginDialog.intent.triggerQueries`. |
| 68 | |
| 69 | **Only topics with `OnRecognizedIntent` triggers have editable trigger phrases.** Other trigger types (OnConversationStart, OnUnknownIntent, etc.) are system-triggered and don't use phrases. |
| 70 | |
| 71 | ### Operations |
| 72 | |
| 73 | - **Add phrases**: Append new entries to `triggerQueries` |
| 74 | - **Remove phrases**: Delete entries from `triggerQueries` |
| 75 | - **Replace phrases**: Swap old entries for new ones |
| 76 | - **Rewrite all**: Replace the entire `triggerQueries` array |
| 77 | |
| 78 | ### Best Practices for Trigger Phrases |
| 79 | |
| 80 | - Use **5-10 phrases** per topic for good recognition |
| 81 | - Cover **synonyms and variations** (e.g., "help", "assist", "support", "I need help") |
| 82 | - Include **different sentence structures** (questions, statements, keywords) |
| 83 | - **Avoid overlap** — don't use the same phrases in multiple topics |
| 84 | - Keep phrases **short and natural** (how users actually type/speak) |
| 85 | - Mix **formal and informal** phrasing |
| 86 | |
| 87 | ### Example Structure |
| 88 | |
| 89 | ```yaml |
| 90 | kind: AdaptiveDialog |
| 91 | modelDescription: This topic helps users with greeting and introduction. |
| 92 | beginDialog: |
| 93 | kind: OnRecognizedIntent |
| 94 | id: main |
| 95 | intent: |
| 96 | displayName: Greeting |
| 97 | triggerQueries: |
| 98 | - Hello |
| 99 | - Hi |
| 100 | - Hey |
| 101 | - Good morning |
| 102 | - Good afternoon |
| 103 | ``` |
| 104 | |
| 105 | ## What This Skill Cannot Do |
| 106 | |
| 107 | - Cannot change the trigger **type** (e.g., from OnRecognizedIntent to OnConversationStart) — this requires recreating the topic. |
| 108 | - Cannot add triggers to system topics that don't use OnRecognizedIntent. |