$npx -y skills add microsoft/skills-for-copilot-studio --skill int-patternsPattern library for Copilot Studio agent design. Contains proven and recommended implementation patterns with YAML examples. Used by the Advisor agent to suggest patterns and by the Author agent to reference YAML structure during implementation. USE FOR: design guidance, pattern
| 1 | # Copilot Studio Pattern Library |
| 2 | |
| 3 | **Only read the pattern file relevant to the current task** — do NOT read all files. |
| 4 | |
| 5 | ## How to use patterns |
| 6 | |
| 7 | Patterns are **recommendations, not requirements**. How you present them depends on your role: |
| 8 | |
| 9 | **If you are the Advisor agent:** |
| 10 | - Present each pattern as a suggestion — explain the challenge it solves and why it's relevant |
| 11 | - Use status-appropriate language: |
| 12 | - `proven`: "This is a proven pattern used in production — consider it for…" |
| 13 | - `recommended`: "A recommended approach that works well — consider it for…" |
| 14 | - `experimental`: "This is an experimental approach, not yet fully validated — you may want to test thoroughly before adopting" |
| 15 | - Always say "you could consider…" or "a common approach is…", never "you must…" |
| 16 | - Let the user decide — do NOT auto-apply patterns without confirmation |
| 17 | |
| 18 | **If you are the Author agent:** |
| 19 | - When implementing a pattern the user or Advisor has already chosen, read the relevant pattern file for the correct YAML structure |
| 20 | - Do NOT suggest patterns yourself — that is the Advisor's role |
| 21 | - Use the YAML examples as reference for the correct kinds, fields, and structure |
| 22 | |
| 23 | ## Pattern Index |
| 24 | |
| 25 | ### JIT Glossary → [jit-glossary.md](${CLAUDE_SKILL_DIR}/../../patterns/jit-glossary.md) |
| 26 | |
| 27 | Loads customer-specific acronyms into a global variable on first message so the orchestrator can expand them before searching knowledge sources. |
| 28 | |
| 29 | **Read this pattern when:** |
| 30 | - The user wants to add a glossary, acronym list, or terminology table |
| 31 | - Knowledge search quality is poor because the agent doesn't understand internal abbreviations |
| 32 | - The user asks about loading CSV/text data into a variable at conversation start |
| 33 | |
| 34 | ### JIT User Context → [jit-user-context.md](${CLAUDE_SKILL_DIR}/../../patterns/jit-user-context.md) |
| 35 | |
| 36 | Loads the current user's M365 profile (country, department) into global variables for personalized answers. |
| 37 | |
| 38 | **Read this pattern when:** |
| 39 | - The user wants country-aware, department-aware, or role-aware answers |
| 40 | - The agent needs to call the M365 Users connector |
| 41 | - The user asks about personalizing responses based on who is chatting |
| 42 | |
| 43 | ### Dynamic Topic Redirect → [dynamic-topic-redirect.md](${CLAUDE_SKILL_DIR}/../../patterns/dynamic-topic-redirect.md) |
| 44 | |
| 45 | Uses a Switch expression inside a BeginDialog node to route to different topics based on a variable. |
| 46 | |
| 47 | **Read this pattern when:** |
| 48 | - The user needs to route to one of several topics based on a variable |
| 49 | - The user wants to replace nested ConditionGroup nodes with a cleaner approach |
| 50 | - The user asks about dynamic topic redirects or Switch expressions |
| 51 | |
| 52 | ### Prevent Child Agent Responses → [prevent-child-agent-responses.md](${CLAUDE_SKILL_DIR}/../../patterns/prevent-child-agent-responses.md) |
| 53 | |
| 54 | Stops child agents from messaging users directly by instructing them to use output variables. |
| 55 | |
| 56 | **Read this pattern when:** |
| 57 | - The user wants a child agent to return data without messaging the user |
| 58 | - The user is confused about the completion setting on a child agent |
| 59 | - The parent agent needs to control all user-facing responses |
| 60 | |
| 61 | ### Date Context → [date-context.md](${CLAUDE_SKILL_DIR}/../../patterns/date-context.md) |
| 62 | |
| 63 | Injects the current date into agent instructions using Power Fx for accurate date-relative responses. |
| 64 | |
| 65 | **Read this pattern when:** |
| 66 | - Users ask date-relative questions ("What's next week?", "upcoming events") |
| 67 | - The agent handles schedules, calendars, deadlines, or time-sensitive content |
| 68 | - Date interpretation is causing confusion or hallucinations |
| 69 | |
| 70 | ### Orchestrator-Generated Variables → [orchestrator-variables.md](${CLAUDE_SKILL_DIR}/../../patterns/orchestrator-variables.md) |
| 71 | |
| 72 | Uses AutomaticTaskInput to classify or extract structured data from the user's message at orchestration time — zero extra cost or latency. |
| 73 | |
| 74 | **Read this pattern when:** |
| 75 | - The user needs to route knowledge searches by category |
| 76 | - The user wants to extract a classification without asking the user or using an AI Prompt |
| 77 | - Knowledge search quality suffers because all sources are searched indiscriminately |
| 78 | |
| 79 | ### Prevent Tool Call Leaks → [prevent-tool-call-leaks.md](${CLAUDE_SKILL_DIR}/../../patterns/prevent-tool-call-leaks.md) |
| 80 | |
| 81 | Stops the orchestrator from leaking internal reasoning and tool call metadata to the end user. |
| 82 | |
| 83 | **Read this pattern when:** |
| 84 | - Users report seeing raw JSON in agent responses |
| 85 | - The agent has connector actions that the orchestrator invokes indirectly |
| 86 | - Responses c |