teams-app-developer
microsoft/skills
使用 ATK CLI 構建、測試並部署適用於 Teams 和 Copilot 的 Microsoft 365 應用及智慧體,涵蓋專案建立、本地測試、雲部署、故障排除以及 Slack 到 Teams 遷移等子技能。
...展開全部Microsoft 365 代理工具包技能
使用 ATK CLI 構建 Microsoft 365 代理和 Teams 應用。
AI 行為準則
測試策略: 優先推薦代理遊樂場(Agents Playground)(速度更快,無需 M365)。僅當使用者明確要求時才使用 Teams 工作流。
環境變數: 絕不要硬編碼金鑰或編造佔位符值。始終向使用者詢問真實值。
錯誤處理: 仔細閱讀錯誤訊息。檢查
env/.env.local、.localConfigs和atk auth list。常見陷阱:AADSTS7000229→aadApp/create在 YAML 中缺少generateServicePrincipal: true— 新增它並重新配置.localConfigs中缺少TENANT_ID→ SDK 使用錯誤的令牌頒發機構 → Bot Connector 返回 401- 修復身份驗證後 401 仍然存在 → devtunnel URL 可能被列入黑名單 — 建立一個新的隧道
- 請參閱 troubleshoot/troubleshoot.md 以獲取完整的診斷步驟
長時間執行的命令 — 等待完成:
atk new、atk provision、atk deploy可能需要幾分鐘- 始終在執行下一步之前等待完成(超時 120000ms+)
本地服務啟動 — 掛起終端(預期行為):
npm run dev、npm start、python app.py、devtunnel host等命令會掛起 — 程序將無限期執行- 始終作為後臺程序執行(
isBackground=true) — 對這些命令絕不要使用isBackground=false - 不要等待它“完成” — 透過檢查輸出中的“listening on port”或隧道 URL 來驗證啟動
- 如果出現錯誤,讀取日誌、診斷、修復、重啟
- 使用新終端啟動代理遊樂場或開啟 Teams 側載 URL
監控應用日誌: 定期檢查後臺終端輸出以查詢執行時錯誤。如果應用崩潰,讀取錯誤,修復根本原因,然後重啟。
遙測標記: 在執行任何
atkCLI 命令之前,設定會話環境變數,以便所有 CLI 呼叫都標記為技能發起:export ATK_CLI_SKILL=true在會話開始時執行一次。同一終端中的後續
atk命令將繼承該設定。
ATK CLI 設定
atk --version # 必須 > 1.1.5-beta
如果未找到 ATK 或版本過舊:
npm i -g @microsoft/m365agentstoolkit-cli@beta
CLI 全域性選項
| 選項 | 含義 | 建議 |
|---|---|---|
| `-i` | 互動模式 | 在自動化中始終使用 `-i false` 以避免掛起 |
| `-f` | 專案資料夾 | 預設為當前目錄,用於指定自定義資料夾時。在生成新專案時,這是專案資料夾將建立在其下的父資料夾。 |
| `-h` | 命令幫助 | 使用 `atk |
子技能
| 子技能 | 使用場景 | 參考 |
|---|---|---|
| **create-project** | 從模板生成新專案,選擇模板,`atk new` | create-project/create-project.md |
| **test-playground** | 使用代理遊樂場進行本地測試,`agentsplayground`,快速測試 | test-playground/test-playground.md |
| **test-teams** | 在 Teams 上執行,devtunnel,側載,Teams 測試,在 Copilot 中測試 | test-teams/test-teams.md |
| **provision-deploy** | 配置 Azure 資源,部署到雲,`atk provision`,`atk deploy` | provision-deploy/provision-deploy.md |
| **troubleshoot** | 修復錯誤、401、埠衝突、YAML 錯誤、過時的機器人 | troubleshoot/troubleshoot.md |
| **slack-to-teams** | 將 Slack 機器人遷移到 Teams,跨平臺橋接,Block Kit 到自適應卡片 | slack-to-teams/SKILL.md |
強制要求: 在執行任何工作流之前,閱讀相應的子技能文件。
共享參考
- manifest-and-yaml.md — 專案檔案、YAML 配置、環境變數、.localConfigs 流程
- commands.md — ATK CLI 命令:package、validate、share、collaborate
- templates.md — 完整的模板目錄及語言支援
- experts/ — 100 多個微專家檔案:Teams SDK、Slack SDK、跨平臺橋接、部署、AI 模型、安全、語言轉換
- docs/ — 平臺比較指南:UI、訊息傳遞、身份、基礎設施、功能差距
工作流鏈
將使用者意圖匹配到最小的有效工作流。
| 使用者意圖 | 工作流(按順序閱讀) |
|---|---|
| 從頭構建新應用 | create-project → test-playground |
| 在本地測試現有專案 | test-playground(推薦)或 test-teams |
| 部署到 Azure | provision-deploy |
| 修復損壞的機器人 | troubleshoot → 重新測試 |
| 將 Slack 機器人遷移到 Teams | slack-to-teams |
強制要求: 在執行任何 slack-to-teams 工作流之前,先閱讀 slack-to-teams/SKILL.md。該子技能包含一個路由專家系統,擁有 100 多個微專家檔案,用於跨平臺機器人開發。
ATK 專案上下文解析
僅在缺失時解析配置值。如果會話中已知某個值,請重用該值。
步驟 1:檢測 ATK 專案
如果當前資料夾中存在 m365agentstoolkit*.yml,則將其視為 ATK 專案並解析配置。
步驟 2:解析通用配置
解析 m365agentstoolkit*.yml 中引用的變數。常見變數:AZURE_OPENAI_API_KEY、AZURE_OPENAI_ENDPOINT、AZURE_OPENAI_DEPLOYMENT_NAME
步驟 3:收集缺失的值
如果缺少必需的值,僅向使用者詢問缺失的值。
有關完整的配置檔案詳細資訊,請參閱 manifest-and-yaml.md。
---
name: teams-app-developer
description: Builds, tests, and deploys Microsoft 365 apps and agents for Teams and Copilot using the ATK CLI, with sub-skills for project creation, local testing, cloud deployment, troubleshooting, and Slack-to-Teams migration.
---
# Microsoft 365 Agents Toolkit Skill
Build Microsoft 365 agents and Teams apps using the ATK CLI.
## AI Behavior Guidelines
1. **Testing Strategy:** Recommend Agents Playground first (faster, no M365 needed). Use Teams workflow only if user explicitly requests it.
2. **Environment Variables:** NEVER hardcode secrets or make up placeholder values. Always ask users for real values.
3. **Error Handling:** Read error messages carefully. Check `env/.env.local`, `.localConfigs`, and `atk auth list`. Common pitfalls:
- **`AADSTS7000229`** → `aadApp/create` missing `generateServicePrincipal: true` in YAML — add it and re-provision
- **Missing `TENANT_ID`** in `.localConfigs` → SDK uses wrong token authority → 401 from Bot Connector
- **401 persists after auth fix** → devtunnel URL may be blacklisted — create a fresh tunnel
- See [troubleshoot/troubleshoot.md](troubleshoot/troubleshoot.md) for full diagnostic steps
4. **Long-Running Commands — WAIT for completion:**
- `atk new`, `atk provision`, `atk deploy` can take several minutes
- Always wait for completion before running the next step (timeout 120000ms+)
5. **Local Service Startup — Hangs terminal (expected):**
- `npm run dev`, `npm start`, `python app.py`, `devtunnel host`, etc. will hang — the process keeps running indefinitely
- ALWAYS run as a background process (`isBackground=true`) — NEVER use `isBackground=false` for these commands
- Do NOT wait for it to "finish" — verify startup by checking output for "listening on port" or tunnel URL
- If errors appear, read logs, diagnose, fix, restart
- Use a **NEW terminal** to launch Agents Playground or open Teams sideloading URL
6. **Monitor App Logs:** Periodically check background terminal output for runtime errors. If the app crashes, read the error, fix the root cause, and restart.
7. **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.
## ATK CLI Setup
```bash
atk --version # Must be > 1.1.5-beta
```
If ATK is not found or version is too old:
```bash
npm i -g @microsoft/m365agentstoolkit-cli@beta
```
## CLI Global Options
| Option | Meaning | Recommendation |
| ------ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-i` | Interactive mode | Always use `-i false` in automation to avoid hanging |
| `-f` | Project folder | Default to be current directory, used when specifying a custom folder. When scaffolding a new project, this is the parent folder where the project folder will be created under. |
| `-h` | Command help | Use `atk <command> -h` for quick syntax checks |
## Sub-Skills
| Sub-Skill | When to Use | Reference |
| -------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| **create-project** | Scaffold new project from template, choose template, `atk new` | [create-project/create-project.md](create-project/create-project.md) |
| **test-playground** | Test locally with Agents Playground, `agentsplayground`, quick testing | [test-playground/test-playground.md](test-playground/test-playground.md) |
| **test-teams** | Run on Teams, devtunnel, sideload, Teams testing, test in Copilot | [test-teams/test-teams.md](test-teams/test-teams.md) |
| **provision-deploy** | Provision Azure resources, deploy to cloud, `atk provision`, `atk deploy` | [provision-deploy/provision-deploy.md](provision-deploy/provision-deploy.md) |
| **troubleshoot** | Fix errors, 401, port conflicts, YAML errors, stale bots | [troubleshoot/troubleshoot.md](troubleshoot/troubleshoot.md) |
| **slack-to-teams** | Migrate Slack bot to Teams, cross-platform bridging, Block Kit to Adaptive Cards | [slack-to-teams/SKILL.md](slack-to-teams/SKILL.md) |
> **MANDATORY:** Before executing any workflow, read the corresponding sub-skill document.
## Shared References
- [manifest-and-yaml.md](toolkit/manifest-and-yaml.md) — Project files, YAML config, env vars, .localConfigs flow
- [commands.md](toolkit/commands.md) — ATK CLI commands: package, validate, share, collaborate
- [templates.md](toolkit/templates.md) — Complete template catalog with language support
- [experts/](experts/index.md) — 100+ micro-expert files: Teams SDK, Slack SDK, cross-platform bridging, deploy, AI models, security, language conversion
- [docs/](docs/README.md) — Platform comparison guides: UI, messaging, identity, infrastructure, feature gaps
## Workflow Chains
Match user intent to the smallest valid workflow.
| User Intent | Workflow (read in order) |
| ----------------------------- | ------------------------------------------- |
| Build new app from scratch | create-project → test-playground |
| Test existing project locally | test-playground (recommended) or test-teams |
| Deploy to Azure | provision-deploy |
| Fix broken bot | troubleshoot → re-test |
| Migrate Slack bot to Teams | slack-to-teams |
> **MANDATORY:** Before executing any slack-to-teams workflow, read [slack-to-teams/SKILL.md](slack-to-teams/SKILL.md) first. The sub-skill contains a routed expert system with 100+ micro-expert files for cross-platform bot development.
## ATK Project Context Resolution
Resolve config values only when missing. If a value is already known in the session, reuse it.
### Step 1: Detect ATK Project
If `m365agentstoolkit*.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:
AZURE_OPENAI_API_KEY
AZURE_OPENAI_ENDPOINT
AZURE_OPENAI_DEPLOYMENT_NAME
### Step 3: Collect Missing Values
If required values are missing, ask the user for only the missing ones.
Refer to [manifest-and-yaml.md](toolkit/manifest-and-yaml.md) for full config-file details.
所有檔案
147 個檔案安裝 teams-app-developer
將技能檔案下載並解壓至你的 .claude/skills/ 目錄。
下載 ZIP複製儲存庫並將技能檔案複製到您的專案中。
git clone https://github.com/microsoft/skills/tree/main/.github/plugins/microsoft-365-agents-toolkit/skills/teams-app-developer # Copy SKILL.md to your .claude/skills/ directory
複製





首頁
