[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69AF9501PNSDFNDRY6C9QFC":3,"skill-same:01M69AF9501PNSDFNDRY6C9QFC":85},{"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":24,"linkOnly":25,"markdownContent":26,"markdownBody":27,"frontMatter":28,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":34,"ownerHtmlUrl":35,"ownerBlogUrl":36,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M69AF9501PNSDFNDRY6C9QFC","build-ahp-client",null,"Implement or review an SDK-backed Agent Host Protocol client application, including initialization, subscriptions, immutable reducer state, reconnect cleanup, multi-host behavior, and UI-friendly projections. Use for browser, TypeScript, desktop, or other client consumers, not for host internals or protocol contract changes.","microsoft\u002Fagent-host-protocol-contrib","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M69AF73MFMMND7YZVT4F00XV",1,"MIT","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fagent-host-protocol-contrib\u002Fblob\u002Fmain\u002Fplugins\u002Fahp-development\u002Fskills\u002Fbuild-ahp-client\u002FSKILL.md",[],[19,20,21,22,23],"build ahp client","review","typescript","sdk","implement","2026-11-10 10:12:30",false,"---\nname: build-ahp-client\ndescription: Implement or review an SDK-backed Agent Host Protocol client application, including initialization, subscriptions, immutable reducer state, reconnect cleanup, multi-host behavior, and UI-friendly projections. Use for browser, TypeScript, desktop, or other client consumers, not for host internals or protocol contract changes.\nlicense: MIT\n---\n\n# Build an AHP Client\n\nUse this skill when consuming AHP from an application or client integration.\nIt applies naturally to TypeScript and browser clients, but the state and\ntransport rules are cross-language.\n\n## Use this \u002F use another skill\n\n| Use this skill | Use another skill |\n| --- | --- |\n| The client must connect, initialize, subscribe, render, dispatch, or reconnect. | Use `build-ahp-host` for server routing, persistence, fan-out, or model execution. |\n| You need a new action, state field, wire command, or compatibility rule. | Use `design-ahp-protocol` before changing the contract. |\n| You are authoring raw WebSocket black-box probes or fixture-driven conformance coverage. | Use `test-ahp-conformance`. |\n\n## Ground in the active protocol\n\n1. Identify the current AHP version, SDK release, and target host capabilities.\n   Read the protocol's lifecycle, subscriptions, reconciliation, state-model,\n   and versioning documentation plus the generated client APIs.\n2. Find existing connection, store, reducer, and projection code in the\n   repository. Reuse the SDK's client, transport, state mirror, and canonical\n   reducers when they fit instead of duplicating wire handling.\n3. If protocol source is not in the workspace, consult the upstream\n   `microsoft\u002Fagent-host-protocol` documentation and schemas. Never assume a\n   particular local checkout exists.\n4. Separate AHP guarantees from local product policy: reconnect backoff, UI\n   limits, retention assumptions, and a particular host's unsupported surfaces\n   are not portable requirements.\n\n## Design the client state boundary\n\nMaintain a protocol layer and a presentation layer:\n\n| Layer | Responsibility |\n| --- | --- |\n| Transport\u002Fclient | Connection lifecycle, JSON-RPC requests, subscriptions, and shutdown |\n| Protocol store | Typed snapshots, ordered envelopes, canonical reducers, sequence tracking |\n| Projection | Fresh immutable view models, sort\u002Ffilter\u002Fformat policy, UI selection state |\n| UI | Renders projections and invokes application commands; never mutates protocol maps |\n\nKeep snapshots typed by channel\u002Fstate rather than treating all JSON as one\nuntyped store. Treat the server's action envelope as authoritative and route it\nusing its channel URI. Do not invent a channel from fields on the inner action.\n\n## Connection and subscription flow\n\n1. Create one durable client identity per logical client according to the\n   protocol, then open the selected host transport.\n2. Initialize with the SDK's supported protocol-version list, root channel,\n   and useful initial subscriptions. Record the selected version and each\n   snapshot's `fromSeq`\u002Fserver sequence.\n3. Attach local subscription consumers before or as the SDK requires so no\n   actions are lost between handshake and consumption. Close them deliberately\n   when the user leaves a resource or disconnects.\n4. Subscribe on demand to session, chat, or other resources. Apply a returned\n   snapshot before relying on later actions, and retain the desired\n   subscription set for reconnect.\n5. Fetch or list catalog data where the protocol requires it. Do not depend on\n   ephemeral notifications being replayed.\n\n## Reduce and reconcile correctly\n\n- Apply only envelopes newer than the last observed `serverSeq`; update the\n  sequence monotonically.\n- Use immutable reducers and immutable\u002Ffrozen UI projections. Mutable SDK\n  mirrors or maps are protocol internals, not React or UI snapshots.\n- If using optimistic dispatch, keep confirmed state and ordered pending\n  actions separately. Match your own authoritative echo, rebase remaining\n  actions over foreign\u002Fserver changes, and remove\u002Frevert a rejected action.\n- Respect terminal turn states. A cancel affordance should not make a late\n  delta or completion appear valid after the host has terminated the turn.\n- Keep multi-host data isolated by connection\u002Fhost identity. Reset or\n  namespace state, sequence numbers, subscriptions, and selected resources\n  when switching hosts.\n\n## Reconnect without stale events\n\nUse a connection epoch\u002Ftoken (or equivalent ownership guard):\n\n1. Invalidate the old epoch before closing a socket or starting another.\n2. Close async iterators and subscriptions from the old client.\n3. Ignore delayed callbacks, errors, and action streams unless they still\n   belong to the current epoch and current client.\n4. Reconnect with the durable client ID, last observed sequence, and desired\n   subscriptions.\n5. If the host returns replay, reduce every envelope in order; if it returns\n   snapshots because the replay gap is unavailable, replace confirmed state and\n   clear\u002Freconcile pending work as the protocol requires. Remove resources\n   named missing by the host.\n6. Re-fetch catalog state after reconnect because protocol notifications are\n   not replayed.\n\nFor configurable agents, render the host's `SessionModelInfo.configSchema` and\nsession configuration schema instead of hardcoding provider-specific values.\nUse `resolveSessionConfig` and `sessionConfigCompletions`, preserve unknown\nconfiguration entries when editing known ones, and attach the effective\n`ModelSelection` to the user message so history records what actually ran.\n\n## Validate and document\n\nTest the smallest layer first: reducer\u002Fprojection purity, sequence rejection,\nand epoch cleanup. Then test initialization, delayed subscription events,\nreconnect replay and snapshot fallback, two-client updates, host switching, and\ncancel\u002Ferror rendering. Run the application's broader typecheck\u002Fbuild\u002Ftests\nafter focused tests pass.\n\nDocument unsupported host capabilities, degraded UI behavior, and intentional\nlocal policy. Stop when an old socket cannot update the new connection and the\nUI always sees a fresh immutable projection of authoritative protocol state.\n","# Build an AHP Client\n\nUse this skill when consuming AHP from an application or client integration.\nIt applies naturally to TypeScript and browser clients, but the state and\ntransport rules are cross-language.\n\n## Use this \u002F use another skill\n\n| Use this skill | Use another skill |\n| --- | --- |\n| The client must connect, initialize, subscribe, render, dispatch, or reconnect. | Use `build-ahp-host` for server routing, persistence, fan-out, or model execution. |\n| You need a new action, state field, wire command, or compatibility rule. | Use `design-ahp-protocol` before changing the contract. |\n| You are authoring raw WebSocket black-box probes or fixture-driven conformance coverage. | Use `test-ahp-conformance`. |\n\n## Ground in the active protocol\n\n1. Identify the current AHP version, SDK release, and target host capabilities.\n   Read the protocol's lifecycle, subscriptions, reconciliation, state-model,\n   and versioning documentation plus the generated client APIs.\n2. Find existing connection, store, reducer, and projection code in the\n   repository. Reuse the SDK's client, transport, state mirror, and canonical\n   reducers when they fit instead of duplicating wire handling.\n3. If protocol source is not in the workspace, consult the upstream\n   `microsoft\u002Fagent-host-protocol` documentation and schemas. Never assume a\n   particular local checkout exists.\n4. Separate AHP guarantees from local product policy: reconnect backoff, UI\n   limits, retention assumptions, and a particular host's unsupported surfaces\n   are not portable requirements.\n\n## Design the client state boundary\n\nMaintain a protocol layer and a presentation layer:\n\n| Layer | Responsibility |\n| --- | --- |\n| Transport\u002Fclient | Connection lifecycle, JSON-RPC requests, subscriptions, and shutdown |\n| Protocol store | Typed snapshots, ordered envelopes, canonical reducers, sequence tracking |\n| Projection | Fresh immutable view models, sort\u002Ffilter\u002Fformat policy, UI selection state |\n| UI | Renders projections and invokes application commands; never mutates protocol maps |\n\nKeep snapshots typed by channel\u002Fstate rather than treating all JSON as one\nuntyped store. Treat the server's action envelope as authoritative and route it\nusing its channel URI. Do not invent a channel from fields on the inner action.\n\n## Connection and subscription flow\n\n1. Create one durable client identity per logical client according to the\n   protocol, then open the selected host transport.\n2. Initialize with the SDK's supported protocol-version list, root channel,\n   and useful initial subscriptions. Record the selected version and each\n   snapshot's `fromSeq`\u002Fserver sequence.\n3. Attach local subscription consumers before or as the SDK requires so no\n   actions are lost between handshake and consumption. Close them deliberately\n   when the user leaves a resource or disconnects.\n4. Subscribe on demand to session, chat, or other resources. Apply a returned\n   snapshot before relying on later actions, and retain the desired\n   subscription set for reconnect.\n5. Fetch or list catalog data where the protocol requires it. Do not depend on\n   ephemeral notifications being replayed.\n\n## Reduce and reconcile correctly\n\n- Apply only envelopes newer than the last observed `serverSeq`; update the\n  sequence monotonically.\n- Use immutable reducers and immutable\u002Ffrozen UI projections. Mutable SDK\n  mirrors or maps are protocol internals, not React or UI snapshots.\n- If using optimistic dispatch, keep confirmed state and ordered pending\n  actions separately. Match your own authoritative echo, rebase remaining\n  actions over foreign\u002Fserver changes, and remove\u002Frevert a rejected action.\n- Respect terminal turn states. A cancel affordance should not make a late\n  delta or completion appear valid after the host has terminated the turn.\n- Keep multi-host data isolated by connection\u002Fhost identity. Reset or\n  namespace state, sequence numbers, subscriptions, and selected resources\n  when switching hosts.\n\n## Reconnect without stale events\n\nUse a connection epoch\u002Ftoken (or equivalent ownership guard):\n\n1. Invalidate the old epoch before closing a socket or starting another.\n2. Close async iterators and subscriptions from the old client.\n3. Ignore delayed callbacks, errors, and action streams unless they still\n   belong to the current epoch and current client.\n4. Reconnect with the durable client ID, last observed sequence, and desired\n   subscriptions.\n5. If the host returns replay, reduce every envelope in order; if it returns\n   snapshots because the replay gap is unavailable, replace confirmed state and\n   clear\u002Freconcile pending work as the protocol requires. Remove resources\n   named missing by the host.\n6. Re-fetch catalog state after reconnect because protocol notifications are\n   not replayed.\n\nFor configurable agents, render the host's `SessionModelInfo.configSchema` and\nsession configuration schema instead of hardcoding provider-specific values.\nUse `resolveSessionConfig` and `sessionConfigCompletions`, preserve unknown\nconfiguration entries when editing known ones, and attach the effective\n`ModelSelection` to the user message so history records what actually ran.\n\n## Validate and document\n\nTest the smallest layer first: reducer\u002Fprojection purity, sequence rejection,\nand epoch cleanup. Then test initialization, delayed subscription events,\nreconnect replay and snapshot fallback, two-client updates, host switching, and\ncancel\u002Ferror rendering. Run the application's broader typecheck\u002Fbuild\u002Ftests\nafter focused tests pass.\n\nDocument unsupported host capabilities, degraded UI behavior, and intentional\nlocal policy. Stop when an old socket cannot update the new connection and the\nUI always sees a fresh immutable projection of authoritative protocol state.\n",{"name":5,"license":15,"description":7},"main","cfdd74a4b9aa5710d2bee3ebbdac587f7a13f3e5","plugins\u002Fahp-development\u002Fskills\u002Fbuild-ahp-client",0,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fagent-host-protocol-contrib","https:\u002F\u002Fmicrosoft.github.io\u002Fagent-host-protocol\u002F","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-04 11:16:20",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add microsoft\u002Fagent-host-protocol-contrib --skill build-ahp-client",{"tool":45,"command":46},"bunx","bunx skills add microsoft\u002Fagent-host-protocol-contrib --skill build-ahp-client",{"tool":48,"command":49},"pnpm","pnpm dlx skills add microsoft\u002Fagent-host-protocol-contrib --skill build-ahp-client","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fagent-host-protocol-contrib\u002Fblob\u002Fmain\u002Fplugins\u002Fahp-development\u002Fskills\u002Fbuild-ahp-client\u002FSKILL.md",true,[53,59,63,67,73,77,81],{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"assets\u002Fimplementation-template.md","ASSET","资产文件",800,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fgoogle-cloud-solution-build-deploy-agents\u002Fassets\u002Fimplementation-template.md",{"path":60,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":61,"sourceHtmlUrl":62},"assets\u002Fsolution-template.md",5023,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fgoogle-cloud-solution-build-deploy-agents\u002Fassets\u002Fsolution-template.md",{"path":64,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":65,"sourceHtmlUrl":66},"assets\u002Fvalidation-template.md",2162,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fgoogle-cloud-solution-build-deploy-agents\u002Fassets\u002Fvalidation-template.md",{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Fattribution.md","REFERENCE","参考文档",1971,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fgoogle-cloud-solution-build-deploy-agents\u002Freferences\u002Fattribution.md",{"path":74,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Fdesign-principles.md",4011,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fgoogle-cloud-solution-build-deploy-agents\u002Freferences\u002Fdesign-principles.md",{"path":78,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Fproduct-mappings.md",10600,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fgoogle-cloud-solution-build-deploy-agents\u002Freferences\u002Fproduct-mappings.md",{"path":82,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Frelated-guidance.md",5243,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fgoogle-cloud-solution-build-deploy-agents\u002Freferences\u002Frelated-guidance.md",[86,103,122],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":97,"publishedAt":24},"01M69AFEK5JE1BA30TTAMKZABV","test-ahp-conformance","Create or review black-box Agent Host Protocol conformance tests, including deterministic model fixtures, lifecycle and error cases, multi-client and restart coverage, bounded timeouts, and CLI\u002FHTML reports with optional JSON results. Use for observable interoperability testing, not for changing protocol design or implementing host\u002Fclient production code.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fagent-host-protocol-contrib\u002Fblob\u002Fmain\u002Fplugins\u002Fahp-development\u002Fskills\u002Ftest-ahp-conformance\u002FSKILL.md",[92],{"categoryNo":93,"categoryName":94,"taxonomyType":95,"taxonomyTypeDesc":96},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[98,99,100,101,20,102],"test","test ahp conformance","testing","design","cli",{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":120,"publishedAt":24},"01M69AFCRAMS3FCCC939QD19Y3","design-ahp-protocol","Design or review Agent Host Protocol commands, actions, state, errors, reducers, schemas, code generation, versioning, compatibility, and multi-client invariants. Use when changing the AHP contract or assessing a protocol-level design, not when implementing only one host, client, or test suite.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fagent-host-protocol-contrib\u002Fblob\u002Fmain\u002Fplugins\u002Fahp-development\u002Fskills\u002Fdesign-ahp-protocol\u002FSKILL.md",[109,112,117],{"categoryNo":110,"categoryName":111,"taxonomyType":95,"taxonomyTypeDesc":96},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":113,"categoryName":114,"taxonomyType":115,"taxonomyTypeDesc":116},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",{"categoryNo":118,"categoryName":119,"taxonomyType":115,"taxonomyTypeDesc":116},"01JBSEEDCAT000000000000037","律师与法务",[101,121,20,98],"design ahp protocol",{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":24},"01M69AFB3QY85TDMW0KFD4VQHN","build-ahp-host","Implement or review an Agent Host Protocol host or server, including JSON-RPC transport routing, subscriptions, serverSeq and reconnect, durable state, cancellation, concurrency, model adapters, and explicit unsupported behavior. Use for host architecture and server behavior, not for changing the AHP contract or building a client UI.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fagent-host-protocol-contrib\u002Fblob\u002Fmain\u002Fplugins\u002Fahp-development\u002Fskills\u002Fbuild-ahp-host\u002FSKILL.md",[],[129,20,23,130],"build ahp host","architecture"]