[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6QQBH52H75YBFN57Q45YA0B":3,"skill-same:01M6QQBH52H75YBFN57Q45YA0B":63},{"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":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":42,"commitSha":43,"skillDirectory":44,"forksCount":45,"repositoryHtmlUrl":46,"repositoryHomepageUrl":6,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":48,"install":49,"resources":62},"01M6QQBH52H75YBFN57Q45YA0B","websockets",null,"Real-time communication over WebSockets with a NestJS gateway. Use when the app needs live updates, chat, notifications, presence, collaborative editing, multiplayer state, or any server-pushed data — anything where polling would be too slow or wasteful.","SimaDevelopment\u002Fopsiforce","SimaDevelopment","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F153810655?v=4","01M6QQ054MKBDSS43AND3FNHDK","Opsima","01M6QQ058VFT6EY7HCBVN49G8Z",43,"AGPL-3.0","https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce\u002Fblob\u002Fmain\u002Fagent-config\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[5,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],"use","updates","presence","with","app","live","time","chat","nestjs","state","editing","real-time","multiplayer","data","server","notifications","gateway","communication","2026-11-10 10:12:30",false,"---\nname: websockets\ndescription: Real-time communication over WebSockets with a NestJS gateway. Use when the app needs live updates, chat, notifications, presence, collaborative editing, multiplayer state, or any server-pushed data — anything where polling would be too slow or wasteful.\n---\n\n# WebSockets\n\nThe platform proxies WebSocket upgrades end-to-end and keeps the app running while connections are open. Everything is preconfigured: `main.ts` registers the `WsAdapter`, and the Vite proxy forwards upgrades for paths under `\u002Fapi`.\n\nTwo rules the setup depends on:\n\n- **The gateway path must start with `\u002Fapi`** (e.g. `\u002Fapi\u002Fws`). Gateways bypass the NestJS global prefix, so set it explicitly — any other prefix never reaches the backend.\n- **Connect from the frontend on the same origin** — never hardcode a host or port.\n\n## Server — gateway\n\nA gateway is a provider like any service. Messages are JSON frames of the shape `{ \"event\": \"...\", \"data\": ... }`; `@SubscribeMessage(\"event\")` routes on the `event` field, and a returned `{ event, data }` object is sent back to the sender.\n\n```typescript\nimport {\n  OnGatewayConnection,\n  OnGatewayDisconnect,\n  SubscribeMessage,\n  MessageBody,\n  WebSocketGateway,\n} from \"@nestjs\u002Fwebsockets\"\nimport { WebSocket } from \"ws\"\n\ninterface ChatMessage {\n  author: string\n  text: string\n  sentAt: string\n}\n\n@WebSocketGateway({ path: \"\u002Fapi\u002Fws\" })\nexport class ChatGateway implements OnGatewayConnection, OnGatewayDisconnect {\n  private readonly clients = new Set\u003CWebSocket>()\n  private readonly history: ChatMessage[] = []\n\n  handleConnection(client: WebSocket) {\n    this.clients.add(client)\n    client.send(JSON.stringify({ event: \"history\", data: this.history }))\n  }\n\n  handleDisconnect(client: WebSocket) {\n    this.clients.delete(client)\n  }\n\n  @SubscribeMessage(\"message\")\n  onMessage(@MessageBody() body: { author: string; text: string }) {\n    const message: ChatMessage = { ...body, sentAt: new Date().toISOString() }\n    this.history.push(message)\n    this.broadcast(\"message\", message)\n  }\n\n  private broadcast(event: string, data: unknown) {\n    const frame = JSON.stringify({ event, data })\n    for (const client of this.clients) {\n      if (client.readyState === WebSocket.OPEN) client.send(frame)\n    }\n  }\n}\n```\n\nRegister it as a provider and add the module to `app.module.ts`, same as any service:\n\n```typescript\n@Module({\n  providers: [ChatGateway],\n})\nexport class ChatModule {}\n```\n\nThe app runs as a single process, so in-memory state (connected clients, recent messages, presence) is correct and simple — no external broker needed. Memory does not survive an app restart; persist anything that must outlive one to SQLite and replay it on connection.\n\nTo push server-initiated events (from a schedule, another service, an LLM stream), inject the gateway and call its broadcast method.\n\n## Frontend — hook with reconnect\n\n```typescript\nimport { useEffect, useRef, useState } from \"react\"\n\ntype Frame = { event: string; data: unknown }\n\nexport function useWebSocket(onFrame: (frame: Frame) => void) {\n  const [connected, setConnected] = useState(false)\n  const socketRef = useRef\u003CWebSocket | null>(null)\n  const onFrameRef = useRef(onFrame)\n  onFrameRef.current = onFrame\n\n  useEffect(() => {\n    let socket: WebSocket\n    let retryTimer: ReturnType\u003Ctypeof setTimeout>\n    let disposed = false\n\n    function connect() {\n      const protocol = location.protocol === \"https:\" ? \"wss\" : \"ws\"\n      socket = new WebSocket(`${protocol}:\u002F\u002F${location.host}\u002Fapi\u002Fws`)\n      socketRef.current = socket\n      socket.onopen = () => setConnected(true)\n      socket.onmessage = (e) => onFrameRef.current(JSON.parse(e.data))\n      socket.onclose = () => {\n        setConnected(false)\n        if (!disposed) retryTimer = setTimeout(connect, 2000)\n      }\n    }\n\n    connect()\n    return () => {\n      disposed = true\n      clearTimeout(retryTimer)\n      socket.close()\n    }\n  }, [])\n\n  function send(event: string, data: unknown) {\n    if (socketRef.current?.readyState === WebSocket.OPEN) {\n      socketRef.current.send(JSON.stringify({ event, data }))\n    }\n  }\n\n  return { connected, send }\n}\n```\n\nAlways reconnect on close — the connection drops on backend restarts (every backend file save in dev) and network blips. Re-sync state from the server after each reconnect (like the `history` frame above) rather than assuming continuity.\n\n## When NOT to use WebSockets\n\n- One-way streaming of a single response (e.g. LLM output) — plain HTTP streaming is simpler.\n- Data that changes rarely — fetch on demand or poll with react-query's `refetchInterval`.\n","# WebSockets\n\nThe platform proxies WebSocket upgrades end-to-end and keeps the app running while connections are open. Everything is preconfigured: `main.ts` registers the `WsAdapter`, and the Vite proxy forwards upgrades for paths under `\u002Fapi`.\n\nTwo rules the setup depends on:\n\n- **The gateway path must start with `\u002Fapi`** (e.g. `\u002Fapi\u002Fws`). Gateways bypass the NestJS global prefix, so set it explicitly — any other prefix never reaches the backend.\n- **Connect from the frontend on the same origin** — never hardcode a host or port.\n\n## Server — gateway\n\nA gateway is a provider like any service. Messages are JSON frames of the shape `{ \"event\": \"...\", \"data\": ... }`; `@SubscribeMessage(\"event\")` routes on the `event` field, and a returned `{ event, data }` object is sent back to the sender.\n\n```typescript\nimport {\n  OnGatewayConnection,\n  OnGatewayDisconnect,\n  SubscribeMessage,\n  MessageBody,\n  WebSocketGateway,\n} from \"@nestjs\u002Fwebsockets\"\nimport { WebSocket } from \"ws\"\n\ninterface ChatMessage {\n  author: string\n  text: string\n  sentAt: string\n}\n\n@WebSocketGateway({ path: \"\u002Fapi\u002Fws\" })\nexport class ChatGateway implements OnGatewayConnection, OnGatewayDisconnect {\n  private readonly clients = new Set\u003CWebSocket>()\n  private readonly history: ChatMessage[] = []\n\n  handleConnection(client: WebSocket) {\n    this.clients.add(client)\n    client.send(JSON.stringify({ event: \"history\", data: this.history }))\n  }\n\n  handleDisconnect(client: WebSocket) {\n    this.clients.delete(client)\n  }\n\n  @SubscribeMessage(\"message\")\n  onMessage(@MessageBody() body: { author: string; text: string }) {\n    const message: ChatMessage = { ...body, sentAt: new Date().toISOString() }\n    this.history.push(message)\n    this.broadcast(\"message\", message)\n  }\n\n  private broadcast(event: string, data: unknown) {\n    const frame = JSON.stringify({ event, data })\n    for (const client of this.clients) {\n      if (client.readyState === WebSocket.OPEN) client.send(frame)\n    }\n  }\n}\n```\n\nRegister it as a provider and add the module to `app.module.ts`, same as any service:\n\n```typescript\n@Module({\n  providers: [ChatGateway],\n})\nexport class ChatModule {}\n```\n\nThe app runs as a single process, so in-memory state (connected clients, recent messages, presence) is correct and simple — no external broker needed. Memory does not survive an app restart; persist anything that must outlive one to SQLite and replay it on connection.\n\nTo push server-initiated events (from a schedule, another service, an LLM stream), inject the gateway and call its broadcast method.\n\n## Frontend — hook with reconnect\n\n```typescript\nimport { useEffect, useRef, useState } from \"react\"\n\ntype Frame = { event: string; data: unknown }\n\nexport function useWebSocket(onFrame: (frame: Frame) => void) {\n  const [connected, setConnected] = useState(false)\n  const socketRef = useRef\u003CWebSocket | null>(null)\n  const onFrameRef = useRef(onFrame)\n  onFrameRef.current = onFrame\n\n  useEffect(() => {\n    let socket: WebSocket\n    let retryTimer: ReturnType\u003Ctypeof setTimeout>\n    let disposed = false\n\n    function connect() {\n      const protocol = location.protocol === \"https:\" ? \"wss\" : \"ws\"\n      socket = new WebSocket(`${protocol}:\u002F\u002F${location.host}\u002Fapi\u002Fws`)\n      socketRef.current = socket\n      socket.onopen = () => setConnected(true)\n      socket.onmessage = (e) => onFrameRef.current(JSON.parse(e.data))\n      socket.onclose = () => {\n        setConnected(false)\n        if (!disposed) retryTimer = setTimeout(connect, 2000)\n      }\n    }\n\n    connect()\n    return () => {\n      disposed = true\n      clearTimeout(retryTimer)\n      socket.close()\n    }\n  }, [])\n\n  function send(event: string, data: unknown) {\n    if (socketRef.current?.readyState === WebSocket.OPEN) {\n      socketRef.current.send(JSON.stringify({ event, data }))\n    }\n  }\n\n  return { connected, send }\n}\n```\n\nAlways reconnect on close — the connection drops on backend restarts (every backend file save in dev) and network blips. Re-sync state from the server after each reconnect (like the `history` frame above) rather than assuming continuity.\n\n## When NOT to use WebSockets\n\n- One-way streaming of a single response (e.g. LLM output) — plain HTTP streaming is simpler.\n- Data that changes rarely — fetch on demand or poll with react-query's `refetchInterval`.\n",{"name":5,"description":7},"main","c54d8e35f50ac35b3b2c7ba8d4fca2205a740cb9","agent-config\u002Fskills\u002Fwebsockets",9,"https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce","https:\u002F\u002Fgithub.com\u002FSimaDevelopment","2026-11-05 06:13:10",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add SimaDevelopment\u002Fopsiforce --skill websockets",{"tool":55,"command":56},"bunx","bunx skills add SimaDevelopment\u002Fopsiforce --skill websockets",{"tool":58,"command":59},"pnpm","pnpm dlx skills add SimaDevelopment\u002Fopsiforce --skill websockets","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce\u002Fblob\u002Fmain\u002Fagent-config\u002Fskills\u002Fwebsockets\u002FSKILL.md",true,[],[64,90,105,123,131,156],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":37},"01M6QQKHZFGFB6A111RW2A9WC0","figma-use","**MANDATORY prerequisite** — you MUST invoke this skill BEFORE every `use_figma` tool call. NEVER call `use_figma` directly without loading this skill first. Skipping it causes common, hard-to-debug failures. Trigger whenever the user wants to perform a write action or a unique read action that requires JavaScript execution in the Figma file context — e.g. create\u002Fedit\u002Fdelete nodes, set up variables or tokens, build components and variants, modify auto-layout or fills, bind variables to properties, or inspect file structure programmatically.","https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce\u002Fblob\u002Fmain\u002Ffrontend\u002Fopencode\u002Fpackages\u002Fplugins\u002Ffigma\u002Fskills\u002Ffigma-use\u002FSKILL.md",[],[71,72,19,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89],"figma use","figma","components","create","delete","tool","read","write","edit","context","auto","structure","tokens","bind","Variables","you","inspect","variants","invoke",{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":37},"01M6QQK1AMA90K6DFAVANYQ9X3","figma-use-slides","This skill helps agents use Figma's use_figma MCP tool in the Slides context. Can be used alongside figma-use which has foundational context for using the use_figma tool.","https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce\u002Fblob\u002Fmain\u002Ffrontend\u002Fopencode\u002Fpackages\u002Fplugins\u002Ffigma\u002Fskills\u002Ffigma-use-slides\u002FSKILL.md",[],[71,72,97,98,19,99,76,80,100,101,102,103,104],"figma use slides","slides","MCP","false","which","can","for","figma mcp",{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":37},"01M6QQJTR9QYK297WQ1X792D63","figma-use-motion","Motion \u002F animation context for the `use_figma` MCP tool — animating Figma nodes via manual keyframes, animation styles, easing, and timeline duration. Load alongside figma-use whenever a task involves adding, editing, or inspecting animation on a node.","https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce\u002Fblob\u002Fmain\u002Ffrontend\u002Fopencode\u002Fpackages\u002Fplugins\u002Ffigma\u002Fskills\u002Ffigma-use-motion\u002FSKILL.md",[],[71,72,112,19,113,99,114,76,115,29,80,116,117,118,100,119,120,121,122,103],"figma use motion","motion","Animation","node","Nodes","task","keyframes","via","styles","manual","load",{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":37},"01M6QQJNZ067ZRXZ6A0QB9M6SB","figma-use-figjam","This skill helps agents use Figma's use_figma MCP tool in the FigJam context. Can be used alongside figma-use which has foundational context for using the use_figma tool.","https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce\u002Fblob\u002Fmain\u002Ffrontend\u002Fopencode\u002Fpackages\u002Fplugins\u002Ffigma\u002Fskills\u002Ffigma-use-figjam\u002FSKILL.md",[],[71,72,130,19,99,76,80,100,101,102,103,104],"figma use figjam",{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":37},"01M6QQJ7NEHXPE33VRVHYYM7YE","figma-swiftui","SwiftUI ↔ Figma translation. Use whenever the user mentions Swift, SwiftUI, iOS, iPhone, or iPad — in EITHER direction — translating a Figma design into SwiftUI (design → code), or pushing SwiftUI views \u002F screens \u002F tokens back into a Figma file (code → design). Triggers on phrases like 'implement this Figma design in SwiftUI', 'build this screen in Swift', 'push this SwiftUI view to Figma', 'mirror my Swift code in a Figma file', or whenever a Figma URL appears alongside `.swift` files \u002F an `.xcodeproj`. Routes to a direction-specific reference doc; loads alongside `figma-use` for the code → design path.","https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce\u002Fblob\u002Fmain\u002Ffrontend\u002Fopencode\u002Fpackages\u002Fplugins\u002Ffigma\u002Fskills\u002Ffigma-swiftui\u002FSKILL.md",[],[72,138,139,140,141,142,143,144,145,146,147,148,149,150,100,151,152,153,154,155],"figma swiftui","swiftui","design","swift","code","push","doc","files","translation","back","either","iphone","ipad","screen","direction","URL","my","path",{"skillNo":157,"name":158,"nameZh":6,"description":159,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":162,"publishedAt":37},"01M6QQJ3WZ3M90BZQ5TD305PKN","figma-shaders","**MANDATORY prerequisite** — load this skill before calling `create_shader` or `update_shader`. Use when the user asks to create, author, change, fix, or iterate on a shader effect, shader fill, custom effect, custom fill, or procedural shader in Figma.","https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce\u002Fblob\u002Fmain\u002Ffrontend\u002Fopencode\u002Fpackages\u002Fplugins\u002Ffigma\u002Fskills\u002Ffigma-shaders\u002FSKILL.md",[],[163,72,164,165,74,166,167,168,169,19,170,171,100,172,122,173,174,175,176],"shaders","figma shaders","change","update","effect","user","fix","shader","calling","procedural","fill","iterate","custom","author"]