Skip to content
Merged
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
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ plugins/<plugin-name>/

- **microsoft-365-agents-toolkit** — Toolkit for building M365 Copilot declarative agents. Bundles:
- `install-atk` skill — Install or update the M365 Agents Toolkit CLI and VS Code extension
- `declarative-agent-developer` skill — Scaffolding, JSON manifest authoring, capability configuration, deployment
- `declarative-agent-developer` skill — DA schema and capability guidance, with project lifecycle operations executed through the wiqd CLI
- `teams-app-developer` skill — Build, test, and deploy code-based Teams apps: bots, CEA, tabs, message extensions, Agents Playground, Azure provision/deploy, and Slack-to-Teams migration
- `ui-widget-developer` skill — Build MCP servers with OpenAI Apps SDK widget rendering for Copilot Chat
- `m365-agent-evaluator` skill — Generate, run, and analyze evaluation suites for M365 Copilot declarative agents
Expand Down
14 changes: 12 additions & 2 deletions plugins/microsoft-365-agents-toolkit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ Toolkit for building Microsoft 365 Copilot declarative agents.
/plugin install microsoft-365-agents-toolkit@work-iq
```

## Prerequisites

Declarative Agent project lifecycle operations through the
`declarative-agent-developer` skill require the wiqd CLI. Follow the
[official wiqd installation guide](https://microsoft.github.io/wiqd/getting-started/installation/)
for the current installation instructions.

This requirement applies only to Declarative Agent workflows. Other ATK workflows continue to
use the ATK CLI and do not require wiqd.

## Usage

```
Expand All @@ -20,7 +30,7 @@ Toolkit for building Microsoft 365 Copilot declarative agents.
"Add web search to my agent"

# Deploy
"Deploy my agent with ATK"
"Deploy my declarative agent"

# Create evals
"Create an eval suite for my agent based on it's capabilities."
Expand All @@ -46,7 +56,7 @@ npx -y --package @microsoft/m365-copilot-eval@latest runevals --prompts-file eva
| Skill | What It Does |
|-------|-------------|
| [**install-atk**](./skills/install-atk/SKILL.md) | Install or update the ATK CLI and VS Code extension |
| [**declarative-agent-developer**](./skills/declarative-agent-developer/SKILL.md) | Scaffolding, JSON manifest authoring, capability configuration, security patterns, deployment via ATK CLI |
| [**declarative-agent-developer**](./skills/declarative-agent-developer/SKILL.md) | DA schema, capability, and security guidance with lifecycle operations executed through the wiqd CLI |
| [**ui-widget-developer**](./skills/ui-widget-developer/SKILL.md) | Build MCP servers with OpenAI Apps SDK widget rendering for Copilot Chat |
| [**m365-agent-evaluator**](./skills/m365-agent-evaluator/SKILL.md) | Generate, run, and analyze evaluation suites for M365 Copilot declarative agents |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: declarative-agent-developer
description: >
Create, build, deploy, and localize declarative agents for M365 Copilot and Teams.
Use the wiqd CLI for all declarative-agent lifecycle operations; never invoke the ATK CLI directly.
USE THIS SKILL for ANY task involving a declarative agent — including localization,
scaffolding, editing manifests, adding capabilities, and deploying.
Localization requires tokenized manifests and language files that only this skill knows how to produce.
Expand All @@ -15,22 +16,33 @@ description: >

# M365 Agent Developer

## Telemetry Tagging
## wiqd CLI

Before running any `atk` CLI commands, set the session environment variable so all CLI invocations are tagged as skill-initiated:
```bash
export ATK_CLI_SKILL=true
```
Run this once at the start of the session. All subsequent `atk` commands in the same terminal will inherit it.
Use `wiqd` as the execution layer for every declarative-agent lifecycle operation. Keep using
this skill's references for manifest schemas, capability rules, plugins, authentication,
localization, and instruction design.

Immediately before the first lifecycle command in a task, run `wiqd --version`. If it is
unavailable, stop and tell the user that wiqd is required. Direct them to the
[official wiqd installation guide](https://microsoft.github.io/wiqd/getting-started/installation/) for the current installation guidance;
do not duplicate platform-specific installer commands here.

Do not fall back to direct `atk` commands.

Reference-only requests that do not execute lifecycle commands can use this skill's schema,
capability, plugin, authentication, localization, and instruction guidance without requiring
wiqd to be installed. If the request does not inspect or modify a project and does not run a
project command, answer it directly from the relevant references and skip the workspace check
below.

## ⛔ Workspace Check — MANDATORY FIRST STEP
## ⛔ Workspace Check — MANDATORY FIRST STEP FOR PROJECT OPERATIONS

**Before doing ANYTHING, check the workspace files to fingerprint the project:**
**Before inspecting, modifying, validating, packaging, provisioning, sharing, or publishing a
project, check the workspace files to fingerprint it:**

1. Run `npx -y --package @microsoft/m365agentstoolkit-cli atk --version` to confirm ATK CLI is installed. If not found → **Stop.** Tell the user to install ATK.
2. Check for `m365agents.yml` or `teamsApp.yml` at the project root.
3. Check for `appPackage/declarativeAgent.json`.
4. Check for non-agent indicators (`package.json` with express/react/next, `src/index.js`, `app.py`, etc.)
1. Check for `m365agents.yml` or `teamsApp.yml` at the project root.
2. Check for `appPackage/declarativeAgent.json`.
3. Check for non-agent indicators (`package.json` with express/react/next, `src/index.js`, `app.py`, etc.)

**Then follow the decision gate:**

Expand All @@ -49,11 +61,11 @@ Run this once at the start of the session. All subsequent `atk` commands in the

**These rules override ALL other instructions.** If any of these apply, you MUST stop immediately.

1. **NEVER create `declarativeAgent.json` yourself.** If the manifest is missing and the user asked to edit/modify/deploy, respond with text only: explain the manifest is missing, suggest `npx -y --package @microsoft/m365agentstoolkit-cli atk new` or starting from scratch. Do NOT create the file, do NOT create `appPackage/`, do NOT "help" by scaffolding implicitly.
1. **NEVER create `declarativeAgent.json` yourself.** If the manifest is missing and the user asked to edit/modify/deploy, respond with text only: explain the manifest is missing, suggest `wiqd agent create` or starting from scratch. Do NOT create the file, do NOT create `appPackage/`, do NOT "help" by scaffolding implicitly.

2. **NEVER create files in a non-agent project.** If the workspace is an Express/React/Django/etc. app without `appPackage/`, your response must be text-only. Do NOT create any files, do NOT run any commands.

3. **NEVER deploy when errors exist.** If the agent manifest has errors, STOP. Do NOT run `npx -y --package @microsoft/m365agentstoolkit-cli atk provision` — not "to test", not "to demonstrate the error", not "to see what happens". Report the errors and ask the user how to proceed.
3. **NEVER deploy when errors exist.** If the agent manifest has errors, STOP. Do NOT run `wiqd agent provision` — not "to test", not "to demonstrate the error", not "to see what happens". Report the errors and ask the user how to proceed.

### 🔍 Detect → Inform → Ask (Error-Handling Protocol)

Expand Down Expand Up @@ -88,37 +100,31 @@ When you encounter ANY problem (missing files, malformed JSON, validation errors

---

## ATK CLI Setup

Before running any ATK commands, check if the ATK CLI is available by running `npx -y --package @microsoft/m365agentstoolkit-cli atk --version`. If not found, **STOP and tell the user** — do NOT attempt to install it yourself.

All commands use the `npx -y --package @microsoft/m365agentstoolkit-cli atk` prefix (e.g., `npx -y --package @microsoft/m365agentstoolkit-cli atk provision --env local`).

---

## Critical Rules

### 1. Deploy After EVERY Edit
### 1. Validate After Edits; Provision Only on Request

After ANY change to files in `appPackage/`, you MUST deploy and show the test link before responding:
After any change to files in `appPackage/`, validate the project before responding:

```bash
npx -y --package @microsoft/m365agentstoolkit-cli atk provision --env local --interactive false
wiqd agent validate
```

Then read `M365_TITLE_ID` from `env/.env.local` and **ALWAYS** present the review UX:
Provision only when the user explicitly asks to deploy, provision, test, share, or publish. After
a successful provision, use the deep link returned by wiqd. If it is unavailable, read
`M365_TITLE_ID` from the selected environment file and construct:

```
✅ Agent deployed successfully!

🚀 Test Your Agent in M365 Copilot:
🔗 https://m365.cloud.microsoft/chat/?titleId={M365_TITLE_ID}
🔗 https://m365.cloud.microsoft/chat?titleId={M365_TITLE_ID}
```

**⛔ Never respond without this link.** If you deployed, the test link MUST appear in your response. This is not optional — it is how the user tests their agent.
If you provisioned, include the test link in your response.

- If the manifest has errors → **STOP. Fix errors. Do NOT deploy.**
- Exception: user explicitly asks you not to deploy
- Do not provision merely because files changed.

### 2. Never Invent Content or Create Missing Files

Expand All @@ -138,18 +144,18 @@ Key version gates:
- `ScenarioModels`, `behavior_overrides`, `disclaimer` → **v1.4+**
- `Dataverse`, `TeamsMessages`, `Email`, `People` → **v1.3+**

### 4. Use `npx -y --package @microsoft/m365agentstoolkit-cli atk add action` for API Plugins — NEVER Create Plugin Files Manually
### 4. Use `wiqd agent add action` for API Plugins — NEVER Create Plugin Files Manually

You are **forbidden** from manually creating `ai-plugin.json`, OpenAPI specs, adaptive cards, or editing the `actions` array. Use the CLI:

```bash
# ⛔ Always list ALL operations in a single call — NEVER run separate calls per operation
npx -y --package @microsoft/m365agentstoolkit-cli atk add action --api-plugin-type api-spec --openapi-spec-location URL --api-operation "GET /path,POST /path,PATCH /path/{id},DELETE /path/{id}" -i false
wiqd agent add action --openapi-spec URL --operations "GET /path,POST /path,PATCH /path/{id},DELETE /path/{id}"
```

Run a **single** `npx -y --package @microsoft/m365agentstoolkit-cli atk add action` call per OpenAPI spec, listing **all** operations as a comma-separated list in `--api-operation`. Never run separate `npx -y --package @microsoft/m365agentstoolkit-cli atk add action` calls for different operations from the same spec — this creates multiple plugins instead of one. If `npx -y --package @microsoft/m365agentstoolkit-cli atk add action` fails, report the error; do NOT fall back to manual creation.
Run a **single** `wiqd agent add action` call per OpenAPI spec, listing **all** operations as a comma-separated list in `--operations`. Never run separate `wiqd agent add action` calls for different operations from the same spec — this creates multiple plugins instead of one. If `wiqd agent add action` fails, report the error; do NOT fall back to manual creation.

> **Exception:** MCP servers are not supported by `npx -y --package @microsoft/m365agentstoolkit-cli atk add action`. Use the [MCP Plugin workflow](references/mcp-plugin.md) instead.
> MCP servers use the same command with `--mcp-server-url`; follow the [MCP Plugin workflow](references/mcp-plugin.md).

### 5. MCP Server Integration

Expand Down Expand Up @@ -178,7 +184,7 @@ Always update the app name and description to something meaningful. Never leave
- **[Best Practices](references/best-practices.md)** — Security, performance, testing, compliance
- **[Conversation Design](references/conversation-design.md)** — Authoring instructions and conversation starters from scratch
- **[Instruction Review](references/instruction-review.md)** — Auditing, diagnosing, and improving existing instructions; anti-pattern detection; before/after rewrites
- **[Deployment](references/deployment.md)** — ATK CLI workflows, environments, CI/CD
- **[Deployment](references/deployment.md)** — wiqd CLI workflows, environments, CI/CD
- **[Localization](references/localization.md)** — Multi-language support, tokenized manifests, language files
- **[Workspace Gates](references/workspace-gates.md)** — Detailed gate rules, examples, anti-patterns

Expand Down
Loading