declarative-agent-developer
microsoft/skills
M365 Copilot および Teams 用の宣言型エージェントを作成、構築、デプロイ、ローカライズします。これには、スケルトンの生成、マニフェストの編集、機能の追加、およびローカライズが含まれます。
...すべて拡張しますM365 エージェント開発者
テレメトリタグ付け
任意の atk CLI コマンドを実行する前に、セッション環境変数を設定し、すべての CLI 呼び出しがスキル起因としてタグ付けされるようにしてください。
export ATK_CLI_SKILL=true
セッションの開始時にこれを実行してください。同じターミナル内の後続の atk コマンドはすべてこれを継承します。
⛔ ワークスペースチェック — 必須の最初のステップ
何をする前にでも、プロジェクトの指紋を識別するためにワークスペースファイルを確認してください:
npx -y --package @microsoft/m365agentstoolkit-cli atk --versionを実行して、ATK CLI がインストールされていることを確認します。見つからない場合 → 停止。ユーザーに ATK のインストールを指示してください。- プロジェクトのルートに
m365agents.ymlまたはteamsApp.ymlがあるか確認します。 appPackage/declarativeAgent.jsonがあるか確認します。- エージェント以外のインジケーター(express/react/next を含む
package.json、src/index.js、app.pyなど)があるか確認します。
その後、意思決定ゲートに従ってください:
| 条件 | ゲート | アクション |
|---|---|---|
| 非エージェントプロジェクトファイル、`appPackage/` なし | **拒否** | テキストのみの応答。ファイルなし、コマンドなし。 |
| マニフェストなし、ユーザーが編集/デプロイを希望 | **拒否** | テキストのみの応答。マニフェストが欠落していることを説明。 |
| マニフェストなし、ユーザーが新規プロジェクトを希望 | **スケフォールディング** | → スケフォールディングワークフロー |
| エラーを含むマニフェストが存在 | **修正** | 検出 → 通知 → 確認(以下参照)。デプロイしてはいけません。 |
| 有効なプロジェクト、ユーザーが動作の問題を報告 | **レビュー** | → 指示レビュー — 完全な5フェーズのレビューワークフローを実行 |
| 有効なエージェントプロジェクト | **編集** | → 編集ワークフロー |
詳細なゲートルール、例、アンチパターン: ワークスペースゲート
🚫 硬性拒否ルール — 例外なし
これらのルールは他のすべての指示を上書きします。 これらのいずれかが適用される場合、直ちに停止する必要があります。
declarativeAgent.jsonを自ら作成してはいけません。 マニフェストが欠落しており、ユーザーが編集/修正/デプロイを依頼した場合、テキストのみの応答で返してください:マニフェストが欠落していることを説明し、npx -y --package @microsoft/m365agentstoolkit-cli atk newまたはゼロからの開始を提案してください。ファイルを作成しないでください、appPackage/を作成しないでください、スケフォールディングを暗黙的に行うことで「援助」しないでください。- 非エージェントプロジェクトにファイルを作成してはいけません。 ワークスペースが
appPackage/を持たない Express/React/Django などのアプリケーションの場合、応答はテキストのみに限定されます。ファイルを作成しないでください、コマンドを実行しないでください。 - エラーが存在する際にデプロイしてはいけません。 エージェントマニフェストにエラーがある場合、停止してください。
npx -y --package @microsoft/m365agentstoolkit-cli atk provisionを実行しないでください — 「テストするため」でも、「エラーを示すため」でも、「結果を見るため」でもありません。エラーを報告し、ユーザーに次の手順を問い合わせてください。
🔍 検出 → 通知 → 確認(エラー処理プロトコル)
任意の問題(ファイルの欠落、不正な JSON、検証エラー、互換性のない機能)に遭遇した場合、この順序でこのシーケンスに従う必要があります。
- 検出 — 特定の問題を特定します。JSON の問題の場合、ファイルの解析を試みて構文エラーを報告します。欠落フィールドの場合、マニフェストをスキーマに対してチェックします。
- 通知 — 任意のアクションを取る前にユーザーに伝えます。何が間違っているかを正確に記述します(「declarativeAgent.json に不正な JSON があります:12行目のカンマが不足、18行目の閉じられていない配列」)。
- 確認 — 変更を行う前にユーザーの応答を待ちます。問題を黙って修正したり、自動補正したり、問題を回避したりしないでください。
このプロトコルは以下に適用されます:
declarativeAgent.jsonの欠落 → 検出(ファイルが見つからない)→ 通知(「マニフェストが見つかりません」)→ 確認(「新規エージェントを作成しますか?」)- 不正な JSON → 検出(解析エラー)→ 通知(特定の構文問題をリストアップ)→ 確認(「これらの構文エラーを修正しますか?」)
- 検証エラー → 検出(解析およびマニフェストのチェック)→ 通知(すべてのエラーをリストアップ)→ 確認(「これらをどのように修正しますか?」)
- バージョンの互換性なし → 検出(機能には新しいバージョンが必要)→ 通知(「この機能には v1.6 が必要ですが、あなたのエージェントは v1.4 です」)→ 確認(「アップグレードしますか?」)
フェーズルーティング
| シナリオ | ワークフロー参照 |
|---|---|
| ゼロから新規プロジェクトを作成 | スケフォールディングワークフロー |
| 既存の `.json` マニフェストを扱う | 編集ワークフロー |
| API プラグインの追加 | API プラグイン |
| MCP サーバーの追加 | MCP プラグイン |
| MCP または API プラグインへの OAuth の追加 | 認証 |
| 既存のエージェント指示のレビューまたは改善 | 指示レビュー |
| ユーザーがエージェントが汎用的または誤った回答を生成すると報告 | 指示レビュー |
| エージェントを複数の言語にローカライズ | ローカライゼーション |
| すでにローカライズされたエージェントに新しい言語を追加 | ローカライゼーション |
| エージェント指示の作成 | 会話設計 |
ATK CLI セットアップ
ATK コマンドを実行する前に、npx -y --package @microsoft/m365agentstoolkit-cli atk --version を実行して ATK CLI が利用可能か確認してください。見つからない場合、停止してユーザーに伝えてください — 自らインストールを試みないでください。
すべてのコマンドは npx -y --package @microsoft/m365agentstoolkit-cli atk プレフィックスを使用します(例:npx -y --package @microsoft/m365agentstoolkit-cli atk provision --env local)。
重要ルール
1. 編集のたびにデプロイ
appPackage/ 内のファイルへの変更後、応答する前にデプロイしてテストリンクを表示する必要があります:
npx -y --package @microsoft/m365agentstoolkit-cli atk provision --env local --interactive false
その後、env/.env.local から M365_TITLE_ID を読み取り、常にレビュー UX を提示してください:
✅ エージェントのデプロイに成功しました!
🚀 M365 Copilot でエージェントをテスト:
🔗 https://m365.cloud.microsoft/chat/?titleId={M365_TITLE_ID}
⛔ このリンクなしで応答しないでください。 デプロイした場合、テストリンクは応答に必ず表示されなければなりません。これは任意ではありません — これがユーザーがエージェントをテストする方法です。
- マニフェストにエラーがある場合 → 停止。エラーを修正。デプロイしない。
- 例外:ユーザーが明示的にデプロイしないよう依頼した場合
2. コンテンツの発明または欠落ファイルの作成を禁止
- プレースホルダー名、説明、または指示を発明しないでください
declarativeAgent.jsonまたはappPackage/が存在しない場合、作成しないでください — これは「作成による援助」ではなく「拒否」シナリオです- 必須フィールドが欠落している場合、ギャップを報告し、ユーザーに問い合わせてください
- JSON が不正な場合、検出 → 通知 → 確認に従う:まずファイルを解析し、ユーザーに壊れている箇所を伝え、修正前に確認してください。外科的な編集(書き換えではない)を使用してください
- ⛔ 自動化によって入力される環境変数のプレースホルダー値を設定しないでください(例:
<prefix>_MCP_AUTH_ID</prefix>、TEAMS_APP_ID)。空のままにしてください(VAR_NAME=)。プレースホルダーは実際の値として扱われ、プロビジョニングによって上書きされません。
3. スキーマバージョンの互換性
任意の機能を追加する前に、declarativeAgent.json の version フィールドを読み取り、スキーマ機能マトリックスを確認してください。そのバージョンでその機能がサポートされていない場合、拒否し、アップグレードを提案してください。
主要なバージョンゲート:
sensitivity_label、worker_agents、EmbeddedKnowledge→ v1.6 のみMeetings→ v1.5 以上ScenarioModels、behavior_overrides、disclaimer→ v1.4 以上Dataverse、TeamsMessages、Email、People→ v1.3 以上
4. API プラグインには npx -y --package @microsoft/m365agentstoolkit-cli atk add action を使用 — プラグインファイルの手動作成を禁止
ai-plugin.json、OpenAPI 仕様、アダプティブカード、または actions 配列の編集を手動で作成することは禁止されています。CLI を使用してください:
# ⛔ 単一の呼び出しですべての操作をリストしてください — 操作ごとに個別の呼び出しを実行しないでください
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
OpenAPI 仕様ごとに単一の npx -y --package @microsoft/m365agentstoolkit-cli atk add action 呼び出しを実行し、--api-operation ですべての操作をカンマ区切りリストとしてリストしてください。同じ仕様からの異なる操作に対して個別の npx -y --package @microsoft/m365agentstoolkit-cli atk add action 呼び出しを実行しないでください — これにより複数のプラグインが作成され、1つになりません。npx -y --package @microsoft/m365agentstoolkit-cli atk add action が失敗した場合、エラーを報告してください;手動作成にフォールバックしないでください。
例外: MCP サーバーは
npx -y --package @microsoft/m365agentstoolkit-cli atk add actionではサポートされていません。代わりに MCP プラグインワークフローを使用してください。
5. MCP サーバー統合
ユーザーが MCP サーバー URL に言及した場合、MCP プラグインワークフローに従ってください。MCP プロトコルハンドシェイク(初期化 → 通知/初期化済み → tools/list)を介してツールを発見する必要があります — ツール名/説明を捏造しないでください。認証済み MCP サーバーの場合、認証ガイドに従って OAuth を構成してください。
6. 変更後に常に指示とスターターを更新
機能やプラグインを追加しても指示を更新しないのは不完全です。任意の変更後:
- 変更された指示を更新して、新しい/変更された機能を記述します — 各データソースには、指示レビューの品質基準に従って、明確な意図カバレッジ(いつ、なぜ使用するのか)が必要です。組み込み機能には正確な名前は必要ありません;アクション/プラグインには名前を付ける必要があります。
- 指示にツール名、説明、またはパラメータをリストしないでください — これらはすでにプラグインメタデータ(
ai-plugin.json、MCP マニフェスト、機能設定)に含まれています。指示には意思決定論理のみを含める必要があります:各ツールの使用タイミング、チェーンルール、および障害処理。 - 8,000文字の指示制限内に収まるようにしてください — 制限に近い場合、まずツール説明を削除してください
- 追加された各機能/プラグインごとに少なくとも1つの会話スターターを追加してください
- 削除された機能を参照するスターターを削除してください
- 更新された指示に対して診断チェックリストを実行して、品質を確認してください
7. アプリ名要件
常に意味のあるアプリ名と説明に更新してください。「My Agent」のようなデフォルトをそのままにしないでください。
参照
共通
- 認証 — OAuth 発見、資格情報、oauth/register ライフサイクル、OAuthPluginVault
- ベストプラクティス — セキュリティ、パフォーマンス、テスト、コンプライアンス
- 会話設計 — 指示および会話スターターのゼロからの作成
- 指示レビュー — 既存の指示の監査、診断、改善;アンチパターンの検出;修正前後の書き換え
- デプロイメント — ATK CLI ワークフロー、環境、CI/CD
- ローカライゼーション — 多言語サポート、トークン化されたマニフェスト、言語ファイル
- ワークスペースゲート — 詳細なゲートルール、例、アンチパターン
スケフォールディング
- スケフォールディングワークフロー — ステップバイステップのスケフォールディング指示、命名ルール、エラー処理
JSON 開発
- 編集ワークフロー — ステップバイステップの JSON 開発指示
- スキーマ — エージェントマニフェストの公式 JSON スキーマ
- API プラグイン — JSON エージェントの OpenAPI 統合
- MCP プラグイン — RemoteMCPServer、OAuth、レスポンスセマンティクス、ロゴ処理との MCP サーバー統合
- 例 — JSON マニフェストの例
---
name: declarative-agent-developer
description: Create, build, deploy, and localize declarative agents for M365 Copilot and Teams, including scaffolding, editing manifests, adding capabilities, and localization.
---
# M365 Agent Developer
## Telemetry Tagging
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.
## ⛔ Workspace Check — MANDATORY FIRST STEP
**Before doing ANYTHING, check the workspace files to fingerprint the project:**
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.)
**Then follow the decision gate:**
| Condition | Gate | Action |
|-----------|------|--------|
| Non-agent project files, no `appPackage/` | **Reject** | Text-only response. No files, no commands. |
| No manifest, user wants to edit/deploy | **Reject** | Text-only response. Explain manifest is missing. |
| No manifest, user wants new project | **Scaffold** | → [Scaffolding Workflow](references/scaffolding-workflow.md) |
| Manifest exists with errors | **Fix** | Detect → Inform → Ask (see below). Do NOT deploy. |
| Valid project, user reports behavior issues | **Review** | → [Instruction Review](references/instruction-review.md) — run the full 5-phase review workflow |
| Valid agent project | **Edit** | → [Editing Workflow](references/editing-workflow.md) |
> **Detailed gate rules, examples, and anti-patterns:** [Workspace Gates](references/workspace-gates.md)
### 🚫 HARD REJECTION RULES — No Exceptions
**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.
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.
### 🔍 Detect → Inform → Ask (Error-Handling Protocol)
When you encounter ANY problem (missing files, malformed JSON, validation errors, incompatible features), you MUST follow this sequence **in order**:
1. **Detect** — Identify the specific problem. For JSON issues, attempt to parse the file and report syntax errors. For missing fields, check the manifest against the [Schema](references/schema.md).
2. **Inform** — Tell the user BEFORE taking any action. Describe exactly what is wrong ("declarativeAgent.json has malformed JSON: missing comma on line 12, unclosed array on line 18").
3. **Ask** — Wait for the user's response before making changes. Do NOT silently fix, auto-correct, or work around the problem.
**This protocol applies to:**
- Missing `declarativeAgent.json` → Detect (file not found) → Inform ("no manifest found") → Ask ("would you like to create a new agent?")
- Malformed JSON → Detect (parse errors) → Inform (list specific syntax issues) → Ask ("should I fix these syntax errors?")
- Validation errors → Detect (parse and check manifest) → Inform (list all errors) → Ask ("how would you like to fix these?")
- Version incompatibility → Detect (feature requires newer version) → Inform ("this feature requires v1.6, your agent is v1.4") → Ask ("should I upgrade?")
---
## Phase Routing
| Scenario | Workflow Reference |
|----------|-------------------|
| Creating a NEW project from scratch | [Scaffolding Workflow](references/scaffolding-workflow.md) |
| Working with existing `.json` manifests | [Editing Workflow](references/editing-workflow.md) |
| Adding an API plugin | [API Plugins](references/api-plugins.md) |
| Adding an MCP server | [MCP Plugin](references/mcp-plugin.md) |
| Adding OAuth to an MCP or API plugin | [Authentication](references/authentication.md) |
| Reviewing or improving existing agent instructions | [Instruction Review](references/instruction-review.md) |
| User reports agent gives generic/wrong answers | [Instruction Review](references/instruction-review.md) |
| Localizing an agent into multiple languages | [Localization](references/localization.md) |
| Adding a new language to an already-localized agent | [Localization](references/localization.md) |
| Writing agent instructions | [Conversation Design](references/conversation-design.md) |
---
## 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
After ANY change to files in `appPackage/`, you MUST deploy and show the test link before responding:
```bash
npx -y --package @microsoft/m365agentstoolkit-cli atk provision --env local --interactive false
```
Then read `M365_TITLE_ID` from `env/.env.local` and **ALWAYS** present the review UX:
```
✅ Agent deployed successfully!
🚀 Test Your Agent in M365 Copilot:
🔗 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 the manifest has errors → **STOP. Fix errors. Do NOT deploy.**
- Exception: user explicitly asks you not to deploy
### 2. Never Invent Content or Create Missing Files
- Do NOT invent placeholder names, descriptions, or instructions
- Do NOT create `declarativeAgent.json` or `appPackage/` if they don't exist — this is a REJECT scenario, not a "help by creating" scenario
- If required fields are missing, report the gaps, and ASK the user
- If JSON is malformed, follow Detect → Inform → Ask: parse the file first, tell the user what's broken, then ask before fixing. Use surgical edits (not rewrites)
- **⛔ NEVER set placeholder values for environment variables** that are populated by automation (e.g., `<PREFIX>_MCP_AUTH_ID`, `TEAMS_APP_ID`). Leave them empty (`VAR_NAME=`). Placeholders will be treated as real values and will NOT be overwritten by provisioning.
### 3. Schema Version Compatibility
Before adding ANY feature, read the `version` field in `declarativeAgent.json` and check the [Schema](references/schema.md) feature matrix. If the feature isn't supported in that version, **refuse** and offer to upgrade.
Key version gates:
- `sensitivity_label`, `worker_agents`, `EmbeddedKnowledge` → **v1.6 only**
- `Meetings` → **v1.5+**
- `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
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
```
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.
> **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.
### 5. MCP Server Integration
When the user mentions an MCP server URL, follow the [MCP Plugin workflow](references/mcp-plugin.md). You MUST discover tools via the MCP protocol handshake (initialize → notifications/initialized → tools/list) — **NEVER fabricate tool names/descriptions**. For authenticated MCP servers, follow the [authentication guide](references/authentication.md) to configure OAuth.
### 6. Always Update Instructions & Starters After Changes
Adding a capability or plugin without updating instructions is incomplete. After ANY change:
1. Update instructions to describe the new/changed functionality — every data source should have clear intent coverage (WHEN and WHY to use it) per the [Instruction Review](references/instruction-review.md) quality bar. Built-in capabilities don't need exact names; actions/plugins should be named.
2. **Do NOT list tool names, descriptions, or parameters in instructions** — these are already in the plugin metadata (`ai-plugin.json`, MCP manifests, capability config). Instructions should contain decision logic only: WHEN to use each tool, chaining rules, and failure handling.
3. **Stay within the 8,000-character instruction limit** — if close to the limit, cut tool descriptions first
4. Add at least 1 conversation starter per added capability/plugin
5. Remove starters that reference removed capabilities
6. Run the [Diagnostic Checklist](references/instruction-review.md) against the updated instructions to verify quality
### 7. App Name Requirement
Always update the app name and description to something meaningful. Never leave defaults like "My Agent".
---
## References
### Shared
- **[Authentication](references/authentication.md)** — OAuth discovery, credentials, oauth/register lifecycle, OAuthPluginVault
- **[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
- **[Localization](references/localization.md)** — Multi-language support, tokenized manifests, language files
- **[Workspace Gates](references/workspace-gates.md)** — Detailed gate rules, examples, anti-patterns
### Scaffolding
- **[Scaffolding Workflow](references/scaffolding-workflow.md)** — Step-by-step scaffolding instructions, naming rules, error handling
### JSON Development
- **[Editing Workflow](references/editing-workflow.md)** — Step-by-step JSON development instructions
- **[Schema](references/schema.md)** — Official JSON schema for agent manifests
- **[API Plugins](references/api-plugins.md)** — OpenAPI integration for JSON agents
- **[MCP Plugin](references/mcp-plugin.md)** — MCP server integration with RemoteMCPServer, OAuth, response semantics, logo handling
- **[Examples](references/examples.md)** — JSON manifest examples
すべてのファイル
0件のファイルdeclarative-agent-developerをインストール
スキルファイルをダウンロードして、.claude/skills/ ディレクトリに展開してください。
ZIPをダウンロードリポジトリをクローンし、スキルファイルをプロジェクトにコピーしてください。
git clone https://github.com/microsoft/skills/tree/main/.github/plugins/microsoft-365-agents-toolkit/skills/declarative-agent-developer # Copy SKILL.md to your .claude/skills/ directory
コピー





家
