Agent skill · Frontend

agentsop-streaming-output

Enhancement-overlay decision protocol for STREAMING the output of long-running LLM / agent runs from the *backend*, not just wiring a typing animation in the UI. Activates when a coder agent must stream final tokens to a chat client, surface intermediate agent steps (which tool, which node, partial reasoning), emit custom tool-progress events, choose a transport (SSE vs WebSocket), or decide what to do when the client disconnects mid-stream. The langchain / langgraph skills mention stream modes but stop at "you can stream"; this skill encodes *what to stream, over what transport, and how to fa

agentsopegithub.com/agentsopeGitHub ↗
claude-codeMIT
Install
npx skills add agentsope/SkillAlchemy --skill agentsop-streaming-output --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 4
SKILL.md size: 21 KB
Bundled scripts: none
Version: 0.1.0
Path: skills/agentsop-streaming-output/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 255
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

Defines an enhancement overlay for streaming the output of long-running LLM/agent runs from the backend, including final chat tokens, intermediate agent steps, and custom progress events. It also selects transport (SSE vs WebSocket) and handles client disconnects, with guidance on safe streaming and demuxing on a single connection.

How it works

  • Activation rules specify when streaming is warranted and what surfaces to stream (chat final tokens, agent steps, custom progress).
  • Core mental model emphasizes streaming only what the user needs to see across three audiences: chat final tokens, agent step updates, and progress events; tokens, updates, and custom events are demultiplexed on one wire using a multi-mode stream.
  • Workflow steps include:
    • Step 1: Confirm streaming is warranted based on waiting user and run length.
    • Step 2: Classify surface to projection (messages, updates, custom, values, or debug).
    • Step 3: Pick transport (SSE for receive-only, WebSocket for bidirectional, or async generator/gRPC for non-HTTP endpoints).
    • Step 4: Mix token and step streams on one connection with explicit tags (messages, updates, custom).
    • Step 5: Decide disconnect policy (cancel vs detach) before shipping.
    • Step 6: Add backpressure and heartbeat (keep-alive ping, buffer handling, flush settings).
  • Operational models describe concrete OP-1 to OP-8 actions, such as streaming final tokens, streaming intermediate steps, emitting custom progress, multiplexing modes, choosing transport, handling disconnects, keeping connections alive, and filtering firehose to final answers.

When to use it

Activates when a long-running run is streaming output to a chat or UI, when you need to surface intermediate steps or progress, or when choosing between SSE and WebSocket transports. It should not activate for fast (<1s) completions, batch/offline jobs, or purely frontend animation questions.

What it can touch

Involves multiple components and tools: LangGraph, LangChain, OpenAI/Anthropic streaming APIs, and SSE/WebSocket transports. The skill uses and references graph.astream with stream_mode, and emits events via SSE or WebSocket, tagging events as "messages", "updates", or "custom".

Caveats

Includes guidance on disconnect behavior, backpressure, and heartbeat strategies to avoid zombie runs and maintain UX. It cautions against interleaving untagged semantic streams and emphasizes demux on the client side via named SSE events. References to external standards are included for event streaming semantics.

From the SKILL.md

# Streaming Tool/Agent Output · SOP (Enhancement Overlay) > Source posture: every non-trivial claim is cited inline. Short tags like > `[lg/stream]`, `[lc/astream-events]`, `[oai/stream]`, `[anthropic/stream]`, > `[mdn/sse]` resolve against `references/R1-source-evidence.md`. > > This is an **ENHANCE overlay**: it sits on top of `[[agentsop-langgraph]]` (which > names the four stream modes but treats streaming as one of ten operations) and > `[[langchain]]`. Read those for the orchestration; read this for the > streaming SOP. Cross-link: `[[agentsop-langgraph]]` OP-8. --- ## 何时激活 (Activation Rules) Activate when **any** of these fire: - The run is **long** (multi-second to multi-minute agent loop, RAG over many docs, multi-tool chain) and the user is **waiting** — perceived latency, not total latency, is the product metric. - The user asks to "stream the response", "show a typing effect", "show progress", "show which tool the agent is running", or "show the chain of thought". - You are building a **chat** surface (stream final tokens) OR an **agent** surface (stream intermediate steps: node entered, tool called, partial state) OR a **long task** surface (stream custom progress like

What's inside
Steps it walks through
  1. 何时激活 (Activation Rules)
  2. 核心心智模型 (Core Mental Model)
  3. SOP 工作流 (Agentic Protocol)
  4. Step 1 · Confirm streaming is warranted
  5. Step 2 · Classify the surface → pick the projection
  6. Step 3 · Pick the transport
  7. Step 4 · Mix token + step streams on one wire
  8. Step 5 · Decide disconnect policy before shipping
  9. Step 6 · Add backpressure + heartbeat before production
  10. 操作模型 (Operation Models)
  11. OP-1 · Stream final tokens to a chat client (the 80% case)
  12. OP-2 · Stream intermediate agent steps
  13. OP-3 · Emit custom in-tool progress
  14. OP-4 · Multiplex modes on one SSE connection
Ships with 3 files
  • README.md
  • intermediate/operation_candidates.json
  • references/R1-source-evidence.md
More from SkillAlchemy
All skills →
About this skill
What does the agentsop-streaming-output skill do?

Enhancement-overlay decision protocol for STREAMING the output of long-running LLM / agent runs from the *backend*, not just wiring a typing animation in the UI. Activates when a coder agent must stream final tokens to a chat client, surface intermediate agent steps (which tool, which node, partial reasoning), emit custom tool-progress events, choose a transport (SSE vs WebSocket), or decide what to do when the client disconnects mid-stream. The langchain / langgraph skills mention stream modes but stop at "you can stream"; this skill encodes *what to stream, over what transport, and how to fa

How do I install it?

Run `npx skills add agentsope/SkillAlchemy --skill agentsop-streaming-output --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From agentsope/SkillAlchemy, a repository with 255 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going