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.
This skill inherits all available tools. When active, it can use any tool Claude has access to.
README.mdreferences/api-plugins.mdreferences/common-pitfalls.mdreferences/conversation-design.mdreferences/deployment.mdreferences/patterns-and-frameworks.mdreferences/security-guidelines.mdreferences/typespec-best-practices.mdThis 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 ⚠️
Use this skill when:
Do NOT use this skill for creating new empty projects - use the m365-agent-scaffolder skill instead.
Before using this skill, ensure the following requirements are met:
Required:
Recommended:
Knowledge Prerequisites:
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
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
Follow these best practices for successful M365 Copilot agent development:
@authReferenceId for production environments (see typespec-authentication.md)Reference: security-guidelines.md
@doc decorators to all operations, models, and propertiesReference: conversation-design.md
Reference: deployment.md
Basic workflow for developing and validating TypeSpec code without provisioning:
# Install dependencies
npm install
# Generate environment configuration
npm run generate:env
# Compile TypeSpec to validate implementation
npm run compile
Use case: Local development and validation of TypeSpec syntax and decorators before deployment.
Complete workflow for provisioning an agent to a development environment:
# Install dependencies
npm install
# Generate environment configuration
npm run generate:env
# Compile TypeSpec
npm run compile
# Provision agent to development environment
npx -p @microsoft/m365agentstoolkit-cli@latest atk provision --env local
Result: Returns a test URL like https://m365.cloud.microsoft/chat/?titleId=U_abc123xyz to test the agent in Microsoft 365 Copilot.
Use case: Testing agent functionality in a live environment during development.
Workflow for provisioning and sharing an agent with your organization:
# Install dependencies
npm install
# Generate environment configuration
npm run generate:env
# Compile TypeSpec
npm run compile
# Provision agent to target environment
npx -p @microsoft/m365agentstoolkit-cli@latest atk provision --env dev
# Share agent with tenant users
npx -p @microsoft/m365agentstoolkit-cli@latest atk share --scope tenant --env dev
Result: Agent becomes available to all users in the Microsoft 365 tenant.
Use case: Deploying a shared agent for organizational use after testing and validation.
Workflow for creating an agent package for distribution:
# Install dependencies
npm install
# Generate environment configuration
npm run generate:env
# Compile TypeSpec
npm run compile
# Package agent for distribution
npx -p @microsoft/m365agentstoolkit-cli@latest atk package --env prod
Result: Creates a distributable package file that can be uploaded to the Microsoft 365 admin center or shared externally.
Use case: Creating a final package for production deployment or external distribution.