[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EBKH8ZPE3JE28ERYWXQBZX":3,"skill-same:01M6EBKH8ZPE3JE28ERYWXQBZX":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":46,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M6EBKH8ZPE3JE28ERYWXQBZX","nestjs-real-time",null,"WebSocket and SSE selection strategies and scaling. Use when implementing WebSocket gateways or Server-Sent Events in NestJS. (triggers: **\u002F*.gateway.ts, **\u002F*.controller.ts, WebSocketGateway, SubscribeMessage, Sse, Socket.io)","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Fnestjs-real-time\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],"nestjs","nestjs real time","time","real time","controller","websocket","sse","use","server","selection","gateways","strategies","scaling","triggers","io","events","gateway","2026-11-10 10:12:30",false,"---\nname: nestjs-real-time\ndescription: \"WebSocket and SSE selection strategies and scaling. Use when implementing WebSocket gateways or Server-Sent Events in NestJS. (triggers: **\u002F*.gateway.ts, **\u002F*.controller.ts, WebSocketGateway, SubscribeMessage, Sse, Socket.io)\"\n---\n\n# Real-Time & WebSockets\n\n## **Priority: P1 (OPERATIONAL)**\n\nWebSocket and real-time communication patterns with NestJS.\n\n- **WebSockets (Bi-directional)**: Use for Chat, Multiplayer Games, Collaborative Editing.\n  - _High Complexity_: Requires custom scaling (Redis Adapter) and sticky sessions (sometimes).\n- **Server-Sent Events (SSE) (Uni-directional)**: Use for Notifications, Live Feeds, Tickers, CI Log streaming.\n  - _Low Complexity_: Standard HTTP. Works with standard Load Balancers. Easy to secure.\n  - _NestJS_: Use `@Sse('route')` returning `Observable\u003CMessageEvent>`.\n- **Long Polling**: Use **only** as a fallback or for extremely low-frequency updates (e.g., job status check every 10m).\n  - _Impact_: High header overhead. Blocks threads if not handled carefully.\n\n## WebSockets Implementation\n\n- **Socket.io**: Default choice. Features \"Rooms\", \"Namespaces\", and automatic reconnection. Heavy protocol.\n- **Fastify\u002FWS**: Use `ws` adapter if performance is critical (e.g., high-frequency trading updates) and you don't need \"Rooms\" logic.\n\n## Scaling (Critical)\n\n- **WebSockets**: In K8s, a client connects to Pod A. If Pod B emits an event, the client won't receive it.\n  - **Solution**: **Redis Adapter** (`@socket.io\u002Fredis-adapter`). Every pod publishes to Redis; Redis distributes to all other pods.\n- **SSE**: Stateless. No special adapter needed, but be aware of **Connection Limits** (6 concurrent connections per domain in HTTP\u002F1.1; virtually unlimited in HTTP\u002F2).\n  - **Rule**: Must use **HTTP\u002F2** for SSE at scale.\n\n## Security\n\n- **Handshake Auth**: Standard HTTP Guards don't trigger on Ws connection efficiently.\n  - **Pattern**: Validate JWT during the `handleConnection()` lifecycle method. Disconnect immediately if invalid.\n- **Rate Limiting**: Sockets are expensive. Apply strict throttling on \"Message\" events to prevent flooding.\n\n## Architecture\n\n- **Gateway != Service**: The `WebSocketGateway` should **only** handle client comms (Join Room, Ack message).\n  - **Rule**: Delegate business logic to a Service or Command Bus.\n- **Events**: Use `AsyncApi` or `SocketApi` decorators (from community packages) to document WS events similarly to OpenAPI.\n\n\n## Anti-Patterns\n\n- **No HTTP guards for WebSocket auth**: Validate JWT in `handleConnection()`; HTTP guards don't trigger on WS.\n- **No WebSocket at scale without Redis adapter**: Without `@socket.io\u002Fredis-adapter`, cross-pod events are lost.\n- **No SSE over HTTP\u002F1.1 at scale**: Use HTTP\u002F2 to avoid the 6-connection-per-domain browser limit.\n\n","# Real-Time & WebSockets\n\n## **Priority: P1 (OPERATIONAL)**\n\nWebSocket and real-time communication patterns with NestJS.\n\n- **WebSockets (Bi-directional)**: Use for Chat, Multiplayer Games, Collaborative Editing.\n  - _High Complexity_: Requires custom scaling (Redis Adapter) and sticky sessions (sometimes).\n- **Server-Sent Events (SSE) (Uni-directional)**: Use for Notifications, Live Feeds, Tickers, CI Log streaming.\n  - _Low Complexity_: Standard HTTP. Works with standard Load Balancers. Easy to secure.\n  - _NestJS_: Use `@Sse('route')` returning `Observable\u003CMessageEvent>`.\n- **Long Polling**: Use **only** as a fallback or for extremely low-frequency updates (e.g., job status check every 10m).\n  - _Impact_: High header overhead. Blocks threads if not handled carefully.\n\n## WebSockets Implementation\n\n- **Socket.io**: Default choice. Features \"Rooms\", \"Namespaces\", and automatic reconnection. Heavy protocol.\n- **Fastify\u002FWS**: Use `ws` adapter if performance is critical (e.g., high-frequency trading updates) and you don't need \"Rooms\" logic.\n\n## Scaling (Critical)\n\n- **WebSockets**: In K8s, a client connects to Pod A. If Pod B emits an event, the client won't receive it.\n  - **Solution**: **Redis Adapter** (`@socket.io\u002Fredis-adapter`). Every pod publishes to Redis; Redis distributes to all other pods.\n- **SSE**: Stateless. No special adapter needed, but be aware of **Connection Limits** (6 concurrent connections per domain in HTTP\u002F1.1; virtually unlimited in HTTP\u002F2).\n  - **Rule**: Must use **HTTP\u002F2** for SSE at scale.\n\n## Security\n\n- **Handshake Auth**: Standard HTTP Guards don't trigger on Ws connection efficiently.\n  - **Pattern**: Validate JWT during the `handleConnection()` lifecycle method. Disconnect immediately if invalid.\n- **Rate Limiting**: Sockets are expensive. Apply strict throttling on \"Message\" events to prevent flooding.\n\n## Architecture\n\n- **Gateway != Service**: The `WebSocketGateway` should **only** handle client comms (Join Room, Ack message).\n  - **Rule**: Delegate business logic to a Service or Command Bus.\n- **Events**: Use `AsyncApi` or `SocketApi` decorators (from community packages) to document WS events similarly to OpenAPI.\n\n\n## Anti-Patterns\n\n- **No HTTP guards for WebSocket auth**: Validate JWT in `handleConnection()`; HTTP guards don't trigger on WS.\n- **No WebSocket at scale without Redis adapter**: Without `@socket.io\u002Fredis-adapter`, cross-pod events are lost.\n- **No SSE over HTTP\u002F1.1 at scale**: Use HTTP\u002F2 to avoid the 6-connection-per-domain browser limit.\n\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Fnestjs-real-time",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill nestjs-real-time",{"tool":56,"command":57},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill nestjs-real-time",{"tool":59,"command":60},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill nestjs-real-time","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Fnestjs-real-time\u002FSKILL.md",true,[64,70],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fax-profiles.md","REFERENCE","参考文档",4605,"https:\u002F\u002Fgithub.com\u002FThamielis\u002F.agents\u002Fblob\u002Fmain\u002Fplugins\u002Farize-ax\u002Fskills\u002Farize-prompt-optimization\u002Freferences\u002Fax-profiles.md",{"path":71,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Fax-setup.md",1529,"https:\u002F\u002Fgithub.com\u002FThamielis\u002F.agents\u002Fblob\u002Fmain\u002Fplugins\u002Farize-ax\u002Fskills\u002Farize-prompt-optimization\u002Freferences\u002Fax-setup.md",[75,89,99,108,114,121],{"skillNo":76,"name":77,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":85,"publishedAt":36},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[80],{"categoryNo":81,"categoryName":82,"taxonomyType":83,"taxonomyTypeDesc":84},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[86,87,88],"model","model hierarchy","model hierarchy skill",{"skillNo":90,"name":91,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":95,"publishedAt":36},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[94],{"categoryNo":81,"categoryName":82,"taxonomyType":83,"taxonomyTypeDesc":84},[96,97,98],"MCP","zoom","zoom mcp",{"skillNo":100,"name":101,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":36},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[105,106,107,97],"sdk","zoom apps sdk","apps",{"skillNo":109,"name":110,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":36},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[110],{"skillNo":115,"name":116,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":120,"publishedAt":36},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[119],{"categoryNo":81,"categoryName":82,"taxonomyType":83,"taxonomyTypeDesc":84},[116],{"skillNo":122,"name":123,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":36},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[123]]