From sebastienlevert-m365-copilot-skills
Designs, implements, and deploys Microsoft 365 Copilot agents using TypeSpec and ATK CLI. Provides architectural guidance, capability configuration, security patterns, and lifecycle management. Use when developing M365 Copilot agents, working with TypeSpec, or managing agent deployments. For creating new projects, use the m365-agent-scaffolder skill.
npx claudepluginhub joshuarweaver/cascade-code-general-misc-4 --plugin sebastienlevert-m365-copilot-skillsThis skill uses the workspace's default tool permissions.
This comprehensive skill provides expert guidance on the Microsoft 365 Copilot agent development lifecycle: from architectural design through TypeSpec implementation to deployment and publishing using the Agents Toolkit (ATK) CLI.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
This comprehensive skill provides expert guidance on the Microsoft 365 Copilot agent development lifecycle: from architectural design through TypeSpec implementation to deployment and publishing using the Agents Toolkit (ATK) CLI.
⚠️ For creating new projects, use the m365-agent-scaffolder skill first ⚠️
🚨 CRITICAL DEPLOYMENT RULE 🚨
When using this skill to make edits to an agent, you MUST ALWAYS deploy the agent using atk provision before returning to the user. This ensures changes are immediately reflected in M365 Copilot. Never return to the user with undeployed changes.
Use this skill when:
Do NOT use this skill for creating new empty projects - use the m365-agent-scaffolder skill instead.
Follow these step-by-step instructions when working with M365 Copilot agents:
Action: Gather and analyze the agent requirements:
Why it's important: Clear requirements drive architectural decisions and ensure the agent meets user needs.
Action: Create a comprehensive architectural design:
Reference: Follow the Architectural Design section and patterns-and-frameworks.md
Action: Write type-safe agent code using TypeSpec:
@agent decorator@docReference: Follow TypeSpec Best Practices and official typespec-decorators.md
⚠️ IMPORTANT: After making any edits to TypeSpec code, you MUST compile and deploy the agent (Steps 4-5) before returning to the user.
Action: Compile TypeSpec to validate the implementation:
npm run compile
Why it's important: Compilation catches syntax errors and validates decorator usage before deployment.
Action: Provision required Azure resources and register the agent:
npx -p @microsoft/m365agentstoolkit-cli@latest atk provision --env local
Result: Returns a test URL like https://m365.cloud.microsoft/chat/?titleId=U_abc123xyz
Action: Test the agent in Microsoft 365 Copilot:
Action: Deploy to staging/production environments:
npx -p @microsoft/m365agentstoolkit-cli@latest atk provision --env prod
Reference: Follow deployment.md for environment management and CI/CD patterns
Action: Package and share the agent:
# Package the agent
npx -p @microsoft/m365agentstoolkit-cli@latest atk provision --env dev
# Share to tenant (for shared agents)
npx -p @microsoft/m365agentstoolkit-cli@latest atk share --scope tenant --env dev
Reference: See deployment.md for sharing strategies
RULE: When making any changes to an agent (TypeSpec code, instructions, capabilities, API plugins), you MUST complete the following workflow before returning to the user:
npm run compilenpx -p @microsoft/m365agentstoolkit-cli@latest atk provision --env localWhy this is critical:
Never skip deployment: Even for minor changes like updating instructions or conversation starters, always redeploy. M365 Copilot only sees the deployed version.
RULE: Every time you work on an agent project, check for and remove unused or obsolete files:
Files to check and potentially remove:
TODO.md or planning files no longer needed.bak, .old, .orig).env.old, .env.backup)Why this is critical:
Before returning to the user: Always verify the project contains only necessary, actively-used files.
Follow these best practices for successful M365 Copilot agent development:
| Category | Key Focus |
|---|---|
| Security | Least privilege scoping, credential management, input validation |
| Performance | Scoped queries, efficient API design, caching strategies |
| Error Handling | Graceful degradation, clear messages, retry logic |
| Testing | Conversation starters, edge cases, security testing |
| Compliance | Data residency, retention policies, RBAC |
| Maintainability | Documentation, naming conventions, version control |
| Conversation Design | Clear instructions, actionable starters, appropriate tone |
| Deployment | Environment strategy, CI/CD, version management |
Reference: best-practices.md for detailed guidelines.
Common workflow examples for M365 Copilot agent development:
| Example | Description |
|---|---|
| Compile and Validate | Local TypeSpec validation before deployment |
| Development and Provisioning | Full dev workflow with test URL |
| Provision and Share | Deploy and share agent with tenant users |
| Package for Distribution | Create distributable package for production |
Reference: examples.md for complete workflow scripts.