idorgham/gateflow/sse-streaming

Claude Code and agent skill by idorgham/gateflow

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Specialized workflows and patterns for sse-streaming.

Install

npx vskill@latest install idorgham/gateflow/sse-streaming

SKILL.md

The same SKILL.md was published earlier as idorgham/gateflow/sse-streaming.

SKILL: Server-Sent Events (SSE) Real-time Streaming

Purpose

Implement robust, unidirectional real-time data streams for the GateFlow v9.0 "Anomaly Feed" and "Mission Workspace" alerts.

Core Principles

  1. Unidirectional Power: Use SSE for low-latency updates from server-to-client (simpler than WebSockets for most dashboard needs).
  2. Auto-Reconnect: Clients must handle connection drops with exponential backoff.
  3. Event Segmentation: Deliver small, incremental updates (deltas) rather than re-sending full datasets.

Implementation Rules

  • Headers: Use Content-Type: text/event-stream.
  • Heartbeats: Send a "ping" comment every 15-30 seconds to keep the connection alive.
  • Organization Filtering: Ensure streaming events are strictly filtered by organizationId.

Anti-Patterns

  • Maintaining open connections for inactive/minimized tabs (use Page Visibility API to close/re-open).
  • Sending huge payloads (>10KB) via SSE.
  • Not handling terminal errors on the server (leading to memory leaks).

Code Examples

Next.js SSE Route
typescript
export async function GET(req: Request) {
const stream = new ReadableStream({
start(controller) {
const ping = setInterval(() => {
controller.enqueue('event: ping\ndata: {}\n\n');
}, 30000);
// Listen to Redis/DB change events
eventBus.on('new-alert', (data) => {
controller.enqueue(
`event: new-alert\ndata: ${JSON.stringify(data)}\n\n`
);
});
req.signal.addEventListener('abort', () => {
clearInterval(ping);
controller.close();
});
},
});
return new Response(stream, {
headers: { 'Content-Type': 'text/event-stream' },
});
}
React Subscriber Hook
tsx
const useSSE = (url) => {
useEffect(() => {
const eventSource = new EventSource(url);
eventSource.addEventListener('new-alert', (e) => {
setAlerts((prev) => [JSON.parse(e.data), ...prev]);
});
return () => eventSource.close();
}, [url]);
};

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
4
7-day trend score
13

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Grok Build (Cursor)
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/idorgham/gateflow/sse-streaming/badge)](https://verified-skill.com/skills/idorgham/gateflow/sse-streaming)

Something wrong with this skill or its page? Tell us.