{"id":"22ecb29c-9aca-4d05-985d-3b69102440c9","shortId":"xSgETu","kind":"skill","title":"nonblocking-post-connect-capability-broadcast","tagline":"Commit the connected state first, then gather optional capabilities and send a post-connect broadcast asynchronously without delaying readiness.","description":"# SKILL: Nonblocking Post-Connect Capability Broadcast\n**Domain:** bridge-lifecycle\n**Trigger:** Apply when a transport has reached its ready or connected state, but optional capability discovery and hello metadata still need to be broadcast to the remote peer.\n**Source Pattern:** Distilled from reviewed bridge-lifecycle, capability-broadcast, and reconnect-flow implementations.\n\n## Core Method\nTreat connection visibility and capability advertisement as two separate phases. In the state-change handler, synchronously commit the host's connected/session-active flags first so the UI and downstream effects can react immediately. Only after that state commit should you launch a detached async task that resolves optional capabilities, re-checks cancellation or liveness, snapshots any current state needed for the payload, and sends the post-connect broadcast. Keep the late path best-effort: if capability loading or broadcast assembly fails, log it locally and leave the connection marked ready.\n\n## Key Rules\n- Commit the connected or session-active state before awaiting any optional capability load; readiness must not depend on slow skill or metadata discovery.\n- Run the post-connect broadcast in fire-and-forget async work guarded by a local `try`/`catch` so failures do not bubble back into the connection transition.\n- Re-check cancellation or handle liveness after the awaited capability work and before writing to the transport; the peer may already be gone.\n- Read mutable payload state as late as practical inside the async task so the broadcast reflects the current permission mode, agents, or feature flags rather than a stale pre-await snapshot.\n- Keep the broadcast path optional and feature-gated when the metadata is additive rather than required for connection correctness.\n\n## Example Application\nWhen a mobile or web client connects to a background bridge, flip the app state to `connected` immediately so forwarding and UI badges start right away. Then, in a detached async block, load the bridge-safe skill list, collect the latest runtime metadata, and send one `system/init` message. If that late load fails, record the error, but do not bounce the session back out of `connected`.\n\n## Anti-Patterns (What NOT to do)\n- Do not await capability discovery before setting the connected state; that turns optional metadata into user-visible connection latency.\n- Do not clear or roll back the connected flag just because the late capability broadcast fails; the transport can still be healthy.\n- Do not capture all payload state before the async work and reuse it blindly after awaits; you risk broadcasting stale session metadata.","tags":["nonblocking","post","connect","capability","broadcast","cskill","agents","ychampion","agent-skills","ai-agents","cli","coding-agents"],"capabilities":["skill","source-ychampion","skill-nonblocking-post-connect-capability-broadcast","topic-agent-skills","topic-ai-agents","topic-cli","topic-coding-agents","topic-context-engineering","topic-developer-tools","topic-mcp","topic-multi-agent","topic-terminal-ui"],"categories":["cskill-agents"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/ychampion/cskill-agents/nonblocking-post-connect-capability-broadcast","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add ychampion/cskill-agents","source_repo":"https://github.com/ychampion/cskill-agents","install_from":"skills.sh"}},"qualityScore":"0.467","qualityRationale":"deterministic score 0.47 from registry signals: · indexed on github topic:agent-skills · 34 github stars · SKILL.md body (2,657 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T00:56:53.269Z","embedding":null,"createdAt":"2026-04-18T22:20:49.517Z","updatedAt":"2026-04-22T00:56:53.269Z","lastSeenAt":"2026-04-22T00:56:53.269Z","tsv":"'activ':185 'addit':301 'advertis':89 'agent':276 'alreadi':253 'anti':378 'anti-pattern':377 'app':323 'appli':39 'applic':309 'assembl':166 'async':127,214,266,340,434 'asynchron':23 'await':188,241,286,386,441 'away':335 'back':227,373,409 'background':319 'badg':332 'best':159 'best-effort':158 'blind':439 'block':341 'bounc':370 'bridg':36,72,320,345 'bridge-lifecycl':35,71 'bridge-saf':344 'broadcast':6,22,33,61,76,153,165,208,270,290,418,444 'bubbl':226 'cancel':136,235 'capability-broadcast':74 'capabl':5,15,32,52,75,88,132,162,191,242,387,417 'captur':428 'catch':221 'chang':98 'check':135,234 'clear':406 'client':315 'collect':349 'commit':7,101,121,179 'connect':4,9,21,31,48,85,152,174,181,207,230,306,316,326,376,392,402,411 'connected/session-active':105 'core':82 'correct':307 'current':141,273 'delay':25 'depend':196 'detach':126,339 'discoveri':53,202,388 'distil':68 'domain':34 'downstream':112 'effect':113 'effort':160 'error':366 'exampl':308 'fail':167,363,419 'failur':223 'featur':278,295 'feature-g':294 'fire':211 'fire-and-forget':210 'first':11,107 'flag':106,279,412 'flip':321 'flow':80 'forget':213 'forward':329 'gate':296 'gather':13 'gone':255 'guard':216 'handl':237 'handler':99 'healthi':425 'hello':55 'host':103 'immedi':116,327 'implement':81 'insid':264 'keep':154,288 'key':177 'late':156,261,361,416 'latenc':403 'latest':351 'launch':124 'leav':172 'lifecycl':37,73 'list':348 'live':138,238 'load':163,192,342,362 'local':170,219 'log':168 'mark':175 'may':252 'messag':358 'metadata':56,201,299,353,397,447 'method':83 'mobil':312 'mode':275 'must':194 'mutabl':257 'need':58,143 'nonblock':2,28 'nonblocking-post-connect-capability-broadcast':1 'one':356 'option':14,51,131,190,292,396 'path':157,291 'pattern':67,379 'payload':146,258,430 'peer':65,251 'permiss':274 'phase':93 'post':3,20,30,151,206 'post-connect':19,29,150,205 'practic':263 'pre':285 'pre-await':284 'rather':280,302 're':134,233 're-check':133,232 'reach':44 'react':115 'read':256 'readi':26,46,176,193 'reconnect':79 'reconnect-flow':78 'record':364 'reflect':271 'remot':64 'requir':304 'resolv':130 'reus':437 'review':70 'right':334 'risk':443 'roll':408 'rule':178 'run':203 'runtim':352 'safe':346 'send':17,148,355 'separ':92 'session':184,372,446 'session-act':183 'set':390 'skill':27,199,347 'skill-nonblocking-post-connect-capability-broadcast' 'slow':198 'snapshot':139,287 'sourc':66 'source-ychampion' 'stale':283,445 'start':333 'state':10,49,97,120,142,186,259,324,393,431 'state-chang':96 'still':57,423 'synchron':100 'system/init':357 'task':128,267 'topic-agent-skills' 'topic-ai-agents' 'topic-cli' 'topic-coding-agents' 'topic-context-engineering' 'topic-developer-tools' 'topic-mcp' 'topic-multi-agent' 'topic-terminal-ui' 'transit':231 'transport':42,249,421 'treat':84 'tri':220 'trigger':38 'turn':395 'two':91 'ui':110,331 'user':400 'user-vis':399 'visibl':86,401 'web':314 'without':24 'work':215,243,435 'write':246","prices":[{"id":"ee62abf9-de27-45ae-b7e5-afa887476a9d","listingId":"22ecb29c-9aca-4d05-985d-3b69102440c9","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"ychampion","category":"cskill-agents","install_from":"skills.sh"},"createdAt":"2026-04-18T22:20:49.517Z"}],"sources":[{"listingId":"22ecb29c-9aca-4d05-985d-3b69102440c9","source":"github","sourceId":"ychampion/cskill-agents/nonblocking-post-connect-capability-broadcast","sourceUrl":"https://github.com/ychampion/cskill-agents/tree/main/skills/nonblocking-post-connect-capability-broadcast","isPrimary":false,"firstSeenAt":"2026-04-18T22:20:49.517Z","lastSeenAt":"2026-04-22T00:56:53.269Z"}],"details":{"listingId":"22ecb29c-9aca-4d05-985d-3b69102440c9","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"ychampion","slug":"nonblocking-post-connect-capability-broadcast","github":{"repo":"ychampion/cskill-agents","stars":34,"topics":["agent-skills","ai-agents","cli","coding-agents","context-engineering","developer-tools","mcp","multi-agent","terminal-ui"],"license":"mit","html_url":"https://github.com/ychampion/cskill-agents","pushed_at":"2026-04-04T14:13:23Z","description":"Agent skills for coding CLIs, multi-agent runtimes, context engines, MCP extensions, and terminal tooling. Instead of using claude code's source code, give your agent skills to create your own!","skill_md_sha":"4e9d48de92cf067cc7f88be9856e4ebcbd7b660f","skill_md_path":"skills/nonblocking-post-connect-capability-broadcast/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/ychampion/cskill-agents/tree/main/skills/nonblocking-post-connect-capability-broadcast"},"layout":"multi","source":"github","category":"cskill-agents","frontmatter":{"name":"nonblocking-post-connect-capability-broadcast","description":"Commit the connected state first, then gather optional capabilities and send a post-connect broadcast asynchronously without delaying readiness."},"skills_sh_url":"https://skills.sh/ychampion/cskill-agents/nonblocking-post-connect-capability-broadcast"},"updatedAt":"2026-04-22T00:56:53.269Z"}}