Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/copilot/declarative-agent/v1.8/schema.json",
"version": "v1.8",
"name": "DA routing fixture",
"description": "Tests Declarative Agent lifecycle routing",
"instructions": "Answer questions for the routing evaluation."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/teams/v1.30/MicrosoftTeams.schema.json",
"manifestVersion": "1.30",
"version": "1.0.0",
"id": "${{TEAMS_APP_ID}}",
"name": {
"short": "DA routing fixture",
"full": "Declarative Agent routing fixture"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"description": {
"short": "Tests DA lifecycle routing",
"full": "Tests that DA markers take precedence over an m365agents.yml file."
},
"copilotAgents": {
"declarativeAgents": [
{
"id": "declarativeAgent",
"file": "declarativeAgent.json"
}
]
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: v1.11

environmentFolderPath: ./env

provision: []
deploy: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/microsoft/waza/main/schemas/task.schema.json

id: da-marker-precedence
name: Prefer DA Markers Over m365agents.yml
description: Existing project has DA markers and an ATK lifecycle file
tags:
- declarative-agent
- routing
inputs:
prompt: "Validate and package this project."
files:
- path: declarative-agent/appPackage/manifest.json
- path: declarative-agent/appPackage/declarativeAgent.json
- path: declarative-agent/appPackage/color.png
- path: declarative-agent/appPackage/outline.png
- path: declarative-agent/m365agents.yml
expected:
should_trigger: true
graders:
- type: behavior
name: efficiency_check
config:
max_tool_calls: 20
max_duration_ms: 120000
forbidden_tools:
- atk
- rm
- sudo
- type: prompt
name: quality_check
config:
prompt: |
Review the agent's response. Check that it:
1. Detects the project as a Declarative Agent from `appPackage/declarativeAgent.json` or `copilotAgents.declarativeAgents`.
2. Uses WIQD validate and package commands even though `m365agents.yml` exists.
3. Does not use ATK lifecycle commands for the DA manifest.

If all criteria are met, call set_waza_grade_pass.
Otherwise, call set_waza_grade_fail with your reasoning.
model: "gpt-5.4"
continue_session: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/microsoft/waza/main/schemas/task.schema.json

id: da-schema-reference
name: Answer DA Schema Question Without WIQD Setup
description: User asks a read-only Declarative Agent schema question
tags:
- declarative-agent
- reference
inputs:
prompt: "Which field in a Declarative Agent manifest registers the declarativeAgent.json file?"
expected:
should_trigger: true
graders:
- type: behavior
name: efficiency_check
config:
max_tool_calls: 8
max_duration_ms: 30000
forbidden_tools:
- atk
- wiqd
- npm
- rm
- sudo
- type: prompt
name: quality_check
config:
prompt: |
Review the agent's response. Check that it:
1. Answers that `manifest.json` registers the file through `copilotAgents.declarativeAgents` entries containing `id` and `file`.
2. Does not require WIQD installation, authentication, or a lifecycle command for this read-only question.

If all criteria are met, call set_waza_grade_pass.
Otherwise, call set_waza_grade_fail with your reasoning.
model: "gpt-5.4"
continue_session: true
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ graders:
prompt: |
Review the agent's response. Check that the response is:
1. Successfully created a bot app.
2. Recommand local debugging as next step.
2. Uses ATK, not WIQD, to scaffold the Teams bot.
3. Recommand local debugging as next step.

If all criteria are met, call set_waza_grade_pass.
Otherwise, call set_waza_grade_fail with your reasoning.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ graders:
prompt: |
Review the agent's response. Check that the response is:
1. Successfully created a custom engine agent.
2. Recommend testing in Playground as next step.
2. Uses ATK to scaffold the Custom Engine Agent.
3. Does not route the Custom Engine Agent to WIQD.
4. Recommend testing in Playground as next step.

If all criteria are met, call set_waza_grade_pass.
Otherwise, call set_waza_grade_fail with your reasoning.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,33 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/microsoft/waza/main/schemas/task.schema.json

id: scaffold-da-template
name: Scaffold Declarative Agent
description: User wants to create a Declarative Agent
name: Create Declarative Agent with WIQD
description: User wants to create a Declarative Agent with WIQD
tags:
- scaffold
- happy path
- routing
inputs:
prompt: "I want to build a simple declarative agent working on Microsoft 365 Copilot"
prompt: "Create a Declarative Agent for HR FAQs."
expected:
should_trigger: true
graders:
- type: file
name: atk_configs
config:
must_exist:
- "appPackage/declarativeAgent.json"
- "appPackage/instruction.txt"
- "m365agents.yml"
- type: behavior
name: efficiency_check
config:
max_tool_calls: 15
max_tool_calls: 40
max_duration_ms: 150000
forbidden_tools:
- atk
- rm
- sudo
- type: prompt
name: quality_check
config:
prompt: |
Review the agent's response. Check that the response is:
1. Successfully created an declarative agent.
2. Recommand testing in Microsoft 365 Copilot as next step.
1. Uses `wiqd agent create --name <name> --output <parent>` to create the Declarative Agent.
2. Does not run `atk new` or another ATK lifecycle command for the Declarative Agent.
3. If WIQD is unavailable, gives installation guidance and stops instead of falling back to ATK.

If all criteria are met, call set_waza_grade_pass.
Otherwise, call set_waza_grade_fail with your reasoning.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
---
name: microsoft-365-agents-toolkit
description: "Builds, tests, and deploys Microsoft 365 apps and agents for Teams and Copilot. Includes sub-skills for project creation, local testing, cloud deployment, troubleshooting, and Slack-to-Teams migration. USE FOR: Teams agent, bot, tab, message extension, Declarative Agents, Custom Engine Agents, local testing, Agents Playground, Azure resource provision, remote deployment, Slack to Teams migration, cross-platform bot development, Block Kit to Adaptive Cards conversion. DO NOT USE FOR: general web development, non-bot/non-Teams projects."
description: "Builds, tests, and deploys Microsoft 365 apps and agents for Teams and Copilot. Uses WIQD for Declarative Agent creation, actions, validation, packaging, provisioning, sharing, publishing, and deletion; uses ATK for Custom Engine Agents, Teams bots, tabs, message extensions, Agents Playground, Teams runtime testing, and Azure backend deployment. USE FOR: Declarative Agents, Custom Engine Agents, Teams apps, local testing, deployment, troubleshooting, and Slack-to-Teams migration. DO NOT USE FOR: general web development or non-Microsoft-365 projects."
---

# Microsoft 365 Agents Toolkit Skill

Build Microsoft 365 agents and Teams apps using the ATK CLI.
Build Declarative Agents with WIQD. Use ATK for non-DA Teams apps, code-based agents, runtime testing, and backend compute.

## Declarative Agent Routing

Treat a request or project as a DA when the user explicitly says Declarative Agent, `appPackage/declarativeAgent.json` exists, or `appPackage/manifest.json` contains `copilotAgents.declarativeAgents`. The presence of `m365agents.yml` does not override these markers.

For DA lifecycle requests, follow [declarative-agent-lifecycle.md](toolkit/declarative-agent-lifecycle.md) directly. Use WIQD for the DA manifest and actions; if WIQD is unavailable, provide its installation guidance and stop instead of falling back to ATK. For a hybrid DA, use ATK or Azure tooling only for separate backend compute.

Answer read-only DA schema, manifest, capability, example, and project-structure questions from local references without requiring WIQD installation or login.

## AI Behavior Guidelines

Expand Down Expand Up @@ -98,11 +106,11 @@ Resolve config values only when missing. If a value is already known in the sess

### Step 1: Detect ATK Project

If `m365agentstoolkit*.yml` exists in the current folder, treat it as an ATK project and parse configuration.
Check the Declarative Agent markers above first. If none match and `m365agents*.yml` exists in the current folder, treat it as an ATK project and parse configuration.

### Step 2: Resolve Common Configuration

Resolve variables referenced in `m365agentstoolkit*.yml`. Common variables:
Resolve variables referenced in `m365agents*.yml`. Common variables:
AZURE_OPENAI_API_KEY
AZURE_OPENAI_ENDPOINT
AZURE_OPENAI_DEPLOYMENT_NAME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ See [../toolkit/templates.md](../toolkit/templates.md) for the complete template

## Creating Projects

Create templates in the current directory with one generic flow:
For a Declarative Agent entry in the selection guide, use WIQD and then follow [declarative-agent-lifecycle.md](../toolkit/declarative-agent-lifecycle.md) for actions and lifecycle operations:

```bash
wiqd agent create --name <project-name> --output <parent-folder>
```

For all other entries, create templates in the current directory with this flow:

```bash
# 1) Scaffold into a temporary parent folder
Expand All @@ -52,15 +58,6 @@ rmdir /tmp/<project-name>
Common examples:

```bash
# Declarative Agent (no -l needed)
atk new -c declarative-agent -n my-agent -f /tmp -i false

# Declarative Agent with new API
atk new -c declarative-agent-action -l typescript -n my-api-agent -f /tmp -i false

# Declarative Agent with existing OpenAPI spec
atk new -c declarative-agent-action-from-existing-api -n my-agent -a <openapi-spec-url-or-path> -o "GET /repairs" -o "POST /repairs" -f /tmp -i false

# Custom Engine Agent
atk new -c basic-custom-engine-agent -l typescript -n my-cea -f /tmp -i false

Expand Down Expand Up @@ -122,8 +119,6 @@ List all samples with `atk list samples`.

## Notes

- `declarative-agent` does NOT require `-l` language flag
- `declarative-agent-action-from-existing-api` requires `-a` (OpenAPI spec) and `-o` (operation IDs like `"GET /path"`)
- Office add-in capabilities (`office-addin-*`) are TypeScript only; `office-addin-wxpo-taskpane` accepts `--office-addin-hosts word,excel` (comma-separated) to limit which Office apps it supports, defaulting to all four
- Always use `-i false` for non-interactive scripted creation
- `atk new` can take several minutes — wait for completion (timeout 120000ms+)
Expand All @@ -132,7 +127,8 @@ List all samples with `atk list samples`.
## After Scaffolding

Once the project is created:
- To test locally → see [../test-playground/test-playground.md](../test-playground/test-playground.md)
- For a DA → continue with [declarative-agent-lifecycle.md](../toolkit/declarative-agent-lifecycle.md)
- For other projects, to test locally → see [../test-playground/test-playground.md](../test-playground/test-playground.md)
- To understand project files → see [../toolkit/manifest-and-yaml.md](../toolkit/manifest-and-yaml.md)

## Expert Deep Dives
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

Route deployment tasks to the correct cloud-specific expert. Handles the initial cloud provider interview, then loads the matching micro-expert for step-by-step provisioning and deployment.

Do not route a pure Declarative Agent here. For a hybrid DA, route only its backend compute here; WIQD owns the DA lifecycle.

## interview

### Q1 — Cloud Provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ Read:
Note: C# has SDK support for Teams only (Tier 3). For the Slack side, route to `../bridge/rest-only-integration-ts.md`.

### Toolkit: Lifecycle & CLI

If DA markers are present, do not load this ATK lifecycle cluster for DA manifest operations. Use `../../toolkit/declarative-agent-lifecycle.md`. For a hybrid DA, load this cluster only for separate backend compute.

When: `m365agents.yml`, `atk` CLI, `atk provision`, `atk deploy`, `atk publish`, `atk new`, lifecycle hooks, CI/CD pipeline, built-in actions, `uses:`, `runs:`, `arm/deploy`, `azureAppService/deploy`, `teamsApp/create`, `writeToEnvironmentFile`
Read:
- `toolkit.lifecycle-cli.md`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Provision Azure and M365 resources, then deploy your agent to the cloud.

For a Declarative Agent, follow [declarative-agent-lifecycle.md](../toolkit/declarative-agent-lifecycle.md). Use this ATK workflow only for non-DA projects or a hybrid DA's separate backend compute; a pure DA has no compute to deploy.

## Local Provisioning (for Teams testing)

```bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ atk deploy --env local -i false
## Quick Start (Declarative Agents — No Backend)

```bash
# Just provision/deploy and open directly
atk provision --env local -i false
atk deploy --env local -i false
# Then open Teams and find your agent in the app list
# Validate, package, and provision the DA; there is no compute deployment
wiqd agent validate --path <project> --env local
wiqd agent package --path <project> --env local
wiqd agent provision --path <project> --env local
```

Then open Microsoft 365 Copilot and find the agent in the app list. For other DA lifecycle operations, follow [declarative-agent-lifecycle.md](../toolkit/declarative-agent-lifecycle.md).

## Opening in Different Hosts

Get your app IDs from `env/.env.local`, then open:
Expand All @@ -66,20 +68,6 @@ Get your app IDs from `env/.env.local`, then open:
| Outlook web | `https://outlook.office.com/host/${{M365_APP_ID}}` |
| Office web | `https://www.office.com/m365apps/${{M365_APP_ID}}` |

## Declarative Agents in M365 Copilot

Declarative agents use `M365_APP_ID` (not `TEAMS_APP_ID`), acquired after `teamsApp/extendToM365` runs during provisioning.

**Sideloading URL format:**
```
https://m365.cloud.microsoft/chat/entity1-d870f6cd-4aa5-4d42-9626-ab690c041429/${agent-hint}?auth=2&developerMode=Basic
```

Where `${agent-hint}` is Base64-encoded JSON:
```json
{"id": "${M365_APP_ID}", "scenario": "launchcopilotextension", "properties": {"clickTimestamp": "2/6/2026, 10:30:45 AM"}, "version": 1}
```

## Dev Tunnels for Bots

**IMPORTANT**: For bot projects, you must start a public devtunnel BEFORE provisioning.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ATK CLI Commands Reference

These commands apply to non-Declarative-Agent ATK projects. For DA lifecycle and action commands, use [declarative-agent-lifecycle.md](declarative-agent-lifecycle.md).

## Package and Validate

```bash
Expand Down Expand Up @@ -45,40 +47,6 @@ atk env add staging
atk env reset --env dev -i false
```

## Adding Actions to Declarative Agents

`atk add action` adds an API action to an existing declarative agent project.

**Required parameters:**
| Option | Description |
|--------|-------------|
| `--api-plugin-type api-spec` | Must be set explicitly (CLI bug: default is invalid) |
| `--openapi-spec-type` | How to specify the API: `enter-url-or-open-local-file` or `search-api` |
| `--openapi-spec-location -a` | OpenAPI spec file path or URL (for `enter-url-or-open-local-file`) |

**Optional parameters:**
| Option | Description |
|--------|-------------|
| `--api-operation -o` | Select specific operation(s) Copilot can interact with |
| `--search-openapi-spec-query` | Search query (when using `search-api`) |
| `--select-openapi-spec` | Select from search results (when using `search-api`) |
| `--manifest-file -t` | App manifest path. Default: `./appPackage/manifest.json` |
| `--folder -f` | Project folder. Default: `./` |

```bash
# Add API action from local file
atk add action --api-plugin-type api-spec --openapi-spec-type enter-url-or-open-local-file -a ./openapi.yaml -i false

# Add API action from URL
atk add action --api-plugin-type api-spec --openapi-spec-type enter-url-or-open-local-file -a https://example.com/openapi.yaml -i false

# Add authentication config
atk add auth-config -i false

# Regenerate action after modifying OpenAPI spec
atk regenerate action -i false
```

## Troubleshooting

```bash
Expand Down Expand Up @@ -109,5 +77,4 @@ lsof -ti:3978 | xargs kill -9
```bash
atk --help
atk new --help
atk add action --help
```
Loading
Loading