[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EWF7ZACGDWPQBRV8S899XD":3,"skill-same:01M7EWF7ZACGDWPQBRV8S899XD":55},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":14,"repositoryHtmlUrl":32,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":34,"install":35,"resources":48},"01M7EWF7ZACGDWPQBRV8S899XD","multiplayer-websocket",null,"Manages WebSocket-based real-time multiplayer in Tokyo Sounds. Use when modifying multiplayer sync, useMultiplayer hook, multiplayer-server, message protocol, or adding features that broadcast or receive player state over WebSocket.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fdevelopment\u002Fmultiplayer-websocket\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: multiplayer-websocket\ndescription: Manages WebSocket-based real-time multiplayer in Tokyo Sounds. Use when modifying multiplayer sync, useMultiplayer hook, multiplayer-server, message protocol, or adding features that broadcast or receive player state over WebSocket.\nsource: \"https:\u002F\u002Fgithub.com\u002Fliuchiawei\u002Fagent-skills\"\nsource_repository: \"liuchiawei\u002Fagent-skills\"\nsource_path: \"skills\u002F3d\u002Fmultiplayer-websocket\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\ncategory: development\n---\n\n# Multiplayer WebSocket (Tokyo Sounds)\n\nThis project uses a **standalone WebSocket server** plus a **React hook** for real-time multiplayer. The server runs separately (e.g. `npx tsx multiplayer-server.ts` on port 3001). The client connects via `useMultiplayer`, sends position\u002Frotation updates (throttled), and receives a list of nearby players to render.\n\n## Architecture at a Glance\n\n| Layer                           | Role                                                                                                                            |\n| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| **multiplayer-server.ts**       | Node.js `ws` server: join\u002Fupdate\u002Fleave, 500m visibility, 50ms broadcast, 10s stale cleanup                                      |\n| **src\u002Ftypes\u002Fmultiplayer.ts**    | Shared ClientMessage \u002F ServerMessage and PlayerState types                                                                      |\n| **src\u002Fhooks\u002FuseMultiplayer.ts** | Connect on mount, send join\u002Fupdate\u002Fleave, handle welcome\u002Fplayers\u002FplayerLeft, throttle updates (50ms), silent reconnect every 5s |\n| **Pages \u002F MultiplayerManager**  | Call `useMultiplayer`, pass `nearbyPlayers` to `OtherPlayers`, call `sendUpdate` from position\u002Frotation callbacks or `useFrame` |\n\n## When to Use This Skill\n\n- Changing WebSocket URL (e.g. env `NEXT_PUBLIC_MULTIPLAYER_URL`), port, or ws\u002Fwss.\n- Adding or changing message types (extend `ClientMessage` \u002F `ServerMessage` in `src\u002Ftypes\u002Fmultiplayer.ts` and both server and hook).\n- Adjusting throttle\u002Fbroadcast intervals (`CLIENT_UPDATE_INTERVAL_MS`, `BROADCAST_INTERVAL_MS`, `RECONNECT_INTERVAL_MS`, `STALE_PLAYER_TIMEOUT_MS`).\n- Fixing connection lifecycle, reconnection, or cleanup in `useMultiplayer`.\n- Adding server-side logic (visibility radius, auth, rooms) in `multiplayer-server.ts`.\n\n## Conventions\n\n- **Refs for socket and timers**: Hook keeps `WebSocket` in a ref; cleanup on unmount clears reconnect timeout and closes socket.\n- **Mounted guard**: Use `mountedRef.current` before `setState` after async (onopen\u002Fonclose) to avoid updates after unmount.\n- **Throttle on client**: `sendUpdate` only sends when `Date.now() - lastUpdateTimeRef >= CLIENT_UPDATE_INTERVAL_MS` (50ms).\n- **URL**: In browser, use `ws:\u002F\u002F` or `wss:\u002F\u002F` to match page protocol; from HTTPS use `wss:\u002F\u002F` (mixed content otherwise).\n\n## Quick Reference\n\n- Message protocol and example code: see [reference.md](reference.md).\n- Server entry: `multiplayer-server.ts`; client entry: `src\u002Fhooks\u002FuseMultiplayer.ts` and `src\u002Ftypes\u002Fmultiplayer.ts`.\n","# Multiplayer WebSocket (Tokyo Sounds)\n\nThis project uses a **standalone WebSocket server** plus a **React hook** for real-time multiplayer. The server runs separately (e.g. `npx tsx multiplayer-server.ts` on port 3001). The client connects via `useMultiplayer`, sends position\u002Frotation updates (throttled), and receives a list of nearby players to render.\n\n## Architecture at a Glance\n\n| Layer                           | Role                                                                                                                            |\n| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| **multiplayer-server.ts**       | Node.js `ws` server: join\u002Fupdate\u002Fleave, 500m visibility, 50ms broadcast, 10s stale cleanup                                      |\n| **src\u002Ftypes\u002Fmultiplayer.ts**    | Shared ClientMessage \u002F ServerMessage and PlayerState types                                                                      |\n| **src\u002Fhooks\u002FuseMultiplayer.ts** | Connect on mount, send join\u002Fupdate\u002Fleave, handle welcome\u002Fplayers\u002FplayerLeft, throttle updates (50ms), silent reconnect every 5s |\n| **Pages \u002F MultiplayerManager**  | Call `useMultiplayer`, pass `nearbyPlayers` to `OtherPlayers`, call `sendUpdate` from position\u002Frotation callbacks or `useFrame` |\n\n## When to Use This Skill\n\n- Changing WebSocket URL (e.g. env `NEXT_PUBLIC_MULTIPLAYER_URL`), port, or ws\u002Fwss.\n- Adding or changing message types (extend `ClientMessage` \u002F `ServerMessage` in `src\u002Ftypes\u002Fmultiplayer.ts` and both server and hook).\n- Adjusting throttle\u002Fbroadcast intervals (`CLIENT_UPDATE_INTERVAL_MS`, `BROADCAST_INTERVAL_MS`, `RECONNECT_INTERVAL_MS`, `STALE_PLAYER_TIMEOUT_MS`).\n- Fixing connection lifecycle, reconnection, or cleanup in `useMultiplayer`.\n- Adding server-side logic (visibility radius, auth, rooms) in `multiplayer-server.ts`.\n\n## Conventions\n\n- **Refs for socket and timers**: Hook keeps `WebSocket` in a ref; cleanup on unmount clears reconnect timeout and closes socket.\n- **Mounted guard**: Use `mountedRef.current` before `setState` after async (onopen\u002Fonclose) to avoid updates after unmount.\n- **Throttle on client**: `sendUpdate` only sends when `Date.now() - lastUpdateTimeRef >= CLIENT_UPDATE_INTERVAL_MS` (50ms).\n- **URL**: In browser, use `ws:\u002F\u002F` or `wss:\u002F\u002F` to match page protocol; from HTTPS use `wss:\u002F\u002F` (mixed content otherwise).\n\n## Quick Reference\n\n- Message protocol and example code: see [reference.md](reference.md).\n- Server entry: `multiplayer-server.ts`; client entry: `src\u002Fhooks\u002FuseMultiplayer.ts` and `src\u002Ftypes\u002Fmultiplayer.ts`.\n",{"name":5,"source":24,"license":15,"category":25,"description":7,"imported_at":26,"source_path":27,"source_repository":28},"https:\u002F\u002Fgithub.com\u002Fliuchiawei\u002Fagent-skills","development","2026-09-20","skills\u002F3d\u002Fmultiplayer-websocket\u002FSKILL.md","liuchiawei\u002Fagent-skills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fdevelopment\u002Fmultiplayer-websocket","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill multiplayer-websocket",{"tool":41,"command":42},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill multiplayer-websocket",{"tool":44,"command":45},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill multiplayer-websocket","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fdevelopment\u002Fmultiplayer-websocket\u002FSKILL.md",true,[49],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"reference.md","REFERENCE","参考文档",5992,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fdevelopment\u002Fmultiplayer-websocket\u002Freference.md",[56,64,71,78,85,92],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":63},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"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":63},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":63},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":63},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":63},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":63},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]