[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ACK92XEZ17W30MKC1RPP8T":3,"skill-same:01M6ACK92XEZ17W30MKC1RPP8T":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":48,"ownerHtmlUrl":49,"ownerBlogUrl":50,"ownerDescription":6,"updatedAt":51,"install":52,"resources":65},"01M6ACK92XEZ17W30MKC1RPP8T","openspec-apply-change",null,"Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.","apache\u002Fcauseway","apache","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F47359?v=4","01M6AC83E6K4FDKK7HZ8WNMQKE","The Apache Software Foundation","01M6ACK5FDA6VVQG8EXM21X4XJ",909,"MIT","https:\u002F\u002Fgithub.com\u002Fapache\u002Fcauseway\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fopenspec-apply-change\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],"change","openspec apply change","apply","openspec apply","openspec","work","when","implementing","implementation","use","user","cli","continue","Bash","start","tasks","implement","2026-11-10 10:12:30",false,"---\nname: teams-sdk-to-agents-sdk-dotnet-migration\ndescription: Use when migrating a customer's Teams SDK (teams.net) bot to the Microsoft 365 Agents SDK in .NET. Triggered by projects that depend on Microsoft.Teams.Plugins.AspNetCore, Microsoft.Teams.Apps, or Microsoft.Teams.Api and call builder.AddTeams() \u002F app.UseTeams().\n---\n\n# Teams SDK (teams.net) to Agents SDK Migration (.NET)\n\n## Overview\n\nWhen an automation caller supplies validation tools instead of shell access, use those\ntools to perform the build, tests, and startup checks required below. A current passing\ntool result is equivalent evidence; do not request unavailable shell access or claim\nvalidation from source inspection alone. Follow the caller's read-only role when reviewing.\n\nMigrates a **Teams SDK** (`teams.net`, https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fteams.net) bot to a Microsoft 365\nAgents SDK **`AgentApplication`**. The Teams SDK registers fluent event delegates\n(`teamsApp.OnMessage(async context => ...)`) on an `IContext\u003CT>`; the Agents SDK routes activities to\nhandler methods on an `AgentApplication` subclass using `ITurnContext`.\n\n**This is NOT the Bot Framework migration.** If the project depends on `Microsoft.Bot.Builder*`, use\n`bf-to-agents-sdk-dotnet-migration` instead. Trigger this skill only for `teams.net` projects\n(`Microsoft.Teams.Plugins.AspNetCore`, `Microsoft.Teams.Apps`, `Microsoft.Teams.Api`).\n\n**Agents SDK repository:** https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fagents-for-net\n**Teams SDK repository:** https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fteams.net\n\n---\n\n## Core Rules\n\n- **Preserve behavior.** Keep the same commands, text matching, and responses except for user-facing references to the migrated runtime, which should say \"agent\" instead of \"bot\". Make other response changes only when required to run on the Agents SDK.\n- Describe the migrated runtime as an agent in README text, catalog descriptions, and user-facing messages. Keep platform terms such as Azure Bot, bot ID, and manifest `bots[]`, and preserve source-derived paths and identifiers unless the caller requests a rename.\n- After source migration is stable, use the standalone `teams-app-manifest` skill to generate, complete,\n  or audit the Teams app manifest from source evidence and explicit product intent. Do not embed manifest\n  feature rules in this migration skill.\n- **Use stable Agents SDK packages.** A caller's minimum Agents SDK version is a floor, not the\n  version to copy into the project. In automated sample sync, use the `selectedAgentsSdkVersion`\n  in the frozen sync context. Respect a customer's explicitly selected release line. Otherwise,\n  read the [Agents SDK release history JSON](https:\u002F\u002Fapi.github.com\u002Frepos\u002Fmicrosoft\u002FAgents-for-net\u002Freleases?per_page=100)\n  (follow later pages when needed) and select the newest stable release within the permitted major,\n  then confirm a common major.minor release line for `Microsoft.Agents.Hosting.AspNetCore`,\n  `Microsoft.Agents.Authentication.Msal`, and `Microsoft.Agents.Extensions.MSTeams` from the\n  [Hosting](https:\u002F\u002Fapi.nuget.org\u002Fv3-flatcontainer\u002Fmicrosoft.agents.hosting.aspnetcore\u002Findex.json),\n  [Authentication](https:\u002F\u002Fapi.nuget.org\u002Fv3-flatcontainer\u002Fmicrosoft.agents.authentication.msal\u002Findex.json),\n  and [MSTeams](https:\u002F\u002Fapi.nuget.org\u002Fv3-flatcontainer\u002Fmicrosoft.agents.extensions.msteams\u002Findex.json)\n  JSON version feeds.\n  Use the newest compatible stable line available for all three, without assuming their patch\n  numbers match. Do not select a prerelease or a new major version without explicit policy.\n- If the project defines the `AgentApplication` during DI (typically in `Program.cs`), ask the customer\n  whether to keep it inline or move it to an `AgentApplication` subclass with Teams route attributes.\n  In the automated Teams sample sync, do not ask a user. Apply an applicable migration policy or return\n  `needs-policy` with evidence and a recommended policy.\n- If creating a subclass, always use `[TeamsExtension]`, mark it `partial`, use Teams route attributes,\n  and take `ITeamsTurnContext` in route handlers.\n- After restoring packages, verify route attributes, handler delegate signatures, payload models, and\n  response types against the installed configured-version XML documentation or current Agents SDK source. Do\n  not infer an API shape from a similarly named Teams SDK API.\n- Preserve the original registration and `if`\u002F`else` precedence. Use explicit route `rank` values\n  whenever multiple text or invoke routes can match the same activity.\n- Prefer `SendActivityAsync(\"text\", cancellationToken: ct)` for plain text. When a reply needs entities, attachments, or other activity fields, build an activity with `Activity.CreateMessageActivity()` and fluent methods such as `.WithText(...)`, then set the extra fields. Keep a factory when it adds value for a structured response.\n- Use the agent's logger for diagnostics instead of `Console.WriteLine`; pass exceptions to structured logging rather than logging only their messages.\n\n---\n\n## Package Replacements\n\nOut-of-repo samples use **PackageReferences** (not ProjectReferences). Replace the single Teams SDK\npackage with the Agents SDK packages, using the selected major.minor release line for all three.\nReplace `RESOLVED_VERSION` below with that line's floating version (for example, `major.minor.*`)\nbefore writing the project file:\n\n| Remove (Teams SDK)                     | Add (Agents SDK)                                                          |\n|----------------------------------------|--------------------------------------------------------------------------|\n| `Microsoft.Teams.Plugins.AspNetCore`   | `Microsoft.Agents.Hosting.AspNetCore` + `Microsoft.Agents.Authentication.Msal` |\n| *(Teams routing surface)*              | `Microsoft.Agents.Extensions.MSTeams` |\n| `Microsoft.Teams.Cards` *(if used)*     | `Microsoft.Teams.Cards` *(kept — Agents MSTeams extension reuses it)*     |\n\n```xml\n\u003CItemGroup>\n  \u003CPackageReference Include=\"Microsoft.Agents.Hosting.AspNetCore\" Version=\"RESOLVED_VERSION\" \u002F>\n  \u003CPackageReference Include=\"Microsoft.Agents.Authentication.Msal\" Version=\"RESOLVED_VERSION\" \u002F>\n  \u003CPackageReference Include=\"Microsoft.Agents.Extensions.MSTeams\" Version=\"RESOLVED_VERSION\" \u002F>\n\u003C\u002FItemGroup>\n```\n\n`Microsoft.Agents.Hosting.AspNetCore` transitively brings `Microsoft.Agents.Builder`,\n`Microsoft.Agents.Core`, `Microsoft.Agents.Connector`, and `Microsoft.Agents.Storage`. The\n`[TeamsExtension]` source generator ships inside `Microsoft.Agents.Core` (analyzers folder), so NuGet\nconsumers get it transitively — no explicit analyzer `PackageReference` is needed.\n\n**TargetFramework:** use the repository's configured target framework, currently `net10.0`. Set\n`\u003CTargetFramework>net10.0\u003C\u002FTargetFramework>`. Set `\u003CImplicitUsings>disable\u003C\u002FImplicitUsings>` and add\nexplicit `using` directives (matches Agents SDK sample convention).\n\n---\n\n## Namespace Replacements\n\n| Teams SDK (`teams.net`)                          | Agents SDK                                       |\n|--------------------------------------------------|--------------------------------------------------|\n| `Microsoft.Teams.Plugins.AspNetCore.Extensions`  | `Microsoft.Agents.Hosting.AspNetCore`            |\n| `Microsoft.Teams.Apps`                           | `Microsoft.Agents.Builder`, `Microsoft.Agents.Builder.App` |\n| `Microsoft.Teams.Apps.Activities`                | `Microsoft.Agents.Builder.App` (routing)         |\n| `Microsoft.Teams.Api.Activities`                 | `Microsoft.Agents.Core.Models`                   |\n| `Microsoft.Teams.Api` (models)                   | `Microsoft.Agents.Core.Models`                   |\n| *(Teams-specific)* `Microsoft.Teams.Apps.Activities.Events` etc. | `Microsoft.Agents.Extensions.MSTeams.*` |\n\n---\n\n## Migration Steps\n\n### Step 1 — Scaffold the copy\n\nCreate `agentsdk-\u003Cname>\u002Fdotnet\u002Fagentsdk-\u003Cname>\u002F` mirroring the customer's source layout. Files:\n\n- `\u003CProject>.csproj` — SDK.Web, `net10.0`, PackageReferences above.\n- `Program.cs` — Agents SDK host (Step 3).\n- `\u003CName>Agent.cs` — the `AgentApplication` subclass (Step 4).\n- `AspNetExtensions.cs` — **required.** `AddAgentAspNetAuthentication()` is *not* in any NuGet package;\n  copy it verbatim from an Agents SDK sample\n  (`src\u002Fsamples\u002FEmptyAgent\u002FAspNetExtensions.cs` in agents-for-net).\n- `appsettings.json` — non-secret Agents SDK config (Step 5); keep local credentials in an ignored `appsettings.Development.json` or environment variables.\n- `Properties\u002FlaunchSettings.json` — `applicationUrl: http:\u002F\u002Flocalhost:3978`.\n- `README.md` — explain the migrated Agents SDK application and its customer-specific setup.\n\n### Step 2 — Map the surface area to route attributes\n\nScan the Teams SDK `Program.cs` (or handler files) for the `teamsApp.On*` registrations and map each to\nits Teams route attribute (see the tables below). The agent is **always** a `[TeamsExtension] partial`\nclass — `OnMessage` → `[TeamsMessageRoute]`, `OnConversationUpdate` → `[TeamsMembersAddedRoute]` \u002F\n`[TeamsMembersRemovedRoute]`, plus any Teams-specific `On*`.\n\n### Step 3 — Program.cs\n\nThe Teams SDK bootstrap becomes the Agents SDK host:\n\n```csharp\n\u002F\u002F Teams SDK\nvar builder = WebApplication.CreateBuilder(args);\nbuilder.AddTeams();\nvar webApp = builder.Build();\nvar teamsApp = webApp.UseTeams(true);\n\u002F\u002F ... teamsApp.On*(...) registrations ...\nwebApp.Run();\n```\n\n```csharp\n\u002F\u002F Agents SDK\nusing MyAgentNamespace;\nusing Microsoft.Agents.Hosting.AspNetCore;\nusing Microsoft.AspNetCore.Builder;\n\nWebApplicationBuilder builder = WebApplication.CreateBuilder(args);\n\nbuilder.AddAgentDefaults()\n    .AddAgent\u003CMyAgent>()\n    .AddAgentAuthorization(b => b.AddAgentAspNetAuthentication());\n\nWebApplication app = builder.Build();\napp.UseAgents();\napp.MapDefaultAgentEndpoints();   \u002F\u002F GET \"\u002F\" + POST \u002Fapi\u002Fmessages\napp.Run();\n```\n\n`AddAgentDefaults()` registers `MemoryStorage`, default options, and the standard HTTP client\nservices. Do not add `builder.Services.AddHttpClient()` to `Program.cs`. Inline `teamsApp.On*`\nlambdas move to handler methods on the agent class (Step 4).\n\n### Step 4 — The agent class\n\nConvert inline delegates into a `[TeamsExtension] partial AgentApplication` subclass. Route each\ncommand with a Teams route attribute; handlers take **`ITeamsTurnContext`**.\n\nThis context rule applies to route attributes from `Microsoft.Agents.Extensions.MSTeams.App`.\nBase Agents SDK routes must use their documented delegate signature. For example,\n`[ActionExecuteRoute]` uses `ITurnContext`, not `ITeamsTurnContext`.\n\n**Text dispatch semantics** (`[TeamsMessageRoute]`):\n- `[TeamsMessageRoute(\"whoami\")]` — exact text match, **case-insensitive**.\n- `[TeamsMessageRoute(textRegex: \"(?i)whoami\")]` — regex match; use this to reproduce the Teams SDK's\n  `text.Contains(...)` dispatch (add `(?i)` for case-insensitivity).\n- `[TeamsMessageRoute]` (no argument) — catch-all; matches any message and defaults to `RouteRank.Last`\n  so specific-text routes win.\n- When several `Contains` branches could overlap, set `rank:` (lower = higher priority) to preserve the\n  original `if\u002Felse` precedence.\n\n```csharp\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.Agents.Builder.App;\nusing Microsoft.Agents.Builder.State;\nusing Microsoft.Agents.Core.Models;              \u002F\u002F Activity, Mention, ActivityTypes\nusing Microsoft.Agents.Extensions.MSTeams;       \u002F\u002F [TeamsExtension], ITeamsTurnContext\nusing Microsoft.Agents.Extensions.MSTeams.App;   \u002F\u002F [TeamsMessageRoute], [TeamsMembersAddedRoute]\n\nnamespace MyAgentNamespace;\n\n[TeamsExtension]\npublic partial class MyAgent(AgentApplicationOptions options) : AgentApplication(options)\n{\n    [TeamsMembersAddedRoute]\n    public async Task OnMembersAddedAsync(ITeamsTurnContext turnContext, ITurnState turnState, CancellationToken ct)\n    {\n        foreach (var member in turnContext.Activity.MembersAdded)\n            if (member.Id == turnContext.Activity.Recipient.Id)\n                await turnContext.SendActivityAsync(\"Welcome!\", cancellationToken: ct);\n    }\n\n    [TeamsMessageRoute(textRegex: \"(?i)whoami\", rank: 11)]\n    public async Task WhoAmIAsync(ITeamsTurnContext turnContext, ITurnState turnState, CancellationToken ct)\n        => await turnContext.SendActivityAsync($\"You are: {turnContext.Activity.From.Name}\", cancellationToken: ct);\n\n    [TeamsMessageRoute]  \u002F\u002F catch-all\n    public async Task DefaultAsync(ITeamsTurnContext turnContext, ITurnState turnState, CancellationToken ct)\n        => await turnContext.SendActivityAsync(\"Welcome!\", cancellationToken: ct);\n}\n```\n\n`AddAgentDefaults()` registers `MemoryStorage` and default options — no explicit `IStorage` needed for a\nbasic agent. Inline `teamsApp.On*` lambdas move to route-attributed methods on the agent class.\n\n### Step 5 — application settings\n\nTeams SDK reads flat `Teams:ClientId\u002FClientSecret\u002FTenantId` (or `CLIENT_ID`\u002F`CLIENT_SECRET` env vars).\nAgents SDK uses `Connections` + `TokenValidation` (+ optional `AgentApplication`). Carry the values\nacross using the customer's authentication type (default below is a SingleTenant Azure Bot with\nClientSecret). Keep the checked-in `appsettings.json` free of real credentials. Put local values in\nan ignored `appsettings.Development.json` or environment variables, and show that pattern in the\nREADME. A checked-in `appsettings.json` can use placeholders for identity values while keeping the\nsecret unset:\n\n```json\n{\n  \"TokenValidation\": {\n    \"Audiences\": [ \"{{ClientId}}\" ],\n    \"TenantId\": \"{{TenantId}}\"\n  },\n  \"OutboundHostValidator\": {\n    \"Enabled\": false,\n    \"IncludeDefaultMicrosoftHosts\": true,\n    \"Hosts\": []\n  },\n  \"AgentApplication\": {\n    \"StartTypingTimer\": false,\n    \"RemoveRecipientMention\": false,\n    \"NormalizeMentions\": false\n  },\n  \"Connections\": {\n    \"ServiceConnection\": {\n      \"Settings\": {\n        \"AuthType\": \"ClientSecret\",\n        \"AuthorityEndpoint\": \"https:\u002F\u002Flogin.microsoftonline.com\u002F{{TenantId}}\",\n        \"ClientId\": \"{{ClientId}}\",\n        \"ClientSecret\": null,\n        \"Scopes\": [ \"https:\u002F\u002Fapi.botframework.com\u002F.default\" ]\n      }\n    }\n  },\n  \"ConnectionsMap\": [ { \"ServiceUrl\": \"*\", \"Connection\": \"ServiceConnection\" } ]\n}\n```\n\nFor local development, put the client ID, tenant ID, and client secret in\n`appsettings.Development.json` using the same nested keys. The file can contain only the values it\noverrides. Ensure it is ignored by Git and run with the `Development` environment. An environment\noverride can set the secret with\n`Connections__ServiceConnection__Settings__ClientSecret`. Keep identity values consistent between\n`TokenValidation`, the service connection, and any separate Graph configuration.\n\nFor other Azure Bot types (UserAssignedMSI, MultiTenant) see the `bf-to-agents-sdk-dotnet-migration`\nskill's appsettings cases and https:\u002F\u002Faka.ms\u002FAgentsSDK-DotNetMSALAuth.\n\n### Step 6 — Generate or audit the Teams app manifest\n\nUse the `teams-app-manifest` skill with the migrated source root, original manifest if present, intended\nTeams scopes, distribution target, and repository placeholder convention.\n\n- Preserve an existing manifest unless a verified migrated capability requires a change.\n- If the source sample has no manifest, generate one only when all required product decisions are known.\n- Return manifest evidence in the transient structured `manifestReport`. Do not create\n  `manifest-evidence.md` in the automated Teams sample sync.\n- Report portal, bot registration, Entra, permission, and event-subscription work separately.\n- Stop on `needs-input`; do not guess scopes, domains, identity values, or permissions. In the automated\n  Teams sample sync, report this as `needs-policy` and leave the blocked behavior unchanged.\n\n### Step 7 — Verify\n\nRun `dotnet build` with 0 warnings\u002Ferrors, then run the migrated customer application and confirm it\nlistens on `http:\u002F\u002Flocalhost:3978` and `GET \u002F` returns 200.\n\nAlso run the schema, package, evidence, and external-configuration checks required by the\n`teams-app-manifest` skill when a manifest is present or generated.\n\n---\n\n## API Mapping (base conversational features)\n\n| Teams SDK (`teams.net`)                                   | Agents SDK                                                       |\n|-----------------------------------------------------------|-----------------------------------------------------------------|\n| `IContext\u003CT> context`                                     | `ITurnContext turnContext` (+ `ITurnState`, `CancellationToken`) |\n| `context.Activity`                                        | `turnContext.Activity`                                           |\n| `context.Activity.Text`                                   | `turnContext.Activity.Text`                                      |\n| `context.Activity.From` \u002F `.From.Name`                    | `turnContext.Activity.From` \u002F `.From.Name`                      |\n| `context.Activity.Recipient?.Id`                          | `turnContext.Activity.Recipient.Id`                             |\n| `context.Activity.MembersAdded`                           | `turnContext.Activity.MembersAdded`                             |\n| `await context.Send(\"text\")`                              | `await turnContext.SendActivityAsync(\"text\", cancellationToken: ct)` |\n| `await context.Send(messageActivity)`                     | `await turnContext.SendActivityAsync(activity, ct)`            |\n| `await context.Send(adaptiveCard)`                        | `await turnContext.SendActivityAsync(MessageFactory.Attachment(new Attachment(ContentTypes.AdaptiveCard, card)), ct)` |\n| `new MessageActivity().WithText(\"t\")`                     | `Activity.CreateMessageActivity().WithText(\"t\")` |\n| `.AddMention(member, addText: false)`                     | build a `Mention` entity + assign `activity.Entities = [mention]` |\n| `context.Api` (Teams REST client)                         | `ITeamsTurnContext.Client` (preferred) or `TeamsExtension.GetTeamsClient(turnContext)` (needs `[TeamsExtension]`) |\n\n### Mention example\n\n```csharp\n\u002F\u002F Teams SDK\nvar activity = new MessageActivity()\n    .WithText($\"Hello \u003Cat>{member.Name}\u003C\u002Fat>\")\n    .AddMention(member, addText: false);\nawait context.Send(activity);\n```\n```csharp\n\u002F\u002F Agents SDK\nvar mention = new Mention { Mentioned = member, Text = $\"\u003Cat>{member.Name}\u003C\u002Fat>\" };\nvar activity = Activity.CreateMessageActivity().WithText($\"Hello {mention.Text}\");\nactivity.Entities = [mention];\nawait turnContext.SendActivityAsync(activity, ct);\n```\n\n---\n\n## Teams-specific event mapping (requires `[TeamsExtension]`)\n\nMark the class `[TeamsExtension] public partial class MyAgent(...) : AgentApplication(...)`, add the\n`Microsoft.Agents.Extensions.MSTeams` package, and use **`ITeamsTurnContext`** (not `ITurnContext`) in\nTeams route handlers. Each Teams SDK `teamsApp.On*` maps to a route attribute:\n\n| Teams SDK event                          | Agents SDK route attribute                                             |\n|------------------------------------------|-----------------------------------------------------------------------|\n| `OnMessage`                              | `[TeamsMessageRoute]` or `[TeamsMessageRoute(\"text\")]` or `AgentApplication.OnTeamsMessage` |\n| `OnConversationUpdate`                   | `[TeamsConversationUpdateRoute]` \u002F `[TeamsMembersAddedRoute]` \u002F `[TeamsMembersRemovedRoute]` |\n| `OnInstall`                              | `[TeamsInstallationUpdateRoute]` plus an `InstallationUpdateActionTypes.Add` guard |\n| `OnInstallUpdate`                        | `[TeamsInstallationUpdateRoute]`                                      |\n| `OnMeetingStart`                         | `[TeamsMeetingStartRoute]`                                            |\n| `OnMeetingEnd`                           | `[TeamsMeetingEndRoute]`                                              |\n| `OnMeetingJoin`                          | `[TeamsMeetingParticipantsJoinRoute]`                                |\n| `OnMeetingLeave`                         | `[TeamsMeetingParticipantsLeaveRoute]`                               |\n| `OnFileConsent` (Accept branch)          | `[TeamsFileConsentAcceptRoute]`                                      |\n| `OnFileConsent` (Decline branch)         | `[TeamsFileConsentDeclineRoute]`                                     |\n| `OnTaskFetch`                            | `[TeamsTaskFetchRoute(\"value\")]` → returns `Microsoft.Teams.Api.TaskModules.Response` |\n| `OnTaskSubmit`                           | `[TeamsTaskSubmitRoute(\"value\")]` → returns `Microsoft.Teams.Api.TaskModules.Response` |\n| `OnMessageExtensionQuery`                | `[TeamsQueryRoute(\"commandId\")]`                                     |\n| `OnMessageExtensionSubmitAction`         | `[TeamsSubmitActionRoute(\"commandId\")]`                              |\n| `OnMessageExtensionFetchTask`            | `[TeamsFetchActionRoute(\"commandId\")]`                              |\n| `OnMessageExtensionQueryLink`            | `[TeamsQueryLinkRoute]` \u002F `[TeamsAnonQueryLinkRoute]`               |\n| `OnMessageExtensionSelectItem`           | `[TeamsSelectItemRoute]`                                             |\n| `OnAdaptiveCardAction` \u002F `Action.Execute` | `[ActionExecuteRoute]` returning `AdaptiveCardInvokeResponse`         |\n| Teams card button clicked invoke         | `[TeamsCardButtonClickedRoute]`                                       |\n| Channel created\u002Frenamed\u002Fdeleted\u002Fetc.     | `[TeamsChannelCreatedRoute]`, `[TeamsChannelRenamedRoute]`, `[TeamsChannelDeletedRoute]`, ... |\n| Team renamed\u002Farchived\u002Fdeleted\u002Fetc.       | `[TeamsTeamRenamedRoute]`, `[TeamsTeamArchivedRoute]`, `[TeamsTeamDeletedRoute]`, ... |\n| Message edit\u002Fdelete\u002Fundelete\u002Fread        | `[TeamsMessageEditRoute]`, `[TeamsMessageDeleteRoute]`, `[TeamsMessageUndeleteRoute]`, `[TeamsReadReceiptRoute]` |\n| Config fetch\u002Fsubmit                      | `[TeamsConfigFetchRoute]`, `[TeamsConfigSubmitRoute]`               |\n\nTeams route handler signature (note `ITeamsTurnContext`, and the extra deserialized payload\nparameter whose type depends on the event):\n\n```csharp\n\u002F\u002F Meeting start\u002Fend payload is Microsoft.Teams.Api.Meetings.MeetingDetails\n[TeamsMeetingStartRoute]\npublic async Task OnMeetingStartAsync(ITeamsTurnContext turnContext, ITurnState turnState,\n    Microsoft.Teams.Api.Meetings.MeetingDetails meeting, CancellationToken ct) { ... }\n\n\u002F\u002F Participant join\u002Fleave payload is Microsoft.Agents.Extensions.MSTeams.Models.MeetingParticipantsEventDetails\n[TeamsMeetingParticipantsJoinRoute]\npublic async Task OnJoinAsync(ITeamsTurnContext turnContext, ITurnState turnState,\n    MeetingParticipantsEventDetails participants, CancellationToken ct) { ... }\n```\n\n`teamsApp.OnInstall(...)` represents only a new installation. Since\n`[TeamsInstallationUpdateRoute]` also receives remove and upgrade actions, preserve `OnInstall`\nsemantics with an explicit guard:\n\n```csharp\nif (turnContext.Activity.Action != InstallationUpdateActionTypes.Add)\n{\n    return;\n}\n```\n\n### Adaptive Card `Action.Execute`\n\nDo not route `Action.Execute` through a generic `[TeamsActivityRoute(\"invoke\")]`. Teams expects an\nadaptive-card invoke response, and a fire-and-forget `Task` handler loses that response.\n\n```csharp\nusing Microsoft.Agents.Builder.App.AdaptiveCards;\n\n[ActionExecuteRoute(\"submit_name\")]\npublic Task\u003CAdaptiveCardInvokeResponse> OnSubmitNameAsync(\n    ITurnContext turnContext,\n    ITurnState turnState,\n    object data,\n    CancellationToken cancellationToken)\n{\n    return Task.FromResult(AdaptiveCardInvokeResponseFactory.Message(\"Submitted.\"));\n}\n```\n\nThe route's `verb` matches the Adaptive Card `Action.Execute` verb. Deserialize `data` using the\nactual card payload shape, preserve the original action behavior, and return an\n`AdaptiveCardInvokeResponse` for every path.\n\n### AI-generated content, sensitivity, and citations\n\nDo not approximate Teams SDK AI helpers with `ChannelData`, generic `Entity` objects, or\nstringified JSON. Use the Agents SDK models so Teams receives the required schema:\n\n```csharp\nvar aiEntity = new AIEntity\n{\n    AdditionalType = [AIEntity.AdditionalTypeAIGeneratedContent],\n    UsageInfo = new SensitivityUsageInfo\n    {\n        Name = \"Confidential\",\n        Description = \"Handle according to your organization's policy.\"\n    },\n    Citation =\n    [\n        new ClientCitation(\n            1,\n            \"Source title\",\n            \"Source summary\",\n            string.Empty,\n            [\"keyword\"],\n            \"https:\u002F\u002Fexample.com\u002Fsource\",\n            ClientCitationIconName.MicrosoftWord)\n    ]\n};\n\nactivity.Entities = [aiEntity];\n```\n\n- `AddAIGenerated()` maps to `AIEntity.AdditionalTypeAIGeneratedContent`.\n- Sensitivity metadata maps to `AIEntity.UsageInfo` with `SensitivityUsageInfo`.\n- Citations map to `AIEntity.Citation` with `ClientCitation`.\n- Feedback buttons use the current Teams feedback-loop helper and\n  `[TeamsFeedbackLoopRoute]` for submitted feedback.\n\n### Long-running invoke work\n\nFile consent and other invoke handlers should acknowledge promptly. Do not keep the incoming HTTP\nrequest open for a long upload, and do not use its cancellation token for work that must continue\nafter the invoke completes.\n\n- Capture the conversation information and immutable payload needed by the operation.\n- Queue the work through a background service.\n- Send completion through an Agents SDK proactive continuation.\n- Do not retain or use the original `ITurnContext` after the handler returns.\n- Do not use untracked `Task.Run` as a substitute for a background service.\n\nMeeting property renames vs. the Teams SDK event `Value`: `.StartTime` → `.ScheduledStartTime`,\n`.EndTime` → `.ScheduledEndTime` (`.Title`, `.JoinUrl`, `.Id`, `.MSGraphResourceId` are unchanged).\n\nCards: Teams SDK `Microsoft.Teams.Cards.AdaptiveCard` types are reused by the Agents MSTeams extension —\nkeep `Microsoft.Teams.Cards` and send via `MessageFactory.Attachment(new Attachment(ContentTypes.AdaptiveCard, card))`.\n\nOutbound Teams REST (`context.Api`) → `ITeamsTurnContext.Client` or `TeamsExtension.GetTeamsClient(turnContext)` (e.g.\n`context.Api.Meetings.GetByIdAsync(id)` → `context.Client.Meetings.GetByIdAsync(id)`).\nFor **turn\u002Fuser (delegated\u002FOBO)** Graph calls use `TeamsExtension.GetGraphClient(turnContext)`. For\n**app-only** Graph calls (e.g. meeting transcripts via `OnlineMeetingTranscript.Read.All`), keep the\noriginal independent app-only client — `Azure.Identity` + `Microsoft.Graph` with a\n`ClientSecretCredential` built from config — rather than `GetGraphClient`. (There is no `TeamsInfo`\nstatic helper in the Agents SDK.)\n\nGotcha: any external client created **eagerly** in the agent constructor (e.g. a\n`ClientSecretCredential`) must guard against blank\u002Fplaceholder config, or the host crashes at\nstartup. Default such config values to empty and skip client creation when unset (wrap creation in\ntry\u002Fcatch on `ArgumentException` as a backstop).\n\n---\n\n## Common Mistakes\n\n| Mistake | Fix |\n|---------|-----|\n| Used mismatched Agents package release lines | Resolve the newest compatible stable line shared by Hosting, Authentication, and MSTeams; respect the caller's minimum and frozen sync target |\n| Retained `Microsoft.Agents.Extensions.MSTeams` `1.0.43-beta` | Replace it with the same current version used by the other Agents SDK packages |\n| Used base `AgentApplication` + `OnActivity`\u002Fconstructor routes instead of `[TeamsExtension]` + route attributes | Always mark the class `[TeamsExtension] partial` and use `[TeamsMessageRoute]` \u002F `[TeamsMembersAddedRoute]` \u002F etc. |\n| Used `ITurnContext` in an MSTeams route handler | Route attributes from `Microsoft.Agents.Extensions.MSTeams.App` require `ITeamsTurnContext`; base routes such as `[ActionExecuteRoute]` use their documented `ITurnContext` signature |\n| Routed `Action.Execute` through a generic invoke route | Use `[ActionExecuteRoute]` and return `AdaptiveCardInvokeResponseFactory` responses |\n| Built AI metadata with `ChannelData`, generic entities, or JSON strings | Use `AIEntity`, `SensitivityUsageInfo`, and `ClientCitation` |\n| Ran a file upload inline with the invoke cancellation token | Acknowledge promptly, queue background work, and send completion through proactive continuation |\n| Treated every installation update as an install | For migrated `OnInstall`, handle only `InstallationUpdateActionTypes.Add` |\n| Forgot `AspNetExtensions.cs` | Copy it from an Agents SDK sample — `AddAgentAspNetAuthentication` is not in any NuGet package |\n| Left `builder.AddTeams()` \u002F `webApp.UseTeams()` | Replace with `AddAgentDefaults().AddAgent\u003CT>()...` and `app.UseAgents()` + `app.MapDefaultAgentEndpoints()` |\n| Kept `context.Send(...)` \u002F `IContext\u003CT>` | Use `turnContext.SendActivityAsync(...)` \u002F `ITurnContext` |\n| Kept flat `Teams:*` auth config | Replace with `Connections` + `TokenValidation` (SingleTenant ClientSecret by default) |\n| Left `TargetFramework` at `net10.0` with `ImplicitUsings` | Use `net8.0`, disable implicit usings, add explicit `using`s |\n| `Missing MessageFactory \u002F ActivityTypes` compile errors | Add `using Microsoft.Agents.Builder;` and `using Microsoft.Agents.Core.Models;` |\n\n---\n","# Teams SDK (teams.net) to Agents SDK Migration (.NET)\n\n## Overview\n\nWhen an automation caller supplies validation tools instead of shell access, use those\ntools to perform the build, tests, and startup checks required below. A current passing\ntool result is equivalent evidence; do not request unavailable shell access or claim\nvalidation from source inspection alone. Follow the caller's read-only role when reviewing.\n\nMigrates a **Teams SDK** (`teams.net`, https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fteams.net) bot to a Microsoft 365\nAgents SDK **`AgentApplication`**. The Teams SDK registers fluent event delegates\n(`teamsApp.OnMessage(async context => ...)`) on an `IContext\u003CT>`; the Agents SDK routes activities to\nhandler methods on an `AgentApplication` subclass using `ITurnContext`.\n\n**This is NOT the Bot Framework migration.** If the project depends on `Microsoft.Bot.Builder*`, use\n`bf-to-agents-sdk-dotnet-migration` instead. Trigger this skill only for `teams.net` projects\n(`Microsoft.Teams.Plugins.AspNetCore`, `Microsoft.Teams.Apps`, `Microsoft.Teams.Api`).\n\n**Agents SDK repository:** https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fagents-for-net\n**Teams SDK repository:** https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fteams.net\n\n---\n\n## Core Rules\n\n- **Preserve behavior.** Keep the same commands, text matching, and responses except for user-facing references to the migrated runtime, which should say \"agent\" instead of \"bot\". Make other response changes only when required to run on the Agents SDK.\n- Describe the migrated runtime as an agent in README text, catalog descriptions, and user-facing messages. Keep platform terms such as Azure Bot, bot ID, and manifest `bots[]`, and preserve source-derived paths and identifiers unless the caller requests a rename.\n- After source migration is stable, use the standalone `teams-app-manifest` skill to generate, complete,\n  or audit the Teams app manifest from source evidence and explicit product intent. Do not embed manifest\n  feature rules in this migration skill.\n- **Use stable Agents SDK packages.** A caller's minimum Agents SDK version is a floor, not the\n  version to copy into the project. In automated sample sync, use the `selectedAgentsSdkVersion`\n  in the frozen sync context. Respect a customer's explicitly selected release line. Otherwise,\n  read the [Agents SDK release history JSON](https:\u002F\u002Fapi.github.com\u002Frepos\u002Fmicrosoft\u002FAgents-for-net\u002Freleases?per_page=100)\n  (follow later pages when needed) and select the newest stable release within the permitted major,\n  then confirm a common major.minor release line for `Microsoft.Agents.Hosting.AspNetCore`,\n  `Microsoft.Agents.Authentication.Msal`, and `Microsoft.Agents.Extensions.MSTeams` from the\n  [Hosting](https:\u002F\u002Fapi.nuget.org\u002Fv3-flatcontainer\u002Fmicrosoft.agents.hosting.aspnetcore\u002Findex.json),\n  [Authentication](https:\u002F\u002Fapi.nuget.org\u002Fv3-flatcontainer\u002Fmicrosoft.agents.authentication.msal\u002Findex.json),\n  and [MSTeams](https:\u002F\u002Fapi.nuget.org\u002Fv3-flatcontainer\u002Fmicrosoft.agents.extensions.msteams\u002Findex.json)\n  JSON version feeds.\n  Use the newest compatible stable line available for all three, without assuming their patch\n  numbers match. Do not select a prerelease or a new major version without explicit policy.\n- If the project defines the `AgentApplication` during DI (typically in `Program.cs`), ask the customer\n  whether to keep it inline or move it to an `AgentApplication` subclass with Teams route attributes.\n  In the automated Teams sample sync, do not ask a user. Apply an applicable migration policy or return\n  `needs-policy` with evidence and a recommended policy.\n- If creating a subclass, always use `[TeamsExtension]`, mark it `partial`, use Teams route attributes,\n  and take `ITeamsTurnContext` in route handlers.\n- After restoring packages, verify route attributes, handler delegate signatures, payload models, and\n  response types against the installed configured-version XML documentation or current Agents SDK source. Do\n  not infer an API shape from a similarly named Teams SDK API.\n- Preserve the original registration and `if`\u002F`else` precedence. Use explicit route `rank` values\n  whenever multiple text or invoke routes can match the same activity.\n- Prefer `SendActivityAsync(\"text\", cancellationToken: ct)` for plain text. When a reply needs entities, attachments, or other activity fields, build an activity with `Activity.CreateMessageActivity()` and fluent methods such as `.WithText(...)`, then set the extra fields. Keep a factory when it adds value for a structured response.\n- Use the agent's logger for diagnostics instead of `Console.WriteLine`; pass exceptions to structured logging rather than logging only their messages.\n\n---\n\n## Package Replacements\n\nOut-of-repo samples use **PackageReferences** (not ProjectReferences). Replace the single Teams SDK\npackage with the Agents SDK packages, using the selected major.minor release line for all three.\nReplace `RESOLVED_VERSION` below with that line's floating version (for example, `major.minor.*`)\nbefore writing the project file:\n\n| Remove (Teams SDK)                     | Add (Agents SDK)                                                          |\n|----------------------------------------|--------------------------------------------------------------------------|\n| `Microsoft.Teams.Plugins.AspNetCore`   | `Microsoft.Agents.Hosting.AspNetCore` + `Microsoft.Agents.Authentication.Msal` |\n| *(Teams routing surface)*              | `Microsoft.Agents.Extensions.MSTeams` |\n| `Microsoft.Teams.Cards` *(if used)*     | `Microsoft.Teams.Cards` *(kept — Agents MSTeams extension reuses it)*     |\n\n```xml\n\u003CItemGroup>\n  \u003CPackageReference Include=\"Microsoft.Agents.Hosting.AspNetCore\" Version=\"RESOLVED_VERSION\" \u002F>\n  \u003CPackageReference Include=\"Microsoft.Agents.Authentication.Msal\" Version=\"RESOLVED_VERSION\" \u002F>\n  \u003CPackageReference Include=\"Microsoft.Agents.Extensions.MSTeams\" Version=\"RESOLVED_VERSION\" \u002F>\n\u003C\u002FItemGroup>\n```\n\n`Microsoft.Agents.Hosting.AspNetCore` transitively brings `Microsoft.Agents.Builder`,\n`Microsoft.Agents.Core`, `Microsoft.Agents.Connector`, and `Microsoft.Agents.Storage`. The\n`[TeamsExtension]` source generator ships inside `Microsoft.Agents.Core` (analyzers folder), so NuGet\nconsumers get it transitively — no explicit analyzer `PackageReference` is needed.\n\n**TargetFramework:** use the repository's configured target framework, currently `net10.0`. Set\n`\u003CTargetFramework>net10.0\u003C\u002FTargetFramework>`. Set `\u003CImplicitUsings>disable\u003C\u002FImplicitUsings>` and add\nexplicit `using` directives (matches Agents SDK sample convention).\n\n---\n\n## Namespace Replacements\n\n| Teams SDK (`teams.net`)                          | Agents SDK                                       |\n|--------------------------------------------------|--------------------------------------------------|\n| `Microsoft.Teams.Plugins.AspNetCore.Extensions`  | `Microsoft.Agents.Hosting.AspNetCore`            |\n| `Microsoft.Teams.Apps`                           | `Microsoft.Agents.Builder`, `Microsoft.Agents.Builder.App` |\n| `Microsoft.Teams.Apps.Activities`                | `Microsoft.Agents.Builder.App` (routing)         |\n| `Microsoft.Teams.Api.Activities`                 | `Microsoft.Agents.Core.Models`                   |\n| `Microsoft.Teams.Api` (models)                   | `Microsoft.Agents.Core.Models`                   |\n| *(Teams-specific)* `Microsoft.Teams.Apps.Activities.Events` etc. | `Microsoft.Agents.Extensions.MSTeams.*` |\n\n---\n\n## Migration Steps\n\n### Step 1 — Scaffold the copy\n\nCreate `agentsdk-\u003Cname>\u002Fdotnet\u002Fagentsdk-\u003Cname>\u002F` mirroring the customer's source layout. Files:\n\n- `\u003CProject>.csproj` — SDK.Web, `net10.0`, PackageReferences above.\n- `Program.cs` — Agents SDK host (Step 3).\n- `\u003CName>Agent.cs` — the `AgentApplication` subclass (Step 4).\n- `AspNetExtensions.cs` — **required.** `AddAgentAspNetAuthentication()` is *not* in any NuGet package;\n  copy it verbatim from an Agents SDK sample\n  (`src\u002Fsamples\u002FEmptyAgent\u002FAspNetExtensions.cs` in agents-for-net).\n- `appsettings.json` — non-secret Agents SDK config (Step 5); keep local credentials in an ignored `appsettings.Development.json` or environment variables.\n- `Properties\u002FlaunchSettings.json` — `applicationUrl: http:\u002F\u002Flocalhost:3978`.\n- `README.md` — explain the migrated Agents SDK application and its customer-specific setup.\n\n### Step 2 — Map the surface area to route attributes\n\nScan the Teams SDK `Program.cs` (or handler files) for the `teamsApp.On*` registrations and map each to\nits Teams route attribute (see the tables below). The agent is **always** a `[TeamsExtension] partial`\nclass — `OnMessage` → `[TeamsMessageRoute]`, `OnConversationUpdate` → `[TeamsMembersAddedRoute]` \u002F\n`[TeamsMembersRemovedRoute]`, plus any Teams-specific `On*`.\n\n### Step 3 — Program.cs\n\nThe Teams SDK bootstrap becomes the Agents SDK host:\n\n```csharp\n\u002F\u002F Teams SDK\nvar builder = WebApplication.CreateBuilder(args);\nbuilder.AddTeams();\nvar webApp = builder.Build();\nvar teamsApp = webApp.UseTeams(true);\n\u002F\u002F ... teamsApp.On*(...) registrations ...\nwebApp.Run();\n```\n\n```csharp\n\u002F\u002F Agents SDK\nusing MyAgentNamespace;\nusing Microsoft.Agents.Hosting.AspNetCore;\nusing Microsoft.AspNetCore.Builder;\n\nWebApplicationBuilder builder = WebApplication.CreateBuilder(args);\n\nbuilder.AddAgentDefaults()\n    .AddAgent\u003CMyAgent>()\n    .AddAgentAuthorization(b => b.AddAgentAspNetAuthentication());\n\nWebApplication app = builder.Build();\napp.UseAgents();\napp.MapDefaultAgentEndpoints();   \u002F\u002F GET \"\u002F\" + POST \u002Fapi\u002Fmessages\napp.Run();\n```\n\n`AddAgentDefaults()` registers `MemoryStorage`, default options, and the standard HTTP client\nservices. Do not add `builder.Services.AddHttpClient()` to `Program.cs`. Inline `teamsApp.On*`\nlambdas move to handler methods on the agent class (Step 4).\n\n### Step 4 — The agent class\n\nConvert inline delegates into a `[TeamsExtension] partial AgentApplication` subclass. Route each\ncommand with a Teams route attribute; handlers take **`ITeamsTurnContext`**.\n\nThis context rule applies to route attributes from `Microsoft.Agents.Extensions.MSTeams.App`.\nBase Agents SDK routes must use their documented delegate signature. For example,\n`[ActionExecuteRoute]` uses `ITurnContext`, not `ITeamsTurnContext`.\n\n**Text dispatch semantics** (`[TeamsMessageRoute]`):\n- `[TeamsMessageRoute(\"whoami\")]` — exact text match, **case-insensitive**.\n- `[TeamsMessageRoute(textRegex: \"(?i)whoami\")]` — regex match; use this to reproduce the Teams SDK's\n  `text.Contains(...)` dispatch (add `(?i)` for case-insensitivity).\n- `[TeamsMessageRoute]` (no argument) — catch-all; matches any message and defaults to `RouteRank.Last`\n  so specific-text routes win.\n- When several `Contains` branches could overlap, set `rank:` (lower = higher priority) to preserve the\n  original `if\u002Felse` precedence.\n\n```csharp\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.Agents.Builder.App;\nusing Microsoft.Agents.Builder.State;\nusing Microsoft.Agents.Core.Models;              \u002F\u002F Activity, Mention, ActivityTypes\nusing Microsoft.Agents.Extensions.MSTeams;       \u002F\u002F [TeamsExtension], ITeamsTurnContext\nusing Microsoft.Agents.Extensions.MSTeams.App;   \u002F\u002F [TeamsMessageRoute], [TeamsMembersAddedRoute]\n\nnamespace MyAgentNamespace;\n\n[TeamsExtension]\npublic partial class MyAgent(AgentApplicationOptions options) : AgentApplication(options)\n{\n    [TeamsMembersAddedRoute]\n    public async Task OnMembersAddedAsync(ITeamsTurnContext turnContext, ITurnState turnState, CancellationToken ct)\n    {\n        foreach (var member in turnContext.Activity.MembersAdded)\n            if (member.Id == turnContext.Activity.Recipient.Id)\n                await turnContext.SendActivityAsync(\"Welcome!\", cancellationToken: ct);\n    }\n\n    [TeamsMessageRoute(textRegex: \"(?i)whoami\", rank: 11)]\n    public async Task WhoAmIAsync(ITeamsTurnContext turnContext, ITurnState turnState, CancellationToken ct)\n        => await turnContext.SendActivityAsync($\"You are: {turnContext.Activity.From.Name}\", cancellationToken: ct);\n\n    [TeamsMessageRoute]  \u002F\u002F catch-all\n    public async Task DefaultAsync(ITeamsTurnContext turnContext, ITurnState turnState, CancellationToken ct)\n        => await turnContext.SendActivityAsync(\"Welcome!\", cancellationToken: ct);\n}\n```\n\n`AddAgentDefaults()` registers `MemoryStorage` and default options — no explicit `IStorage` needed for a\nbasic agent. Inline `teamsApp.On*` lambdas move to route-attributed methods on the agent class.\n\n### Step 5 — application settings\n\nTeams SDK reads flat `Teams:ClientId\u002FClientSecret\u002FTenantId` (or `CLIENT_ID`\u002F`CLIENT_SECRET` env vars).\nAgents SDK uses `Connections` + `TokenValidation` (+ optional `AgentApplication`). Carry the values\nacross using the customer's authentication type (default below is a SingleTenant Azure Bot with\nClientSecret). Keep the checked-in `appsettings.json` free of real credentials. Put local values in\nan ignored `appsettings.Development.json` or environment variables, and show that pattern in the\nREADME. A checked-in `appsettings.json` can use placeholders for identity values while keeping the\nsecret unset:\n\n```json\n{\n  \"TokenValidation\": {\n    \"Audiences\": [ \"{{ClientId}}\" ],\n    \"TenantId\": \"{{TenantId}}\"\n  },\n  \"OutboundHostValidator\": {\n    \"Enabled\": false,\n    \"IncludeDefaultMicrosoftHosts\": true,\n    \"Hosts\": []\n  },\n  \"AgentApplication\": {\n    \"StartTypingTimer\": false,\n    \"RemoveRecipientMention\": false,\n    \"NormalizeMentions\": false\n  },\n  \"Connections\": {\n    \"ServiceConnection\": {\n      \"Settings\": {\n        \"AuthType\": \"ClientSecret\",\n        \"AuthorityEndpoint\": \"https:\u002F\u002Flogin.microsoftonline.com\u002F{{TenantId}}\",\n        \"ClientId\": \"{{ClientId}}\",\n        \"ClientSecret\": null,\n        \"Scopes\": [ \"https:\u002F\u002Fapi.botframework.com\u002F.default\" ]\n      }\n    }\n  },\n  \"ConnectionsMap\": [ { \"ServiceUrl\": \"*\", \"Connection\": \"ServiceConnection\" } ]\n}\n```\n\nFor local development, put the client ID, tenant ID, and client secret in\n`appsettings.Development.json` using the same nested keys. The file can contain only the values it\noverrides. Ensure it is ignored by Git and run with the `Development` environment. An environment\noverride can set the secret with\n`Connections__ServiceConnection__Settings__ClientSecret`. Keep identity values consistent between\n`TokenValidation`, the service connection, and any separate Graph configuration.\n\nFor other Azure Bot types (UserAssignedMSI, MultiTenant) see the `bf-to-agents-sdk-dotnet-migration`\nskill's appsettings cases and https:\u002F\u002Faka.ms\u002FAgentsSDK-DotNetMSALAuth.\n\n### Step 6 — Generate or audit the Teams app manifest\n\nUse the `teams-app-manifest` skill with the migrated source root, original manifest if present, intended\nTeams scopes, distribution target, and repository placeholder convention.\n\n- Preserve an existing manifest unless a verified migrated capability requires a change.\n- If the source sample has no manifest, generate one only when all required product decisions are known.\n- Return manifest evidence in the transient structured `manifestReport`. Do not create\n  `manifest-evidence.md` in the automated Teams sample sync.\n- Report portal, bot registration, Entra, permission, and event-subscription work separately.\n- Stop on `needs-input`; do not guess scopes, domains, identity values, or permissions. In the automated\n  Teams sample sync, report this as `needs-policy` and leave the blocked behavior unchanged.\n\n### Step 7 — Verify\n\nRun `dotnet build` with 0 warnings\u002Ferrors, then run the migrated customer application and confirm it\nlistens on `http:\u002F\u002Flocalhost:3978` and `GET \u002F` returns 200.\n\nAlso run the schema, package, evidence, and external-configuration checks required by the\n`teams-app-manifest` skill when a manifest is present or generated.\n\n---\n\n## API Mapping (base conversational features)\n\n| Teams SDK (`teams.net`)                                   | Agents SDK                                                       |\n|-----------------------------------------------------------|-----------------------------------------------------------------|\n| `IContext\u003CT> context`                                     | `ITurnContext turnContext` (+ `ITurnState`, `CancellationToken`) |\n| `context.Activity`                                        | `turnContext.Activity`                                           |\n| `context.Activity.Text`                                   | `turnContext.Activity.Text`                                      |\n| `context.Activity.From` \u002F `.From.Name`                    | `turnContext.Activity.From` \u002F `.From.Name`                      |\n| `context.Activity.Recipient?.Id`                          | `turnContext.Activity.Recipient.Id`                             |\n| `context.Activity.MembersAdded`                           | `turnContext.Activity.MembersAdded`                             |\n| `await context.Send(\"text\")`                              | `await turnContext.SendActivityAsync(\"text\", cancellationToken: ct)` |\n| `await context.Send(messageActivity)`                     | `await turnContext.SendActivityAsync(activity, ct)`            |\n| `await context.Send(adaptiveCard)`                        | `await turnContext.SendActivityAsync(MessageFactory.Attachment(new Attachment(ContentTypes.AdaptiveCard, card)), ct)` |\n| `new MessageActivity().WithText(\"t\")`                     | `Activity.CreateMessageActivity().WithText(\"t\")` |\n| `.AddMention(member, addText: false)`                     | build a `Mention` entity + assign `activity.Entities = [mention]` |\n| `context.Api` (Teams REST client)                         | `ITeamsTurnContext.Client` (preferred) or `TeamsExtension.GetTeamsClient(turnContext)` (needs `[TeamsExtension]`) |\n\n### Mention example\n\n```csharp\n\u002F\u002F Teams SDK\nvar activity = new MessageActivity()\n    .WithText($\"Hello \u003Cat>{member.Name}\u003C\u002Fat>\")\n    .AddMention(member, addText: false);\nawait context.Send(activity);\n```\n```csharp\n\u002F\u002F Agents SDK\nvar mention = new Mention { Mentioned = member, Text = $\"\u003Cat>{member.Name}\u003C\u002Fat>\" };\nvar activity = Activity.CreateMessageActivity().WithText($\"Hello {mention.Text}\");\nactivity.Entities = [mention];\nawait turnContext.SendActivityAsync(activity, ct);\n```\n\n---\n\n## Teams-specific event mapping (requires `[TeamsExtension]`)\n\nMark the class `[TeamsExtension] public partial class MyAgent(...) : AgentApplication(...)`, add the\n`Microsoft.Agents.Extensions.MSTeams` package, and use **`ITeamsTurnContext`** (not `ITurnContext`) in\nTeams route handlers. Each Teams SDK `teamsApp.On*` maps to a route attribute:\n\n| Teams SDK event                          | Agents SDK route attribute                                             |\n|------------------------------------------|-----------------------------------------------------------------------|\n| `OnMessage`                              | `[TeamsMessageRoute]` or `[TeamsMessageRoute(\"text\")]` or `AgentApplication.OnTeamsMessage` |\n| `OnConversationUpdate`                   | `[TeamsConversationUpdateRoute]` \u002F `[TeamsMembersAddedRoute]` \u002F `[TeamsMembersRemovedRoute]` |\n| `OnInstall`                              | `[TeamsInstallationUpdateRoute]` plus an `InstallationUpdateActionTypes.Add` guard |\n| `OnInstallUpdate`                        | `[TeamsInstallationUpdateRoute]`                                      |\n| `OnMeetingStart`                         | `[TeamsMeetingStartRoute]`                                            |\n| `OnMeetingEnd`                           | `[TeamsMeetingEndRoute]`                                              |\n| `OnMeetingJoin`                          | `[TeamsMeetingParticipantsJoinRoute]`                                |\n| `OnMeetingLeave`                         | `[TeamsMeetingParticipantsLeaveRoute]`                               |\n| `OnFileConsent` (Accept branch)          | `[TeamsFileConsentAcceptRoute]`                                      |\n| `OnFileConsent` (Decline branch)         | `[TeamsFileConsentDeclineRoute]`                                     |\n| `OnTaskFetch`                            | `[TeamsTaskFetchRoute(\"value\")]` → returns `Microsoft.Teams.Api.TaskModules.Response` |\n| `OnTaskSubmit`                           | `[TeamsTaskSubmitRoute(\"value\")]` → returns `Microsoft.Teams.Api.TaskModules.Response` |\n| `OnMessageExtensionQuery`                | `[TeamsQueryRoute(\"commandId\")]`                                     |\n| `OnMessageExtensionSubmitAction`         | `[TeamsSubmitActionRoute(\"commandId\")]`                              |\n| `OnMessageExtensionFetchTask`            | `[TeamsFetchActionRoute(\"commandId\")]`                              |\n| `OnMessageExtensionQueryLink`            | `[TeamsQueryLinkRoute]` \u002F `[TeamsAnonQueryLinkRoute]`               |\n| `OnMessageExtensionSelectItem`           | `[TeamsSelectItemRoute]`                                             |\n| `OnAdaptiveCardAction` \u002F `Action.Execute` | `[ActionExecuteRoute]` returning `AdaptiveCardInvokeResponse`         |\n| Teams card button clicked invoke         | `[TeamsCardButtonClickedRoute]`                                       |\n| Channel created\u002Frenamed\u002Fdeleted\u002Fetc.     | `[TeamsChannelCreatedRoute]`, `[TeamsChannelRenamedRoute]`, `[TeamsChannelDeletedRoute]`, ... |\n| Team renamed\u002Farchived\u002Fdeleted\u002Fetc.       | `[TeamsTeamRenamedRoute]`, `[TeamsTeamArchivedRoute]`, `[TeamsTeamDeletedRoute]`, ... |\n| Message edit\u002Fdelete\u002Fundelete\u002Fread        | `[TeamsMessageEditRoute]`, `[TeamsMessageDeleteRoute]`, `[TeamsMessageUndeleteRoute]`, `[TeamsReadReceiptRoute]` |\n| Config fetch\u002Fsubmit                      | `[TeamsConfigFetchRoute]`, `[TeamsConfigSubmitRoute]`               |\n\nTeams route handler signature (note `ITeamsTurnContext`, and the extra deserialized payload\nparameter whose type depends on the event):\n\n```csharp\n\u002F\u002F Meeting start\u002Fend payload is Microsoft.Teams.Api.Meetings.MeetingDetails\n[TeamsMeetingStartRoute]\npublic async Task OnMeetingStartAsync(ITeamsTurnContext turnContext, ITurnState turnState,\n    Microsoft.Teams.Api.Meetings.MeetingDetails meeting, CancellationToken ct) { ... }\n\n\u002F\u002F Participant join\u002Fleave payload is Microsoft.Agents.Extensions.MSTeams.Models.MeetingParticipantsEventDetails\n[TeamsMeetingParticipantsJoinRoute]\npublic async Task OnJoinAsync(ITeamsTurnContext turnContext, ITurnState turnState,\n    MeetingParticipantsEventDetails participants, CancellationToken ct) { ... }\n```\n\n`teamsApp.OnInstall(...)` represents only a new installation. Since\n`[TeamsInstallationUpdateRoute]` also receives remove and upgrade actions, preserve `OnInstall`\nsemantics with an explicit guard:\n\n```csharp\nif (turnContext.Activity.Action != InstallationUpdateActionTypes.Add)\n{\n    return;\n}\n```\n\n### Adaptive Card `Action.Execute`\n\nDo not route `Action.Execute` through a generic `[TeamsActivityRoute(\"invoke\")]`. Teams expects an\nadaptive-card invoke response, and a fire-and-forget `Task` handler loses that response.\n\n```csharp\nusing Microsoft.Agents.Builder.App.AdaptiveCards;\n\n[ActionExecuteRoute(\"submit_name\")]\npublic Task\u003CAdaptiveCardInvokeResponse> OnSubmitNameAsync(\n    ITurnContext turnContext,\n    ITurnState turnState,\n    object data,\n    CancellationToken cancellationToken)\n{\n    return Task.FromResult(AdaptiveCardInvokeResponseFactory.Message(\"Submitted.\"));\n}\n```\n\nThe route's `verb` matches the Adaptive Card `Action.Execute` verb. Deserialize `data` using the\nactual card payload shape, preserve the original action behavior, and return an\n`AdaptiveCardInvokeResponse` for every path.\n\n### AI-generated content, sensitivity, and citations\n\nDo not approximate Teams SDK AI helpers with `ChannelData`, generic `Entity` objects, or\nstringified JSON. Use the Agents SDK models so Teams receives the required schema:\n\n```csharp\nvar aiEntity = new AIEntity\n{\n    AdditionalType = [AIEntity.AdditionalTypeAIGeneratedContent],\n    UsageInfo = new SensitivityUsageInfo\n    {\n        Name = \"Confidential\",\n        Description = \"Handle according to your organization's policy.\"\n    },\n    Citation =\n    [\n        new ClientCitation(\n            1,\n            \"Source title\",\n            \"Source summary\",\n            string.Empty,\n            [\"keyword\"],\n            \"https:\u002F\u002Fexample.com\u002Fsource\",\n            ClientCitationIconName.MicrosoftWord)\n    ]\n};\n\nactivity.Entities = [aiEntity];\n```\n\n- `AddAIGenerated()` maps to `AIEntity.AdditionalTypeAIGeneratedContent`.\n- Sensitivity metadata maps to `AIEntity.UsageInfo` with `SensitivityUsageInfo`.\n- Citations map to `AIEntity.Citation` with `ClientCitation`.\n- Feedback buttons use the current Teams feedback-loop helper and\n  `[TeamsFeedbackLoopRoute]` for submitted feedback.\n\n### Long-running invoke work\n\nFile consent and other invoke handlers should acknowledge promptly. Do not keep the incoming HTTP\nrequest open for a long upload, and do not use its cancellation token for work that must continue\nafter the invoke completes.\n\n- Capture the conversation information and immutable payload needed by the operation.\n- Queue the work through a background service.\n- Send completion through an Agents SDK proactive continuation.\n- Do not retain or use the original `ITurnContext` after the handler returns.\n- Do not use untracked `Task.Run` as a substitute for a background service.\n\nMeeting property renames vs. the Teams SDK event `Value`: `.StartTime` → `.ScheduledStartTime`,\n`.EndTime` → `.ScheduledEndTime` (`.Title`, `.JoinUrl`, `.Id`, `.MSGraphResourceId` are unchanged).\n\nCards: Teams SDK `Microsoft.Teams.Cards.AdaptiveCard` types are reused by the Agents MSTeams extension —\nkeep `Microsoft.Teams.Cards` and send via `MessageFactory.Attachment(new Attachment(ContentTypes.AdaptiveCard, card))`.\n\nOutbound Teams REST (`context.Api`) → `ITeamsTurnContext.Client` or `TeamsExtension.GetTeamsClient(turnContext)` (e.g.\n`context.Api.Meetings.GetByIdAsync(id)` → `context.Client.Meetings.GetByIdAsync(id)`).\nFor **turn\u002Fuser (delegated\u002FOBO)** Graph calls use `TeamsExtension.GetGraphClient(turnContext)`. For\n**app-only** Graph calls (e.g. meeting transcripts via `OnlineMeetingTranscript.Read.All`), keep the\noriginal independent app-only client — `Azure.Identity` + `Microsoft.Graph` with a\n`ClientSecretCredential` built from config — rather than `GetGraphClient`. (There is no `TeamsInfo`\nstatic helper in the Agents SDK.)\n\nGotcha: any external client created **eagerly** in the agent constructor (e.g. a\n`ClientSecretCredential`) must guard against blank\u002Fplaceholder config, or the host crashes at\nstartup. Default such config values to empty and skip client creation when unset (wrap creation in\ntry\u002Fcatch on `ArgumentException` as a backstop).\n\n---\n\n## Common Mistakes\n\n| Mistake | Fix |\n|---------|-----|\n| Used mismatched Agents package release lines | Resolve the newest compatible stable line shared by Hosting, Authentication, and MSTeams; respect the caller's minimum and frozen sync target |\n| Retained `Microsoft.Agents.Extensions.MSTeams` `1.0.43-beta` | Replace it with the same current version used by the other Agents SDK packages |\n| Used base `AgentApplication` + `OnActivity`\u002Fconstructor routes instead of `[TeamsExtension]` + route attributes | Always mark the class `[TeamsExtension] partial` and use `[TeamsMessageRoute]` \u002F `[TeamsMembersAddedRoute]` \u002F etc. |\n| Used `ITurnContext` in an MSTeams route handler | Route attributes from `Microsoft.Agents.Extensions.MSTeams.App` require `ITeamsTurnContext`; base routes such as `[ActionExecuteRoute]` use their documented `ITurnContext` signature |\n| Routed `Action.Execute` through a generic invoke route | Use `[ActionExecuteRoute]` and return `AdaptiveCardInvokeResponseFactory` responses |\n| Built AI metadata with `ChannelData`, generic entities, or JSON strings | Use `AIEntity`, `SensitivityUsageInfo`, and `ClientCitation` |\n| Ran a file upload inline with the invoke cancellation token | Acknowledge promptly, queue background work, and send completion through proactive continuation |\n| Treated every installation update as an install | For migrated `OnInstall`, handle only `InstallationUpdateActionTypes.Add` |\n| Forgot `AspNetExtensions.cs` | Copy it from an Agents SDK sample — `AddAgentAspNetAuthentication` is not in any NuGet package |\n| Left `builder.AddTeams()` \u002F `webApp.UseTeams()` | Replace with `AddAgentDefaults().AddAgent\u003CT>()...` and `app.UseAgents()` + `app.MapDefaultAgentEndpoints()` |\n| Kept `context.Send(...)` \u002F `IContext\u003CT>` | Use `turnContext.SendActivityAsync(...)` \u002F `ITurnContext` |\n| Kept flat `Teams:*` auth config | Replace with `Connections` + `TokenValidation` (SingleTenant ClientSecret by default) |\n| Left `TargetFramework` at `net10.0` with `ImplicitUsings` | Use `net8.0`, disable implicit usings, add explicit `using`s |\n| `Missing MessageFactory \u002F ActivityTypes` compile errors | Add `using Microsoft.Agents.Builder;` and `using Microsoft.Agents.Core.Models;` |\n\n---\n",{"name":41,"description":42},"teams-sdk-to-agents-sdk-dotnet-migration","Use when migrating a customer's Teams SDK (teams.net) bot to the Microsoft 365 Agents SDK in .NET. Triggered by projects that depend on Microsoft.Teams.Plugins.AspNetCore, Microsoft.Teams.Apps, or Microsoft.Teams.Api and call builder.AddTeams() \u002F app.UseTeams().","main","8171bc7e0ca3b8defd578a6bb317367c2901983f",".agents\u002Fskills\u002Fopenspec-apply-change",315,"https:\u002F\u002Fgithub.com\u002Fapache\u002Fcauseway","https:\u002F\u002Fcauseway.apache.org\u002F","https:\u002F\u002Fgithub.com\u002Fapache","https:\u002F\u002Fwww.apache.org\u002F","2026-11-14 03:20:17",{"source":8,"skillName":41,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add apache\u002Fcauseway --skill teams-sdk-to-agents-sdk-dotnet-migration",{"tool":58,"command":59},"bunx","bunx skills add apache\u002Fcauseway --skill teams-sdk-to-agents-sdk-dotnet-migration",{"tool":61,"command":62},"pnpm","pnpm dlx skills add apache\u002Fcauseway --skill teams-sdk-to-agents-sdk-dotnet-migration","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fapache\u002Fcauseway\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fopenspec-apply-change\u002FSKILL.md",true,[],[67,88,100,121,141,157],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":36},"01M6ACKQK07AJ62E010HJHGKZK","openspec-update-change","Update an OpenSpec change by revising its existing planning artifacts and keeping them coherent with one another. Use when the user wants to revise a change's plan, fold new decisions into it, or reconcile its artifacts after an edit. Never edits code.","https:\u002F\u002Fgithub.com\u002Fapache\u002Fcauseway\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fopenspec-update-change\u002FSKILL.md",[],[19,74,75,23,30,76,77,78,32,79,80,81,28,82,83,84,85,86,25,87],"update","openspec update change","code","planning","artifacts","plan","decisions","edit","never","Fold","coherent","with","Existing","new",{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":36},"01M6ACKND59G6M6XBHZ6KCBDY1","openspec-sync-specs","Sync delta specs from a change to main specs. Use when the user wants to update main specs with changes from a delta spec, without archiving the change.","https:\u002F\u002Fgithub.com\u002Fapache\u002Fcauseway\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fopenspec-sync-specs\u002FSKILL.md",[],[95,96,23,30,97,19,74,32,29,28,98,43,85,99,25],"sync","openspec sync specs","spec","delta","changes",{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":111,"publishedAt":36},"01M6ACKJMA9K21YE9K5T1P6NRD","openspec-propose","Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.","https:\u002F\u002Fgithub.com\u002Fapache\u002Fcauseway\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fopenspec-propose\u002FSKILL.md",[106],{"categoryNo":107,"categoryName":108,"taxonomyType":109,"taxonomyTypeDesc":110},"01JBSEEDCAT000000000000015","视觉设计","SCENARIO","使用场景",[112,23,113,30,19,34,78,32,114,28,115,27,116,117,118,119,85,120,25,87],"openspec propose","design","generated","ready","build","get","complete","proposal","for",{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":36},"01M6ACKG78GSZJ2EM7Q3H9A3RB","openspec-oneshot","Run a full OpenSpec workflow from one request. Use when the user wants proposal, implementation, commits, spec sync, and archive handled as one resumable flow.","https:\u002F\u002Fgithub.com\u002Fapache\u002Fcauseway\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fopenspec-oneshot\u002FSKILL.md",[],[128,23,129,30,97,130,95,131,132,133,32,134,28,135,136,137,138,119,139,140,25],"openspec oneshot","oneshot","workflow","run","flow","commits","archive","local","full","as","spec sync","true","request",{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":36},"01M6ACKE3GGEV3TMM2THTQW8EB","openspec-explore","Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.","https:\u002F\u002Fgithub.com\u002Fapache\u002Fcauseway\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fopenspec-explore\u002FSKILL.md",[],[148,149,23,30,19,32,29,28,150,151,152,153,154,155,156,120,25],"openspec explore","explore","think","thinking partner","thinking","ideas","requirements","partner","mode",{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":36},"01M6ACKBVG2GT4C6KEV08TT8FH","openspec-archive-change","Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.","https:\u002F\u002Fgithub.com\u002Fapache\u002Fcauseway\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fopenspec-archive-change\u002FSKILL.md",[],[19,164,134,23,30,130,32,29,28,27,118,25],"openspec archive change"]