Agent skill
sse
Server-Sent Events implementation, streaming patterns, and real-time updates.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/sse-a5c-ai-babysitter
SKILL.md
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
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?