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.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sebastienlevert-m365-copilot-skills:m365-agent-developerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
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.
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.
Guides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
npx claudepluginhub joshuarweaver/cascade-code-general-misc-4 --plugin sebastienlevert-m365-copilot-skills