Teams App Developer
MicrosoftOfficialPublished by Microsoft
- Skill
- Tool integration
- Software development
- MIT
- Medium risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The teams-app-developer skill provides a structured framework for managing the lifecycle of Microsoft 365 agents and Teams applications. It leverages the ATK CLI to handle project scaffolding, local testing via the Agents Playground, cloud provisioning on Azure, and troubleshooting. The skill includes specialized guidance for migrating Slack bots to Teams, including converting Block Kit UI to Adaptive Cards, and provides access to an extensive library of micro-expert documentation for cross-platform development.
What it does
- Scaffolds new Microsoft 365 agents and Teams applications from templates.
- Facilitates local testing using the Agents Playground or Teams-specific environments.
- Automates Azure resource provisioning and cloud deployment workflows.
- Provides diagnostic procedures for common authentication and configuration errors.
- Supports migration of Slack bots to the Teams platform.
- Manages project configuration and environment variables for ATK-based projects.
When to use it
- When starting a new Teams app, bot, or Declarative Agent project.
- When you need to test an agent locally before deploying to the cloud.
- When migrating existing Slack bots to the Microsoft Teams ecosystem.
- When troubleshooting deployment or authentication issues in a Teams project.
- When you need to provision Azure infrastructure for a Teams application.
Advantages
- Streamlines the development lifecycle with standardized CLI commands.
- Reduces development time by offering a local testing playground.
- Provides expert-level guidance for complex cross-platform migrations.
- Ensures consistent configuration management across development environments.
- Includes robust error-handling protocols for common platform-specific pitfalls.
Usage examples
- “Create a new Teams bot project using the default template.”
- The agent will initialize a new project folder, configure the necessary YAML files, and guide you through the initial setup using the ATK CLI.
- “How do I migrate my Slack bot to Microsoft Teams?”
- The agent will initiate the slack-to-teams workflow, providing access to cross-platform bridging experts and guidance on converting UI components.
- “My Teams bot is returning a 401 error, how do I fix it?”
- The agent will trigger the troubleshooting workflow, checking your environment variables, tunnel status, and authentication configuration.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/microsoft/teams-app-developer/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip teams-app-developer.zip -d .agents/skills
Documentation by Microsoft
Microsoft 365 Agents Toolkit Skill
Build Microsoft 365 agents and Teams apps using the ATK CLI.
AI Behavior Guidelines
Testing Strategy: Recommend Agents Playground first (faster, no M365 needed). Use Teams workflow only if user explicitly requests it.
Environment Variables: NEVER hardcode secrets or make up placeholder values. Always ask users for real values.
Error Handling: Read error messages carefully. Check
env/.env.local,.localConfigs, andatk auth list. Common pitfalls:AADSTS7000229→aadApp/createmissinggenerateServicePrincipal: truein YAML — add it and re-provisionMissing
TENANT_IDin.localConfigs→ SDK uses wrong token authority → 401 from Bot Connector401 persists after auth fix → devtunnel URL may be blacklisted — create a fresh tunnel
See troubleshoot/troubleshoot.md for full diagnostic steps
Long-Running Commands — WAIT for completion:
atk new,atk provision,atk deploycan take several minutesAlways wait for completion before running the next step (timeout 120000ms+)
Local Service Startup — Hangs terminal (expected):
npm run dev,npm start,python app.py,devtunnel host, etc. will hang — the process keeps running indefinitelyALWAYS run as a background process (
isBackground=true) — NEVER useisBackground=falsefor these commandsDo 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
Monitor App Logs: Periodically check background terminal output for runtime errors. If the app crashes, read the error, fix the root cause, and restart.
Telemetry Tagging: Before running any
atkCLI commands, set the session environment variable so all CLI invocations are tagged as skill-initiated:export ATK_CLI_SKILL=trueRun this once at the start of the session. All subsequent
atkcommands in the same terminal will inherit it.
ATK CLI Setup
atk --version # Must be > 1.1.5-betaIf ATK is not found or version is too old:
npm i -g @microsoft/m365agentstoolkit-cli@betaCLI 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 |
| test-playground | Test locally with Agents Playground, agentsplayground, quick testing | test-playground/test-playground.md |
| test-teams | Run on Teams, devtunnel, sideload, Teams testing, test in Copilot | test-teams/test-teams.md |
| provision-deploy | Provision Azure resources, deploy to cloud, atk provision, atk deploy | provision-deploy/provision-deploy.md |
| troubleshoot | Fix errors, 401, port conflicts, YAML errors, stale bots | troubleshoot/troubleshoot.md |
| slack-to-teams | Migrate Slack bot to Teams, cross-platform bridging, Block Kit to Adaptive Cards | slack-to-teams/SKILL.md |
MANDATORY: Before executing any workflow, read the corresponding sub-skill document.
Shared References
manifest-and-yaml.md — Project files, YAML config, env vars, .localConfigs flow
commands.md — ATK CLI commands: package, validate, share, collaborate
templates.md — Complete template catalog with language support
experts/ — 100+ micro-expert files: Teams SDK, Slack SDK, cross-platform bridging, deploy, AI models, security, language conversion
docs/ — 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 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 for full config-file details.
Files
- ATTRIBUTION.mdAdded by AutoGineer906 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md7.6 KiB
- create-project/create-project.md8.1 KiB
- docs/README.md2.8 KiB
- docs/advanced-features.md7.0 KiB
- docs/feature-gaps.md46.3 KiB
- docs/files-and-links.md4.2 KiB
- docs/identity-and-auth.md4.3 KiB
- docs/infrastructure.md6.7 KiB
- docs/interactive-responses.md4.4 KiB
- docs/messaging-and-commands.md4.5 KiB
- docs/middleware-and-handlers.md4.4 KiB
- docs/ui-components.md6.9 KiB
- docs/workflows.md14.4 KiB
- experts/README.md8.6 KiB
- experts/_expert-ts.md2.2 KiB
- experts/analyzer.md14.0 KiB
- experts/bridge/app-distribution-packaging-ts.md14.2 KiB
- experts/bridge/channel-ops-graph-ts.md15.4 KiB
- experts/bridge/commands-slash-text-ts.md18.5 KiB
- experts/bridge/cross-platform-advisor-ts.md36.4 KiB
- experts/bridge/cross-platform-architecture-ts.md8.3 KiB
- experts/bridge/events-activities-ts.md22.4 KiB
- experts/bridge/files-upload-download-ts.md17.2 KiB
- experts/bridge/identity-oauth-bridge-ts.md19.8 KiB
- experts/bridge/index.md13.0 KiB
- experts/bridge/infra-compute-ts.md14.6 KiB
- experts/bridge/infra-observability-ts.md14.0 KiB
- experts/bridge/infra-secrets-config-ts.md13.2 KiB
- experts/bridge/infra-storage-ts.md14.3 KiB
- experts/bridge/interactive-responses-ts.md19.6 KiB
- experts/bridge/link-unfurl-preview-ts.md17.1 KiB
- experts/bridge/middleware-handlers-ts.md15.4 KiB
- experts/bridge/python-cross-platform.md9.3 KiB
- experts/bridge/rate-limiting-resilience-ts.md17.6 KiB
- experts/bridge/rest-only-integration-ts.md8.4 KiB
- experts/bridge/scheduling-deferred-send-ts.md17.8 KiB
- experts/bridge/shortcuts-extensions-ts.md17.5 KiB
- experts/bridge/transport-socketmode-https-ts.md14.3 KiB
- experts/bridge/ui-app-home-personal-tab-ts.md14.5 KiB
- experts/bridge/ui-block-kit-adaptive-cards-ts.md21.5 KiB
- experts/bridge/ui-legacy-attachments-cards-ts.md11.2 KiB
- experts/bridge/ui-modals-dialogs-ts.md21.4 KiB
- experts/bridge/workflow.composable-platform-ts.md13.7 KiB
- experts/bridge/workflows-automation-ts.md14.3 KiB
- experts/builder.md11.1 KiB
- experts/convert/bulk-conversion-strategy-ts.md12.8 KiB
- experts/convert/dependency-mapping-ts.md8.3 KiB
- experts/convert/index.md3.5 KiB
- experts/convert/java-to-ts-ts.md20.6 KiB
- experts/convert/js-to-ts-ts.md6.2 KiB
- experts/convert/json-serialization-ts.md11.0 KiB
- experts/convert/kotlin-to-ts-ts.md11.2 KiB
- experts/convert/ruby-to-ts-ts.md9.7 KiB
- experts/convert/type-mapping-ts.md10.1 KiB
- experts/deploy/aws-bot-deploy-ts.md14.6 KiB
- experts/deploy/aws-cli-reference-ts.md52.4 KiB
- experts/deploy/azure-bot-deploy-ts.md15.4 KiB
- experts/deploy/azure-cli-reference-ts.md16.9 KiB
- experts/deploy/index.md4.6 KiB
- experts/fallback.md2.1 KiB
- experts/index.md18.9 KiB
- experts/models/anthropic-ts.md7.8 KiB
- experts/models/bedrock-ts.md9.9 KiB
- experts/models/foundry-cloud-ts.md8.1 KiB
- experts/models/foundry-local-ts.md10.6 KiB
- experts/models/index.md5.8 KiB
- experts/models/openai-azure-openai-ts.md8.3 KiB
- experts/models/oss-openai-compatible-ts.md10.7 KiB
- experts/models/transformers-js-ts.md11.6 KiB
- experts/prompt-engineer.md14.7 KiB
- experts/researcher.md2.8 KiB
- experts/security/index.md1.2 KiB
- experts/security/input-validation-ts.md13.8 KiB
- experts/security/secrets-ts.md13.9 KiB
- experts/slack/bolt-assistant-ts.md9.9 KiB
- experts/slack/bolt-events-ts.md9.3 KiB
- experts/slack/bolt-java.md8.9 KiB
- experts/slack/bolt-oauth-distribution-ts.md10.9 KiB
- experts/slack/bolt-python.md9.5 KiB
- experts/slack/cli.app-management.md7.9 KiB
- experts/slack/cli.datastore-env.md8.6 KiB
- experts/slack/cli.getting-started.md8.0 KiB
- experts/slack/cli.local-dev-deploy.md8.4 KiB
- experts/slack/cli.manifest-triggers.md9.9 KiB
- experts/slack/index.md8.9 KiB
- experts/slack/runtime.ack-rules-ts.md9.8 KiB
- experts/slack/runtime.bolt-foundations-ts.md10.7 KiB
- experts/slack/runtime.shortcuts-ts.md11.0 KiB
- experts/slack/runtime.slash-commands-ts.md11.6 KiB
- experts/slack/runtime.socket-mode-ts.md9.5 KiB
- experts/slack/ui.block-kit-ts.md11.5 KiB
- experts/slack/ui.modals-lifecycle-ts.md13.3 KiB
- experts/slack/web-api-proactive-ts.md11.0 KiB
- experts/slack/workflow.slack-automations-ts.md10.2 KiB
- experts/teams/a2a.client-basics-ts.md9.7 KiB
- experts/teams/a2a.orchestrator-patterns-ts.md12.7 KiB
- experts/teams/a2a.server-basics-ts.md11.4 KiB
- experts/teams/ai.chatprompt-basics-ts.md8.1 KiB
- experts/teams/ai.citations-feedback-ts.md6.9 KiB
- experts/teams/ai.conversational-query-ts.md14.2 KiB
- experts/teams/ai.function-calling-design-ts.md9.0 KiB
- experts/teams/ai.function-calling-implementation-ts.md7.7 KiB
- experts/teams/ai.memory-localmemory-ts.md7.3 KiB
- experts/teams/ai.model-setup-ts.md6.6 KiB
- experts/teams/ai.rag-retrieval-ts.md7.4 KiB
- experts/teams/ai.rag-vectorstores-ts.md8.5 KiB
- experts/teams/ai.streaming-ts.md6.9 KiB
- experts/teams/auth.oauth-sso-ts.md10.1 KiB
- experts/teams/compat.botbuilder-interop-ts.md14.6 KiB
- experts/teams/dev.debug-test-ts.md14.1 KiB
- experts/teams/graph.usergraph-appgraph-ts.md9.0 KiB
- experts/teams/index.md9.8 KiB
- experts/teams/mcp.client-basics-ts.md9.5 KiB
- experts/teams/mcp.expose-chatprompt-tools-ts.md9.5 KiB
- experts/teams/mcp.security-ts.md10.4 KiB
- experts/teams/mcp.server-basics-ts.md9.9 KiB
- experts/teams/project.scaffold-files-ts.md12.2 KiB
- experts/teams/runtime.app-init-ts.md10.9 KiB
- experts/teams/runtime.manifest-ts.md12.3 KiB
- experts/teams/runtime.proactive-messaging-ts.md12.6 KiB
- experts/teams/runtime.routing-handlers-ts.md12.3 KiB
- experts/teams/state.storage-patterns-ts.md9.4 KiB
- experts/teams/teams-dotnet.md8.2 KiB
- experts/teams/teams-python.md8.3 KiB
- experts/teams/ui.adaptive-cards-ts.md12.9 KiB
- experts/teams/ui.dialogs-task-modules-ts.md15.1 KiB
- experts/teams/ui.message-extensions-ts.md15.6 KiB
- experts/teams/workflow.approvals-inline-ts.md12.4 KiB
- experts/teams/workflow.message-native-records-ts.md10.6 KiB
- experts/teams/workflow.sharepoint-lists-ts.md9.0 KiB
- experts/teams/workflow.state-driven-events-ts.md12.2 KiB
- experts/teams/workflow.triggers-compose-ts.md10.3 KiB
- experts/update-experts.md10.0 KiB
- provision-deploy/provision-deploy.md4.3 KiB
- test-playground/playground-cli.md4.6 KiB
- test-playground/playground.md4.5 KiB
- test-playground/test-playground.md1.1 KiB
- test-teams/test-teams.md4.9 KiB
- toolkit/README.md4.2 KiB
- toolkit/commands.md2.6 KiB
- toolkit/environments.md12.6 KiB
- toolkit/lifecycle-cli.md17.6 KiB
- toolkit/manifest-and-yaml.md6.0 KiB
- toolkit/playground.md7.6 KiB
- toolkit/publish.md9.3 KiB
- toolkit/templates.md6.7 KiB
- troubleshoot/troubleshoot.md20.2 KiB
experts/bridge/interactive-responses-ts.md
interactive-responses-ts
purpose
Bridges Slack interactive response patterns (respond, replace_original, ephemeral) and Teams card/message update patterns for cross-platform bots targeting Slack, Teams, or both.
rules
Slack
respond({ replace_original: true })→ Teams invoke response with card. In Slack,respond()withreplace_originalreplaces the message that triggered the interaction. In Teams, return a new Adaptive Card from thecard.actionhandler's return value — the Bot Framework replaces the card inline. The handler must return{ status: 200, body: { ... } }with the replacement card. learn.microsoft.com -- Universal ActionsSlack
respond({ delete_original: true })→ TeamsdeleteActivity(activityId). Slack's delete-original flag removes the message. In Teams, calldeleteActivity(activityId)on the turn context. You must store the original activity ID (from thesend()return value oractivity.replyToId) to delete it later. learn.microsoft.com -- Delete activitySlack
chat.update(channel, ts, ...)→ TeamsupdateActivity(activityId, activity). Both platforms support editing a bot's own message after sending. The key difference: Slack identifies messages bychannel + ts, Teams usesactivityId(returned fromsend()). Store the activity ID at send time. learn.microsoft.com -- Update activitySlack
chat.postEphemeral()has NO Teams equivalent. Ephemeral messages visible only to one user do not exist in Teams. Redesign strategies: (a) send a message in the user's 1:1 bot chat, (b) useAction.Executewithrefresh.userIdsto show per-user card content, (c) simply send a visible message if privacy is not critical, (d) use a task module/dialog for private interaction. learn.microsoft.com -- ConversationsDeferred response pattern: send "processing..." card, update later. Slack's
response_urlallows 5 follow-up messages within 30 minutes. Teams has noresponse_urlconcept. Instead: (a) return a "Processing..." card from the invoke handler immediately, (b) store the conversation reference and activity ID, (c) use proactive messaging to update the card when processing completes. No expiry limit on updates. learn.microsoft.com -- Proactive messagesSlack
response_url(30-min, 5 follow-ups) →send()/updateActivity()with no expiry. Slack's response_url is a webhook with time and count limits. Teams'send()andupdateActivity()work indefinitely as long as you have a valid conversation reference. This is actually more flexible — but requires you to store conversation references yourself. github.com/microsoft/teams.tsAction.Executewithrefresh.userIdsenables per-user card views. Slack broadcasts the same message to everyone; only the interacting user sees ephemeral responses. Teams'Action.Executewithrefreshcan show different card content to different users — up to 60 user IDs per card. When specified users view the card, Teams automatically invokes the bot to get their personalized version. learn.microsoft.com -- User-specific viewsStore activity IDs at send time. Every
send()in Teams returns an activity ID (or resource response). Store this ID if you need to update or delete the message later. Slack useschannel + ts; Teams uses a single opaqueactivityIdstring. Failing to store the ID means you cannot update the message. github.com/microsoft/teams.tsSlack
respond({ response_type: 'in_channel' })→send(). Slack'sin_channelresponse type makes an ephemeral-by-default response visible to everyone. In Teams, all bot messages are visible by default — simply callsend(). There is no visibility toggle. learn.microsoft.com -- Bot messagesCard action handler must return within 3 seconds. Teams invoke activities (including
Action.ExecuteandAction.Submit) require a synchronous response within ~3 seconds. If processing takes longer, return a "processing" card immediately and update asynchronously via proactive messaging. Slack'sresponse_urlhad a 30-minute window; Teams' invoke has a 3-second window. learn.microsoft.com -- Invoke activitiesReverse direction (Teams → Slack): For Teams → Slack, map
updateActivitytorespond({ replace_original: true }), and card refresh (Action.Executewithrefresh.userIds) to ephemeral messages viachat.postEphemeral.deleteActivitymaps tochat.delete(channel, ts). The 3-second invoke deadline has no Slack equivalent -- Slack'sresponse_urlgives 30 minutes, which is more lenient.
patterns
Card replacement flow (replace_original → invoke response)
Slack (before):
import { App } from "@slack/bolt";
const app = new App({
token: process.env.SLACK_BOT_TOKEN!,
signingSecret: process.env.SLACK_SIGNING_SECRET!,
});
// Send initial message with a button
app.command("/approve", async ({ ack, respond }) => {
await ack();
await respond({
response_type: "in_channel",
blocks: [
{
type: "section",
text: { type: "mrkdwn", text: "Request #123 needs approval" },
accessory: {
type: "button",
text: { type: "plain_text", text: "Approve" },
action_id: "approve_request",
value: "123",
},
},
],
});
});
// Replace the original message when button is clicked
app.action("approve_request", async ({ ack, respond, body }) => {
await ack();
await respond({
replace_original: true,
blocks: [
{
type: "section",
text: {
type: "mrkdwn",
text: `Request #123 — *Approved* by <@${body.user.id}>`,
},
},
],
});
});Teams (after):
import { App } from "@microsoft/teams.apps";
import { ConsoleLogger } from "@microsoft/teams.common";
const app = new App({
logger: new ConsoleLogger("my-bot", { level: "info" }),
});
// Send initial approval card
app.message(/^\/?approve$/i, async ({ send }) => {
const response = await send({
attachments: [{
contentType: "application/vnd.microsoft.card.adaptive",
content: {
type: "AdaptiveCard",
version: "1.5",
body: [
{ type: "TextBlock", text: "Request #123 needs approval", weight: "Bolder" },
],
actions: [{
type: "Action.Execute",
title: "Approve",
verb: "approveRequest",
data: { requestId: "123" },
}],
},
}],
});
// Store response.id if you need to update/delete later via proactive messaging
});
// Handle Action.Execute — return replacement card (replaces replace_original)
app.on("card.action" as any, async ({ activity }) => {
const data = activity.value?.action?.data ?? activity.value;
if (data?.verb === "approveRequest") {
const approver = activity.from?.name ?? "Someone";
// Returning a card from the handler replaces the original card inline
return {
status: 200,
body: {
type: "AdaptiveCard",
version: "1.5",
body: [
{
type: "TextBlock",
text: `Request #${data.requestId} — **Approved** by ${approver}`,
wrap: true,
},
],
// No actions = card becomes read-only after approval
},
};
}
});
app.start(3978);Deferred response with processing indicator
Slack (before):
import { App } from "@slack/bolt";
const app = new App({
token: process.env.SLACK_BOT_TOKEN!,
signingSecret: process.env.SLACK_SIGNING_SECRET!,
});
app.action("run_report", async ({ ack, respond }) => {
await ack();
// Immediate feedback
await respond({ replace_original: true, text: "Generating report..." });
// Long-running task — uses response_url (valid for 30 min, 5 follow-ups)
const report = await generateReport(); // takes 15 seconds
await respond({
replace_original: true,
blocks: [
{
type: "section",
text: { type: "mrkdwn", text: `Report ready: ${report.url}` },
},
],
});
});Teams (after):
import { App } from "@microsoft/teams.apps";
import { ConsoleLogger } from "@microsoft/teams.common";
const app = new App({
logger: new ConsoleLogger("my-bot", { level: "info" }),
});
// Store conversation references for proactive updates
const conversationRefs = new Map<string, any>();
app.on("card.action" as any, async ({ activity, send }) => {
const data = activity.value?.action?.data ?? activity.value;
if (data?.verb === "runReport") {
// Store conversation reference for later proactive update
const convRef = {
conversationId: activity.conversation?.id,
serviceUrl: (activity as any).serviceUrl,
};
// Return "processing" card immediately (must respond within 3 seconds)
const processingCard = {
status: 200,
body: {
type: "AdaptiveCard",
version: "1.5",
body: [
{ type: "TextBlock", text: "Generating report...", isSubtle: true },
{
type: "TextBlock",
text: "This may take a moment. The card will update when ready.",
wrap: true,
size: "Small",
},
],
},
};
// Kick off async work — update the card when done
// No 30-minute expiry like Slack's response_url
setImmediate(async () => {
try {
const report = await generateReport();
// Proactive message to update the card
await send({
attachments: [{
contentType: "application/vnd.microsoft.card.adaptive",
content: {
type: "AdaptiveCard",
version: "1.5",
body: [
{ type: "TextBlock", text: "Report Ready", weight: "Bolder" },
{ type: "TextBlock", text: `[Download Report](${report.url})`, wrap: true },
],
},
}],
});
} catch (err) {
await send("Report generation failed. Please try again.");
}
});
return processingCard;
}
});
async function generateReport() {
// Simulate long-running work
await new Promise((r) => setTimeout(r, 15000));
return { url: "https://example.com/report.pdf" };
}
app.start(3978);Ephemeral workaround: refresh.userIds (R1)
Use Action.Execute with refresh.userIds to show personalized card content to specific users — the closest Teams equivalent to Slack's chat.postEphemeral().
// Send a card where only the acting user sees personalized content
async function sendWithEphemeralView(
send: (msg: any) => Promise<any>,
actingUserId: string,
publicText: string,
privateData: Record<string, unknown>
): Promise<void> {
await send({
attachments: [{
contentType: "application/vnd.microsoft.card.adaptive",
content: {
type: "AdaptiveCard",
version: "1.4",
refresh: {
action: {
type: "Action.Execute",
verb: "personalView",
data: privateData,
},
userIds: [actingUserId], // max 60 IDs
},
body: [
{ type: "TextBlock", text: publicText }, // everyone sees this
],
},
}],
});
}
// When the specified user views the card, Teams invokes the bot:
app.on("card.action" as any, async ({ activity }) => {
const data = activity.value?.action?.data ?? activity.value;
if (data?.verb === "personalView") {
return {
status: 200,
body: {
type: "AdaptiveCard",
version: "1.4",
body: [
{ type: "TextBlock", text: "This content is only visible to you.", weight: "Bolder" },
{ type: "FactSet", facts: [
{ title: "Request ID", value: data.requestId },
{ title: "Status", value: "Pending your review" },
]},
],
},
};
}
});Key constraints: Max 60 user IDs per card. Requires Action.Execute (not Action.Submit). Manifest version must be ≥1.12.
Reverse (Teams → Slack): Map card refresh to chat.postEphemeral(channel, user, { blocks }).
Card version checking (Y11)
Inject a _version counter into Action.Submit.data to prevent race conditions — the Teams equivalent of Slack's view_hash parameter.
// Track version per card instance
const cardVersions = new Map<string, number>();
function buildVersionedCard(cardId: string, data: any): object {
const version = (cardVersions.get(cardId) ?? 0) + 1;
cardVersions.set(cardId, version);
return {
type: "AdaptiveCard", version: "1.5",
body: [/* card content */],
actions: [{
type: "Action.Submit", title: "Update",
data: { ...data, _cardId: cardId, _version: version },
}],
};
}
app.on("card.action" as any, async ({ activity, send }) => {
const submitted = activity.value?.action?.data ?? activity.value;
const currentVersion = cardVersions.get(submitted?._cardId);
if (submitted?._version !== currentVersion) {
await send("This card is outdated. Please use the latest version.");
return { status: 200 };
}
// Process the update safely...
});Don't: Skip version checking even for low-traffic bots — fast double-clicks and multiple tabs cause race conditions.
Reverse (Teams → Slack): Use view_hash from views.open() / views.update() responses natively.
Response pattern mapping table
| Slack Pattern | Teams Equivalent | Notes |
|---|---|---|
respond({ replace_original: true, blocks }) | Return card from card.action handler | Inline card replacement |
respond({ delete_original: true }) | deleteActivity(activityId) | Must store activity ID |
respond({ response_type: 'in_channel' }) | send(text) | All Teams messages are visible |
respond({ response_type: 'ephemeral' }) | (no equivalent) | Redesign: 1:1 chat, Action.Execute refresh, or visible |
chat.update(channel, ts, ...) | updateActivity(activityId, activity) | Store activity ID from send() |
chat.delete(channel, ts) | deleteActivity(activityId) | Store activity ID from send() |
chat.postEphemeral(channel, user, ...) | (no equivalent) | Use Action.Execute refresh.userIds for per-user views |
response_url (30-min, 5 follow-ups) | send() / updateActivity() | No expiry, no count limit |
Button click → ack() + respond() | card.action handler → return card | No ack needed |
pitfalls
Forgetting to store activity IDs: Unlike Slack where
channel + tsidentifies any message, Teams requires theactivityIdreturned fromsend(). If you don't store it, you cannot update or delete the message later. This is the #1 migration failure for interactive patterns.3-second invoke timeout: Slack's
ack()gave you 3 seconds to acknowledge, thenresponse_urlgave 30 minutes for follow-up. Teams invoke handlers must return the full response (including replacement card) within ~3 seconds. Anything longer requires the deferred pattern (return processing card, update proactively).No ephemeral messages — silent behavioral change: Code using
chat.postEphemeral()will not error during migration — it simply has no equivalent. The migrated bot must explicitly choose an alternative strategy. Audit allpostEphemeralcalls before migration.Action.ExecutevsAction.Submit:Action.Submitsends data to the bot but does NOT support automatic card refresh or per-user views.Action.Execute(Universal Actions) supports both. Always useAction.Executefor interactive cards that need replacement or per-user content. Requires manifest version 1.12+.refresh.userIdslimit of 60: The per-user card refresh feature (Action.Executewithrefresh.userIds) supports a maximum of 60 user IDs per card. For broader audiences, send the base card to everyone and only personalize for the acting user.Card replacement only works for invoke responses: You can only replace a card inline by returning a new card from the invoke handler. If the interaction is not an invoke (e.g., a proactive message), you must use
updateActivity()instead.deleteActivitymay not work in all contexts: Deleting activities works in 1:1 and group chats but may be restricted in channels depending on permissions. Test deletion behavior in your target conversation types.
references
https://api.slack.com/interactivity/handling — Slack interactive responses
https://api.slack.com/methods/chat.update — Slack chat.update
https://api.slack.com/methods/chat.postEphemeral — Slack chat.postEphemeral
instructions
Use this expert when adding cross-platform support in either direction for Slack interactive response patterns or Teams card/message update patterns. It covers: respond({ replace_original }) to invoke card replacement, respond({ delete_original }) to deleteActivity(), chat.update() to updateActivity(), chat.postEphemeral() redesign strategies, deferred response patterns (processing card + proactive update), response_url elimination, and Action.Execute with refresh.userIds for per-user card views. For Teams → Slack, map updateActivity to respond({ replace_original }), and card refresh to ephemeral messages. Pair with ../teams/ui.adaptive-cards-ts.md for card construction patterns, ../teams/runtime.proactive-messaging-ts.md for deferred update infrastructure, and events-activities-ts.md for the underlying event/activity mapping.
research
Deep Research prompt:
"Write a micro expert for bridging Slack interactive response patterns (respond, replace_original, ephemeral) and Teams card/message update patterns in either direction for cross-platform bots. Cover: respond({ replace_original }) to invoke card replacement and vice versa, respond({ delete_original }) to deleteActivity, chat.update to updateActivity, chat.postEphemeral redesign strategies, response_url expiry semantics, deferred response patterns with processing indicators, Action.Execute with refresh.userIds for per-user views, reverse-direction mapping from Teams to Slack, and the 3-second invoke timeout constraint. Include side-by-side TypeScript code examples and a mapping table."
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an API key, Needs Python, Needs Node.js
Security
What our scanner noticed· Medium risk
- Possible data-exfiltration endpoints
- Instructions that use the network
- Downloads piped into a shell
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Microsoft
- Publisher
- Microsoft (Official)
- Source
- microsoft/skills · .github/plugins/microsoft-365-agents-toolkit/skills/teams-app-developer · commit 0696600
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Microsoft.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download teams-app-developer.zip