agentsclimarketplace

Nonblocking post connect capability broadcast

Skill ychampion/cskill-agents/agents/claude-code/skills/nonblocking-post-connect-capability-broadcast

Commit the connected state first, then gather optional capabilities and send a post-connect broadcast asynchronously without delaying readiness.From its SKILL.md

Install
npx -y skills add ychampion/cskill-agents --skill nonblocking-post-connect-capability-broadcast

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

2.8 KB, 501 tokens by cl100k_base, as published. Nobody here has run it

SKILL: Nonblocking Post-Connect Capability Broadcast

Domain: bridge-lifecycle 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. Source Pattern: Distilled from reviewed bridge-lifecycle, capability-broadcast, and reconnect-flow implementations.

Core Method

Treat 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.

Key Rules

  • Commit the connected or session-active state before awaiting any optional capability load; readiness must not depend on slow skill or metadata discovery.
  • 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.
  • Re-check cancellation or handle liveness after the awaited capability work and before writing to the transport; the peer may already be gone.
  • 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.
  • Keep the broadcast path optional and feature-gated when the metadata is additive rather than required for connection correctness.

Example Application

When 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.

Anti-Patterns (What NOT to do)

  • Do not await capability discovery before setting the connected state; that turns optional metadata into user-visible connection latency.
  • Do not clear or roll back the connected flag just because the late capability broadcast fails; the transport can still be healthy.
  • Do not capture all payload state before the async work and reuse it blindly after awaits; you risk broadcasting stale session metadata.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.