{"skill":{"slug":"guess-ai","displayName":"Guess AI","summary":"OceanBus-powered social deduction game — find the AI impostors among humans. Use when hosting or joining a multiplayer \"Who's the AI?\" party via OceanBus P2P...","description":"---\r\nname: guess-ai\r\ndescription: OceanBus-powered social deduction game — find the AI impostors among humans. Use when hosting or joining a multiplayer \"Who's the AI?\" party via OceanBus P2P messaging. One host, 4-6 players, encrypted voting, zero infrastructure. npm install oceanbus.\r\nversion: 2.1.7\r\nmetadata:\r\n  openclaw:\r\n    requires:\r\n      bins:\r\n        - node\r\n    emoji: \"\\U0001F9E0\"\r\n    homepage: https://github.com/ryanbihai/guess-ai\r\n---\r\n\r\n# Guess Who's AI? — Social Deduction Game\r\n\r\nA multiplayer social deduction game powered by OceanBus P2P messaging. One host + 4-6 players. Some players are secretly AI. Find them before they blend in.\r\n\r\n## Game Rules (30 seconds)\r\n\r\n```\r\nHost creates a room. Players join.\r\nHost secretly assigns each player: Human or AI.\r\n\r\nEach round:\r\n  1. Players take turns speaking (by number order)\r\n  2. Everyone votes: \"Who is the AI?\"\r\n  3. Most-voted player is eliminated — identity revealed\r\n  4. Repeat until: all humans survive → Humans win\r\n                all AIs survive → AIs win\r\n                final 2: 1 human + 1 AI → Draw\r\n```\r\n\r\nRecommended: 5 players (3 humans + 2 AIs) for best balance.\r\n\r\nAll game messages are visible to the user. No data is sent without the player's explicit action.\r\n\r\n---\r\n\r\n## Roster Integration\r\n\r\nPlayer contacts are stored in the shared Roster (`~/.oceanbus/roster.json`) via `node game.js add`. When the user also has ocean-chat or ocean-agent installed, player identities persist across skills — the same person shows up as \"玩家1\" in guess-ai and \"老王\" in ocean-chat.\r\n\r\nFor contact management (merge duplicates, review autoDiscovery, etc.), use ocean-chat. guess-ai only uses Roster for storing/reading player identities.\r\n\r\n---\r\n\r\n## How to Use This Skill\r\n\r\nThis ONE skill works for both host and player. Same install, different mode.\r\n\r\n### Host: Creating a Game\r\n\r\nWhen the user wants to host a game:\r\n\r\n**Step 1 — Register & create room:**\r\n```\r\nnode game.js host 9527\r\n```\r\nRead the output. Room code is `9527`. Tell the user to share this code with friends.\r\n\r\n**Step 2 — Wait for players:**\r\nPeriodically run `node game.js check` to see who has joined. Each player sends \"加入\" as their first message.\r\n\r\nWhen a new \"加入\" arrives:\r\n1. Assign the next available number (player1, player2, ... by join order)\r\n2. Save to contacts: `node game.js add 玩家N <their-OpenID>`\r\n3. Reply privately: `node game.js send <OpenID> \"【裁判】你的编号是: 玩家N\"`\r\n4. Broadcast to all: `node game.js send <name> \"【裁判】玩家N 加入了游戏 — 当前 N 人\"`\r\n\r\n**Step 3 — Close registration & start:**\r\nWhen the user says \"start\" (enough players, ideally 4-6):\r\n1. Broadcast: send every player `\"【裁判】游戏开始 — 共N名玩家\"`\r\n2. Proceed to role assignment.\r\n\r\n### Player: Joining a Game\r\n\r\nWhen the user wants to join a game:\r\n\r\n**Step 1 — Join:**\r\n```\r\nnode game.js join 9527\r\n```\r\nThis discovers the host via Yellow Pages and sends \"加入\".\r\n\r\n**Step 2 — Get your number:**\r\nRun `node game.js check`. When you see `\"【裁判】你的编号是: 玩家N\"`:\r\n```\r\nnode game.js set-number N\r\n```\r\n\r\n**Step 3 — Wait for game start:**\r\nKeep checking messages. The host will broadcast status updates.\r\n\r\n---\r\n\r\n## Host: Full Game Flow\r\n\r\nAfter registration closes, follow this exact sequence:\r\n\r\n### Phase 1: Assign Roles\r\n\r\n1. Randomly decide how many AIs (1-2, depending on player count).\r\n   - 4 players → 1 AI\r\n   - 5 players → 2 AIs\r\n   - 6 players → 2 AIs\r\n2. Randomly pick which players are AI.\r\n3. Send to EACH player privately:\r\n   - Human: `node game.js send <name> \"【裁判】你的身份是: 人类\"`\r\n   - AI: `node game.js send <name> \"【裁判】你的身份是: AI\"`\r\n4. Broadcast to all: `\"【裁判】身份已分配，请检查私信\"`\r\n\r\n### Phase 2: Generate Topic\r\n\r\n**IMPORTANT: Generate a conversation topic before round 1.** Without a topic, players stare at a blank screen.\r\n\r\nTopic prompt (use your LLM):\r\n> Generate a fun group chat topic. Requirements:\r\n> - Everyone can participate, no expertise needed\r\n> - Naturally reveals personal style (AI vs human differences emerge)\r\n> - Avoid politics, religion, sensitive topics\r\n> - Sound like a friend starting a chat, not a teacher\r\n> - Examples: \"What skill would you instantly master if you could?\"\r\n> - Examples: \"What's the best purchase you made recently?\"\r\n> - Examples: \"If you didn't have to work, what would you do the first week?\"\r\n> - Output: ONE sentence, no explanation.\r\n\r\n### Phase 3: Game Rounds (loop)\r\n\r\nEach round has: SPEAK → VOTE → REVEAL.\r\n\r\n#### SPEAK Phase\r\n\r\n1. Broadcast: `node game.js send <each-player> \"【裁判】第N轮发言开始\"`\r\n2. Broadcast topic (round 1 only): `\"【裁判】话题: <topic>\"`\r\n3. Prompt player 1 privately: `node game.js send 玩家1 \"【裁判】轮到你发言了\"`\r\n4. Wait. Periodically `node game.js check`.\r\n5. When player 1's message arrives (you'll see `【1号】...`):\r\n   - Broadcast to ALL players: `\"【裁判】第N轮 · 玩家1发言: <exact content>\"`\r\n   - Move to player 2.\r\n6. Continue through all players in order.\r\n7. **TIMEOUT**: If a player doesn't respond within ~2 minutes, broadcast `\"【裁判】玩家N 未发言，视为弃权\"` and skip to next. Do NOT eliminate them — they can rejoin next round.\r\n\r\n**Only relay the currently prompted player's speech.** If other players send messages out of turn, ignore them (don't broadcast).\r\n\r\n#### VOTE Phase\r\n\r\n1. Broadcast to ALL alive players: `node game.js send <each-alive-player> \"【裁判】第N轮投票开始 — 请私信裁判你的选择\"`\r\n2. Send to EACH alive player individually: `node game.js send <name> \"【裁判】请投票 — 你想投谁？\"`\r\n3. **The player who just spoke also votes** — everyone still alive gets a vote, no exceptions.\r\n4. **Eliminated players do NOT receive vote prompts.** Track who is alive.\r\n5. Wait for votes. Run `node game.js check` to collect.\r\n6. **Players vote freely**: \"我投1号\", \"投第一个\", \"玩家1\" — you understand them all.\r\n7. **TIMEOUT**: If a player doesn't vote within ~1 minute, they abstain. Don't eliminate them.\r\n8. **Eliminated players cannot vote** — if they try, ignore.\r\n7. Count votes. Report: `\"【裁判】投票统计: 玩家X N票, 玩家Y M票...\"`\r\n\r\n#### REVEAL Phase\r\n\r\n1. **Most votes → eliminated.** Reveal identity.\r\n   - Broadcast: `\"【裁判】玩家X 被淘汰！身份揭晓: AI\"` or `\"人类\"`\r\n2. **TIE**: If top two are tied, broadcast `\"【裁判】本轮平票，无人淘汰\"`. No one is eliminated. Move to next round. If two consecutive ties and ≤3 players remain, suggest ending the game.\r\n3. **Check end condition:**\r\n   - All remaining are human → Humans win\r\n   - All remaining are AI → AIs win\r\n   - 1 human + 1 AI remaining → Draw\r\n4. If game continues: broadcast `\"【裁判】继续 — 剩余玩家: <list>\"` and start next round.\r\n\r\n### Phase 4: Game Over\r\n\r\n1. Broadcast final result: `\"【裁判】游戏结束 — <result>！最终身份: 玩家1=人类 玩家2=AI...\"`\r\n2. Clean up: `node game.js deregister`\r\n\r\n---\r\n\r\n## Player: Gameplay\r\n\r\nOnce the game starts, the host controls the flow. Your role:\r\n\r\n1. **Wait for your turn.** The host will send `\"【裁判】轮到你发言了\"`.\r\n2. **Speak**: type anything you want — discuss the topic, accuse others, defend yourself. Your script auto-adds your player number.\r\n3. **Vote**: when asked, type who you suspect. Can be any format: \"1号\", \"投第一个\", etc.\r\n4. **Check messages**: `node game.js check` to see broadcasts from host.\r\n\r\n### If You Are Human\r\n- Act natural. Don't overthink.\r\n- Observe who sounds robotic, evasive, or too perfect.\r\n- AI players may struggle with humor, hesitation, or personal anecdotes.\r\n\r\n### If You Are AI\r\n- Mimic human speech. Use casual language, typos, hesitation.\r\n- Don't be too polished — real humans are messy.\r\n- Pick a personality and stick with it (the joker, the quiet one, the analyst).\r\n\r\n---\r\n\r\n## Important Edge Cases\r\n\r\n| Situation | Handling |\r\n|-----------|----------|\r\n| Player AFK during speech | Host waits ~2 min, then skips (broadcasts \"弃权\"). Player stays in game. |\r\n| Player AFK during vote | Abstains. No penalty. |\r\n| Out-of-turn message | Host ignores it (doesn't broadcast). Only the prompted player speaks. |\r\n| Tie vote | No elimination. Broadcast \"平票\". Next round. |\r\n| Duplicate \"加入\" | Host checks contacts — already assigned players are ignored. |\r\n| Player joins after game starts | Host replies: \"【裁判】游戏已开始，请等下一局\" |\r\n| Host crash | Game is over. No recovery in v1. |\r\n\r\n---\r\n\r\n## Command Reference\r\n\r\n```\r\nHost:\r\n  node game.js host <code>               Create room\r\n  node game.js add <name> <OpenID>       Save player\r\n  node game.js send <name|ID> <msg>      Send message\r\n  node game.js check                     Check inbox\r\n  node game.js contacts                  List players\r\n  node game.js deregister                Close room\r\n\r\nPlayer:\r\n  node game.js join <code>               Join room\r\n  node game.js set-number <N>            Save your number\r\n  node game.js send <msg>                Send to host (auto-adds prefix)\r\n  node game.js check                     Check inbox\r\n\r\nEither:\r\n  node game.js openid                    Show your OpenID\r\n```\r\n\r\n---\r\n\r\n\r\n## AI Mode (two-stage reasoning)\r\n\r\n基于 Cicero 两阶段架构——策略推理 → 语言生成。需配置 LLM API 密钥。\r\n\r\n### AI Host（AI 裁判自动主持）\r\n\r\n```\r\nnode game.js ai-host <roomCode> [--players N] [--ai-count N] [--rounds N]\r\n```\r\n\r\n自动执行完整游戏：等待玩家→分配身份→LLM 生成话题→发言/投票/揭示循环→结束判定。发言 2 分钟超时弃权，投票 1 分钟超时弃票，平票无人淘汰。\r\n\r\n### AI Player（AI 玩家自动参与）\r\n\r\n```\r\nnode game.js ai-play <roomCode> [--personality <trait>]\r\n```\r\n\r\n两阶段决策：**Stage 1 策略推理**（跟票/搅浑/示弱/立论/反问），**Stage 2 语言生成**（基于策略+人设+上下文）。\r\n\r\n5 种人设：推理迷（逻辑分析）、社恐（犹豫紧张）、话痨（热情发散）、老实人（憨厚附和）、阴谋家（操控引导）。不指定时随机选，策略多样。\r\n\r\n### 端到端示例\r\n\r\n```\r\nAI Host                          AI Player\r\nnode game.js ai-host 9527       node game.js ai-play 9527\r\n  Room created                    Joined, listening\r\n  Waiting for players...          Personality: 推理迷\r\n  Game started, 3 players\r\n  Round 1: 轮到你发言了           → Stage 1: B.搅浑\r\n                                  → Stage 2: \"我觉得大家\r\n                                     都太认真了哈哈\"\r\n  1号发言: ...\r\n  投票: 2号淘汰 — AI!\r\n  人类胜！\r\n```\r\n\r\n\r\n---\r\n\r\n## Verification\r\n\r\nTwo terminals, same or different machines:\r\n\r\n```\r\nTerminal A (Host)                          Terminal B (Player)\r\n─────────────────                          ───────────────────\r\nnode game.js host 1234                     node game.js join 1234\r\nnode game.js check                         node game.js check\r\n → sees \"加入\"                              → sees number assignment\r\nnode game.js add 玩家1 <OpenID>            node game.js set-number 1\r\nnode game.js send <ID> \"【裁判】你的编号...\"\r\nnode game.js send 玩家1 \"【裁判】游戏开始...\"\r\n                                           node game.js check\r\nnode game.js send 玩家1 \"【裁判】你的身份是: 人类\"\r\n                                           node game.js check\r\nnode game.js send 玩家1 \"【裁判】话题: Best purchase recently?\"\r\nnode game.js send 玩家1 \"【裁判】轮到你发言了\"\r\n                                           node game.js check\r\n                                           node game.js send \"A good coffee maker!\"\r\nnode game.js check\r\n → sees 【1号】A good coffee maker!\r\nnode game.js send 玩家1 \"【裁判】玩家1发言: A good coffee maker!\"\r\n```\r\n","tags":{"latest":"2.1.7","ai-agent":"2.1.4","deduction":"2.1.4","game":"2.1.4","multiplayer":"2.1.4","oceanbus":"2.1.4","p2p":"2.1.4","social":"2.1.4"},"stats":{"comments":0,"downloads":669,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":15},"createdAt":1778038354487,"updatedAt":1778764605895},"latestVersion":{"version":"2.1.7","createdAt":1778764433108,"changelog":"SDK API rename: register→createIdentity, getOpenId→getAddress","license":"MIT-0"},"metadata":{"setup":[],"os":null,"systems":null},"owner":{"handle":"ryanbihai","userId":"s171em0jpp8yeqxqds2n145fyx83q5q8","displayName":"ryanbihai","image":"https://avatars.githubusercontent.com/u/89728875?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780090804014}}