aurostack-org/stacks/add-realtime-event
Claude Code and agent skill by aurostack-org/stacks
- community
Checking that the SKILL.md file is still in the repository.
Add a Socket.IO event to this API — pushing a change to connected clients (a user, a room, a channel, everyone) or handling a message from them, with the right rooms and permissions. Use when asked to "push X live", "update the UI in real time", "notify connected users", "add a socket event", or for presence, typing indicators and live counters.
Install
npx vskill@latest install aurostack-org/stacks/add-realtime-eventSKILL.md
The same SKILL.md was published earlier as aurostack-org/stacks/add-realtime-event.
Add a realtime event
src/realtime/ holds the gateway (gateways/events.gateway.ts), the emitter (services/realtime.service.ts), presence, and the names everything shares (constants/index.ts).
Server → client (the common case)
- Name the event in
ServerEventinconstants/index.ts. The frontend
keeps the same list (realtime-events.ts); change both together, or the client never hears it.
- Emit from the service where the change happens, after it is committed:
```ts constructor(private readonly realtime: RealtimeService) {}
this.realtime.emitToRoom(channelRoom(thing.channelId), ServerEvent.ThingUpdated, ThingEntity.parse(thing)); ```
notifyUser(userId, payload)for one user's sockets,
emitToChannel, emitToFeed, emitToRoom(room, event, payload), broadcast(event, payload) for everyone.
- Parse the payload through its entity (
ThingEntity.parse(...)):
sockets bypass the HTTP serializer, so this is what keeps the event the same shape as the REST response.
- Emitting never throws and is a no-op before the gateway starts, so it
cannot fail the request that triggered it.
- Emit the minimum the client needs to update its cache, or just an id
and let it refetch.
Client → server
- Name it in
ClientEvent. - Handle it in
events.gateway.tswith@SubscribeMessage(ClientEvent.X).
The HTTP AuthGuard does not run for sockets: the gateway's WsAuthGuard authenticates, and every handler needs @WsPermissions({...}) for what it allows.
- Validate the payload with a Zod schema before using it.
Rooms
New room kinds get a helper beside userRoom / channelRoom. Never pass a client-supplied room string to `socket.join`: widen isJoinableRoom to allow exactly the new pattern, and check the user may join that specific room.
Check it by connecting a client (the frontend, or a socket.io client script) and watching the event arrive.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingtemplates/nest-api/files/.claude/skills/add-realtime-event/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- 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
[](https://verified-skill.com/skills/aurostack-org/stacks/add-realtime-event)