add-resource-events

Add real-time SSE event emission to resource services with per-user authorization.

1|Updated May 21, 2025
One-click install
npx skills add https://github.com/madooei/backend-template --skill add-resource-events
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-resource-events
Source: https://github.com/madooei/backend-template/tree/main/.claude/skills/add-resource-events
Command: npx skills add https://github.com/madooei/backend-template --skill add-resource-events

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Add real-time event emission to a resource service to enable SSE-based live updates across clients.

Core Features & Use Cases

  • BaseService integration via emitEvent() to broadcast resource changes
  • Per-resource event routing (e.g., notes:created, notes:updated, notes:deleted)
  • SSE-enabled event stream with authorization guards for connected clients

Quick Start

Extend your resource service from BaseService, emit events after successful CRUD operations, and expose an SSE route for clients to listen.

Frequently Asked Questions about add-resource-events

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add real-time SSE event emission to a backend resource service?

To add SSE event emission, extend your backend resource service from BaseService, use an event emitter to broadcast changes after CRUD operations, and expose an SSE route for client subscription.

Can I set up per-user authorization for SSE streams in a resource service?

Yes, the SSE event stream uses an events router with authorization guards to verify connected clients, ensuring per-user authorization before delivering resource events.

How do I broadcast resource changes like created, updated, and deleted events via SSE?

You broadcast resource changes by calling the emitEvent() method after successful CRUD operations, routing events like notes:created or notes:updated to the SSE stream.

Does this SSE event emission approach work for common resource services like notes or tasks?

Yes, this approach is designed to cover common resource services such as notes or tasks, allowing clients to subscribe to created, updated, and deleted events.

What is required to enable SSE live updates across clients for a resource service?

Enabling SSE live updates requires extending BaseService, integrating an event emitter for resource changes, and implementing a guarded events router for per-user authorization.

Why do I need to extend BaseService to enable SSE streams for resource services?

Extending BaseService is required to standardize event emission via emitEvent(), allowing the resource service to broadcast CRUD changes to the SSE stream with authorization guards.