agentsclimarketplace

Sse

Skill a5c-ai/babysitter/library/specializations/web-development/skills/sse

Server-Sent Events implementation, streaming patterns, and real-time updates.From its SKILL.md

Install
npx -y skills add a5c-ai/babysitter --skill sse

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

SKILL.md

1.8 KB, 338 tokens by cl100k_base, as published. Nobody here has run it

SSE Skill

Expert assistance for implementing Server-Sent Events for real-time streaming.

Capabilities

  • Implement SSE endpoints
  • Handle streaming responses
  • Manage client connections
  • Build event-driven updates
  • Implement reconnection

Usage

Invoke this skill when you need to:

  • Stream updates to clients
  • Implement live feeds
  • Build notification systems
  • One-way real-time communication

Implementation

// Server
app.get('/events', (req, res) => {
  res.setHeader('Content-Type', 'text/event-stream');
  res.setHeader('Cache-Control', 'no-cache');
  res.setHeader('Connection', 'keep-alive');

  const sendEvent = (event: string, data: object) => {
    res.write(`event: ${event}\n`);
    res.write(`data: ${JSON.stringify(data)}\n\n`);
  };

  // Send initial data
  sendEvent('connected', { timestamp: Date.now() });

  // Subscribe to updates
  const unsubscribe = eventEmitter.on('update', (data) => {
    sendEvent('update', data);
  });

  req.on('close', () => {
    unsubscribe();
  });
});

// Client
const eventSource = new EventSource('/events');

eventSource.addEventListener('update', (event) => {
  const data = JSON.parse(event.data);
  console.log('Update:', data);
});

Best Practices

  • Handle reconnection
  • Use event types for routing
  • Implement keep-alive
  • Clean up on disconnect

Target Processes

  • real-time-updates
  • live-feeds
  • notification-systems

What ships with it: 1 file

625 B alongside SKILL.md

Keep looking

Skills are one crate of 326,059. 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.