skills/int-patterns/SKILL.md
Pattern 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 suggestions, review against best practices, troubleshooting known pitfalls, YAML reference during implementation. DO NOT USE FOR: general YAML schema reference (use int-reference), topic creation mechanics (use new-topic).
npx skillsauth add microsoft/skills-for-copilot-studio int-patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Only read the pattern file relevant to the current task — do NOT read all files.
Patterns are recommendations, not requirements. How you present them depends on your role:
If you are the Advisor agent:
proven: "This is a proven pattern used in production — consider it for…"recommended: "A recommended approach that works well — consider it for…"experimental: "This is an experimental approach, not yet fully validated — you may want to test thoroughly before adopting"If you are the Author agent:
Loads customer-specific acronyms into a global variable on first message so the orchestrator can expand them before searching knowledge sources.
Read this pattern when:
Loads the current user's M365 profile (country, department) into global variables for personalized answers.
Read this pattern when:
Uses a Switch expression inside a BeginDialog node to route to different topics based on a variable.
Read this pattern when:
Stops child agents from messaging users directly by instructing them to use output variables.
Read this pattern when:
Injects the current date into agent instructions using Power Fx for accurate date-relative responses.
Read this pattern when:
Uses AutomaticTaskInput to classify or extract structured data from the user's message at orchestration time — zero extra cost or latency.
Read this pattern when:
Stops the orchestrator from leaking internal reasoning and tool call metadata to the end user.
Read this pattern when:
explanation_of_tool_call or similar internal metadataDetects the host channel from System.Activity.ChannelId and gates behavior per surface (Teams, M365 Copilot, web chat, Direct Line, voice).
Read this pattern when:
=Lower(ChannelId) = "msteams" check is silently failing for msteams:Copilot or other compound channel IDsClassifies Azure OpenAI content-filter errors by subcode in the OnError topic and returns category-specific user messages with telemetry. Azure OpenAI models only — does not work with Anthropic or xAI models.
Read this pattern when:
OnError, ContentFiltered, Azure OpenAI content filters, or RAI subcodesUses <br /><br /> inside message and question nodes to render reliable paragraph spacing across channels.
Read this pattern when:
<br />, or formatting in messages or questionsSends a randomized hold message during knowledge search so users know the agent is working.
Read this pattern when:
OnKnowledgeRequested, typing indicators, or hold messagesWorkarounds to improve MCP tool invocation reliability using instruction-based nudges or a dedicated child agent wrapper.
Read this pattern when:
/ syntax with MCP toolsSends high-level "Thinking" messages during multi-step orchestration to improve observability and perceived responsiveness.
Read this pattern when:
Captures a best-effort conversation transcript into a variable for escalation, logging, and downstream automation.
Read this pattern when:
Eight coordinated production patterns for Teams and M365 Copilot agents covering reinstalls, stale context, resets, diagnostics, and suggested prompts.
Read this pattern when:
OnInstallationUpdate, OnInactivity, OnSystemRedirect, suggested prompts, or Teams-specific behaviorMultiple patterns can be combined in a single agent. Common combinations:
conversation-init OnActivity topic (template at templates/topics/conversation-init.topic.mcs.yml)Global.UserContext cross-channel; replace hard-coded values with the JIT User Context connector call for real profile datatesting
Look up Copilot Studio YAML schema definitions. Use when the user asks about schema structure, element properties, or how to use a specific YAML kind.
data-ai
Reference tables for Copilot Studio YAML authoring: triggers, actions, variables, entities, Power Fx functions, templates. Preloaded by author and advisor agents.
development
Add a knowledge source (public website or SharePoint) to a Copilot Studio agent. Use when the user asks to add a knowledge source, documentation URL, website, or SharePoint site for the agent to search.
testing
Validate Copilot Studio agent YAML files using the LSP binary's full diagnostics (YAML structure, Power Fx, schema, cross-file references). Use when the user asks to check, validate, or verify YAML files.