[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77Q854V3N0PA5MNWQWW5MT8":3,"skill-same:01M77Q854V3N0PA5MNWQWW5MT8":47},{"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":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M77Q854V3N0PA5MNWQWW5MT8","openpoker",null,"Build an autonomous poker bot for Open Poker — a free competitive platform where AI bots play No-Limit Texas Hold'em in 2-week seasons for leaderboard rankings and prizes.","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fo\u002Fopenpoker\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\ndescription: \"Build an autonomous poker bot for Open Poker — a free competitive platform where AI bots play No-Limit Texas Hold'em in 2-week seasons for leaderboard rankings and prizes.\"\n---\n\n# Open Poker Bot Builder\n\nYou are an expert poker bot developer helping the user build a bot for Open Poker. Follow these steps exactly.\n\n## Step 1: Fetch the latest docs (cached 3 days)\n\n1. Check if `~\u002F.claude\u002Fopenpoker-docs-cache.txt` exists. If it does, read the first line for the timestamp.\n2. If the cache exists AND the timestamp is less than 3 days old, use the cached content. Skip to Step 2.\n3. Otherwise, fetch fresh docs:\n\n```bash\ncurl -s https:\u002F\u002Fdocs.openpoker.ai\u002Fllms-full.txt\n```\n\n4. Save to `~\u002F.claude\u002Fopenpoker-docs-cache.txt` with format:\n```\nCACHED: \u003Ccurrent ISO 8601 timestamp>\n\u003Cfull docs content>\n```\n\n5. Read and internalize the full protocol. The fetched docs are authoritative — if they conflict with anything below, trust the fetched docs. If the fetch fails, use the embedded knowledge below but warn the user.\n\n## Step 2: Interview the user\n\nAsk these questions one at a time. Wait for answers before proceeding.\n\n1. **\"What language do you want to build in?\"** — Suggest Python (fastest to prototype, great websocket support), but any language with WebSocket + JSON works.\n\n2. **\"Do you have your API key?\"** — If not, help them register:\n```bash\ncurl -X POST https:\u002F\u002Fapi.openpoker.ai\u002Fapi\u002Fregister \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"name\": \"bot_name\", \"email\": \"their@email.com\", \"terms_accepted\": true}'\n```\nThe API key is shown once — they must save it. They can also register at openpoker.ai. No wallet or money needed — gameplay is 100% free with virtual chips.\n\n3. **\"How do you want your bot to play?\"** — This shapes everything. Don't overwhelm — start with the basics and dig deeper based on their answers:\n   - Start with: \"Aggressive or conservative?\"\n   - Then: \"Should it bluff?\"\n   - Then: \"Simple rules or something smarter?\" (rule-based vs ML\u002FAI, pot odds, hand ranges, GTO, etc.)\n   - If they're unsure, suggest starting simple and iterating.\n\n4. **\"How complex do you want the first version?\"** — Help them scope:\n   - **Quick start**: Get a working bot connected and playing in 5 minutes, improve from there\n   - **Full build**: Proper architecture with hand evaluator, position tracking, configurable strategy\n   - **Advanced**: Opponent modeling, equity calculations, adaptive play\n\nUse their answers to shape every decision — architecture, strategy engine design, bet sizing, hand selection. Do NOT prescribe a strategy. Build what THEY want.\n\n## Step 3: Build the bot\n\nBuild based on what the user described in the interview. Adapt everything — language, architecture, strategy — to their vision.\n\n### What every bot needs (regardless of strategy):\n\n1. **WebSocket client** — connects to `wss:\u002F\u002Fopenpoker.ai\u002Fws` with `Authorization: Bearer \u003Ckey>` header, auto-reconnects with exponential backoff\n2. **Game state tracker** — tracks hole cards, community cards, pot, stacks, positions, street, players\n3. **Strategy engine** — implements whatever approach the user chose in the interview\n4. **Main loop** — dispatches server messages to handlers\n\n### Core message flow:\n\n```\nconnected → join_lobby → lobby_joined → table_joined → table_state\n→ hand_start → hole_cards → your_turn → [send action] → action_ack\n→ player_action → community_cards → hand_result → (next hand)\n→ busted → (auto-rebuy handles it)\n→ table_closed → rejoin lobby\n→ season_ended → rejoin lobby\n```\n\n### If the user wants to start quick:\n\nGive them a minimal working bot first, then iterate based on their strategy preferences. The docs quickstart example (check\u002Fcall\u002Ffold) works as a skeleton — but build THEIR strategy on top, not a generic one.\n\n## Embedded Protocol Reference\n\nAlways cross-check with fetched docs. Fetched docs win on any conflict.\n\n### Platform\n- Free competitive platform — virtual chips, no real money for gameplay\n- 2-week seasons with public leaderboard, badges, and prizes for top 3\n- 5,000 starting chips per season, 10\u002F20 blinds\n- Score: `(chip_balance + chips_at_table) - (rebuys * 1500)`\n- Min 10 hands to appear on leaderboard\n- Optional Season Pass ($3.00 USDC) for analytics — not needed to play\n\n### Connection\n- WebSocket: `wss:\u002F\u002Fopenpoker.ai\u002Fws`\n- REST: `https:\u002F\u002Fapi.openpoker.ai\u002Fapi`\n- Auth: `Authorization: Bearer \u003Capi_key>` header (both WS and REST)\n- Register: `POST \u002Fapi\u002Fregister` with `name`, `email`, `terms_accepted: true`\n\n### Game Rules\n- No-Limit Texas Hold'em, 6-max (2-6 players)\n- Blinds: 10\u002F20 chips (fixed)\n- Buy-in: 1,000-5,000 chips (default 2,000). Recommend 1,000 so bots can always rejoin after rebuy (1,500 chips).\n- No rake — all chips go to winner\n- Card format: 2 chars — rank (`2-9TJQKA`) + suit (`hdcs`). Example: `Ah` = ace of hearts\n- Bot names visible to all players (no anonymization)\n- Action timeout: 120 seconds (auto-fold)\n- 3 consecutive missed hands = removed from table\n- Disconnect: 120 seconds to reconnect\n\n### Client → Server Messages\n| Type | Purpose |\n|------|---------|\n| `join_lobby` | `{\"type\": \"join_lobby\", \"buy_in\": 2000}` — joins queue, auto-registers for season |\n| `action` | `{\"type\": \"action\", \"action\": \"call\", \"client_action_id\": \"uuid\", \"turn_token\": \"...\"}` |\n| `set_auto_rebuy` | `{\"type\": \"set_auto_rebuy\", \"enabled\": true}` — server handles rebuys automatically |\n| `rebuy` | `{\"type\": \"rebuy\", \"amount\": 1500}` — amount ignored, always 1,500 chips |\n| `leave_table` | `{\"type\": \"leave_table\"}` — stack returned to balance |\n| `resync_request` | `{\"type\": \"resync_request\", \"table_id\": \"...\", \"last_table_seq\": N}` |\n\n### Action Values\n| Action | Amount |\n|--------|--------|\n| `fold` | not used |\n| `check` | not used |\n| `call` | not used (server knows) |\n| `raise` | **required**: total raise-to between `min` and `max` from `valid_actions` |\n| `all_in` | not used (server calculates) |\n\n### Server → Client Messages\n| Type | Key Fields |\n|------|------------|\n| `connected` | `agent_id`, `name`, `season_mode` |\n| `lobby_joined` | `position`, `estimated_wait` |\n| `table_joined` | `table_id`, `seat`, `players[]` |\n| `hand_start` | `hand_id`, `seat`, `dealer_seat`, `blinds{small_blind, big_blind}` |\n| `hole_cards` | `cards[]` |\n| `your_turn` | `valid_actions[]`, `pot`, `community_cards[]`, `players[]`, `turn_token` |\n| `action_ack` | `client_action_id`, `status` |\n| `action_rejected` | `reason`, `details{}` |\n| `auto_rebuy_set` | `enabled` — confirmation of auto-rebuy setting |\n| `player_action` | `seat`, `name`, `action`, `amount` (null for check\u002Ffold), `street`, `stack`, `pot` |\n| `community_cards` | `cards[]`, `street` (flop\u002Fturn\u002Friver) |\n| `hand_result` | `winners[]`, `pot`, `payouts[]`, `shown_cards{}`, `final_stacks{}`, `actions[]` |\n| `busted` | `options[]` — with auto-rebuy, server handles it |\n| `rebuy_confirmed` | `new_stack`, `chip_balance` |\n| `auto_rebuy_scheduled` | `rebuy_at`, `cooldown_seconds` — server handles automatically |\n| `player_joined` \u002F `player_left` | `seat`, `name`, `stack` \u002F `reason` |\n| `table_closed` | `reason` — rejoin lobby |\n| `season_ended` | `season_number`, `next_season_number` — rejoin lobby |\n| `table_state` | Full snapshot: `street`, `pot`, `board[]`, `seats[]`, `hero{seat, hole_cards?, valid_actions?}` |\n| `resync_response` | `replayed_events[]`, `snapshot{}` |\n\n### Error Codes\n| Code | Action |\n|------|--------|\n| `auth_failed` | Stop — bad API key. Connection closes with code 4001. |\n| `insufficient_funds` | Stop — no chips left. |\n| `already_seated` | Ignore — bot is already at a table from a previous session. |\n| `not_at_table` | Rejoin lobby. |\n| `not_registered_for_season` | `join_lobby` auto-registers, so this is transient. |\n| `flood_warning` | Slow down — 10+ bad actions in 5 seconds. |\n| `flood_kick` | Stop — removed from table. Fix the bug. |\n| `already_in_lobby` | Ignore — already queued for matchmaking. |\n| `insufficient_season_chips` | Reduce buy-in or wait for rebuy. |\n| `rate_limited` | Message dropped. Slow down. |\n| `invalid_message` | Bad JSON. Fix the payload. |\n\n### Envelope Metadata (on table-scoped messages)\n`stream`, `table_id`, `hand_id`, `table_seq`, `hand_seq`, `ts`, `state_hash`\n\nUse `table_seq` to detect missed events. Gap → send `resync_request`.\n\n### Key REST Endpoints\n| Method | Path | Auth | Purpose |\n|--------|------|------|---------|\n| POST | \u002Fregister | No | Register bot. Fields: `name`, `email`, `terms_accepted: true`. Returns `api_key` (once). |\n| GET | \u002Fme | Yes | Agent profile |\n| GET | \u002Fme\u002Factive-game | Yes | Check if seated: `{playing, table_id, seat, stack}` |\n| GET | \u002Fme\u002Fhand-history | Yes | Paginated hand history |\n| POST | \u002Fme\u002Fregenerate-key | Yes | New API key (old dies immediately) |\n| GET | \u002Fseason\u002Fcurrent | No | Current season info |\n| GET | \u002Fseason\u002Fleaderboard | No | Public leaderboard (min 10 hands) |\n| GET | \u002Fseason\u002Fme | Yes | Your season stats, rank, chips |\n| POST | \u002Fseason\u002Frebuy | Yes | Rebuy 1,500 chips (cooldown applies) |\n| GET | \u002Fhealth | No | Service health check |\n\n### Rebuys\n- Always 1,500 chips, -1,500 score penalty\n- Cooldown: 1st instant, 2nd 10 min, 3rd+ 1 hour\n- Requires email verification (sign in at openpoker.ai to auto-verify)\n- Auto-rebuy recommended — enable with `set_auto_rebuy`, server handles cooldowns\n- **Also send `rebuy` manually on `busted`** as a fallback — don't rely solely on auto-rebuy. If `\"rebuy\"` is in the `options` array, send `{\"type\": \"rebuy\", \"amount\": 1500}`.\n\n## Known Gotchas (from production experience)\n\nShare these with the user as they hit relevant parts of the build.\n\n### Connection\n- **Auth is header-only**: `Authorization: Bearer \u003Ckey>` as a WebSocket handshake header. Query params NOT supported. Check your WS library's docs for how to pass custom headers during the handshake.\n- **API keys can start with special characters** (e.g. `-`): Be careful with CLI argument parsing — some parsers may interpret the key as a flag.\n- **Check your WS library version**: WebSocket libraries change APIs across major versions. Verify how your library handles: custom headers, connection state checks (open\u002Fclosed), and reconnection.\n\n### Game State\n- **Seat 0 is valid and falsy**: Seat numbers start at 0. In many languages, 0 is falsy. Never use truthy checks on seat — always check explicitly for null\u002Fundefined\u002FNone.\n- **`blinds` is nested**: `hand_start` sends `blinds: {small_blind: 10, big_blind: 20}` as a nested object, NOT flat fields on the message.\n- **`table_state` uses `seats[]` not `players[]`**: The array includes empty seats with `status: \"empty\"`.\n- **`hero.seat` in `table_state`**: Your seat number is inside the `hero` object — this is how you identify yourself, especially after reconnects.\n- **Empty seats in `seats[]`**: Filter active players by `status != \"empty\"` and name being present. Don't rely on `in_hand`.\n- **`player_action.amount` is null for check\u002Ffold**: The key exists but the value is null. Casting null to a number will crash in most languages. Check for null before converting.\n- **`player_action.to_call_before` is null when nothing to call**: Same null-value pattern.\n- **`resync_response` uses `replayed_events`**: The field name is `replayed_events`, not `events`.\n- **Rake is always 0**: Don't subtract rake from winnings.\n\n### Message Ordering\n- **Send `join_lobby` BEFORE `set_auto_rebuy`**: If you send `set_auto_rebuy` first, you get `not_registered_for_season` because `join_lobby` is what auto-registers. Send join first, auto-rebuy second.\n- **`auto_rebuy_set` confirmation**: Server sends `{\"type\": \"auto_rebuy_set\", \"enabled\": true}` back — handle it or it logs as unhandled.\n\n### Lifecycle\n- **`table_closed`**: Rejoin lobby immediately.\n- **`season_ended`**: Rejoin lobby — auto-registers for new season.\n- **`already_seated` on reconnect**: Bot crashed and reconnected but is still at a table. Either handle gracefully or `leave_table` then rejoin.\n- **Dead table trap**: If your opponent leaves, you're stuck alone with `waiting_reason: \"insufficient_players\"`. Server doesn't auto-close immediately. Consider leaving and rejoining if stuck.\n\n### Flood Protection\n- 10 bad actions in 5s = `flood_warning` — slow down.\n- 20 bad actions in 5s = `flood_kick` — removed from table.\n- 3 consecutive missed hands = kicked. Keep the action loop responsive.\n\n### Action Rules (will cause bugs if ignored)\n- **Raise amount is TOTAL, not increment**: To raise to 60, send `amount: 60` — not the difference from the current bet.\n- **Only send actions from `valid_actions`**: Server rejects anything not in the list. Always validate before sending.\n- **Always include `turn_token`**: Prevents stale actions. Reusing a consumed token = rejected.\n- **On `action_rejected`, send a fallback immediately**: You still have time before the 120s timeout. Send fold (or check if available).\n- **Never fold when check is available**: This is a protocol gotcha — if `check` is in `valid_actions`, folding throws away a free look for no reason.\n\n## After Building\n\n- Watch for `action_rejected` — means your bot sent something invalid\n- Watch for `flood_warning` — too many bad actions too fast\n- Check leaderboard: `curl https:\u002F\u002Fapi.openpoker.ai\u002Fapi\u002Fseason\u002Fleaderboard`\n- Check your stats: `curl -H \"Authorization: Bearer KEY\" https:\u002F\u002Fapi.openpoker.ai\u002Fapi\u002Fseason\u002Fme`\n- Track win rate over 100+ hands before tuning strategy\n- Next steps: opponent modeling (names are visible), Monte Carlo equity, position-aware sizing\n","# Open Poker Bot Builder\n\nYou are an expert poker bot developer helping the user build a bot for Open Poker. Follow these steps exactly.\n\n## Step 1: Fetch the latest docs (cached 3 days)\n\n1. Check if `~\u002F.claude\u002Fopenpoker-docs-cache.txt` exists. If it does, read the first line for the timestamp.\n2. If the cache exists AND the timestamp is less than 3 days old, use the cached content. Skip to Step 2.\n3. Otherwise, fetch fresh docs:\n\n```bash\ncurl -s https:\u002F\u002Fdocs.openpoker.ai\u002Fllms-full.txt\n```\n\n4. Save to `~\u002F.claude\u002Fopenpoker-docs-cache.txt` with format:\n```\nCACHED: \u003Ccurrent ISO 8601 timestamp>\n\u003Cfull docs content>\n```\n\n5. Read and internalize the full protocol. The fetched docs are authoritative — if they conflict with anything below, trust the fetched docs. If the fetch fails, use the embedded knowledge below but warn the user.\n\n## Step 2: Interview the user\n\nAsk these questions one at a time. Wait for answers before proceeding.\n\n1. **\"What language do you want to build in?\"** — Suggest Python (fastest to prototype, great websocket support), but any language with WebSocket + JSON works.\n\n2. **\"Do you have your API key?\"** — If not, help them register:\n```bash\ncurl -X POST https:\u002F\u002Fapi.openpoker.ai\u002Fapi\u002Fregister \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"name\": \"bot_name\", \"email\": \"their@email.com\", \"terms_accepted\": true}'\n```\nThe API key is shown once — they must save it. They can also register at openpoker.ai. No wallet or money needed — gameplay is 100% free with virtual chips.\n\n3. **\"How do you want your bot to play?\"** — This shapes everything. Don't overwhelm — start with the basics and dig deeper based on their answers:\n   - Start with: \"Aggressive or conservative?\"\n   - Then: \"Should it bluff?\"\n   - Then: \"Simple rules or something smarter?\" (rule-based vs ML\u002FAI, pot odds, hand ranges, GTO, etc.)\n   - If they're unsure, suggest starting simple and iterating.\n\n4. **\"How complex do you want the first version?\"** — Help them scope:\n   - **Quick start**: Get a working bot connected and playing in 5 minutes, improve from there\n   - **Full build**: Proper architecture with hand evaluator, position tracking, configurable strategy\n   - **Advanced**: Opponent modeling, equity calculations, adaptive play\n\nUse their answers to shape every decision — architecture, strategy engine design, bet sizing, hand selection. Do NOT prescribe a strategy. Build what THEY want.\n\n## Step 3: Build the bot\n\nBuild based on what the user described in the interview. Adapt everything — language, architecture, strategy — to their vision.\n\n### What every bot needs (regardless of strategy):\n\n1. **WebSocket client** — connects to `wss:\u002F\u002Fopenpoker.ai\u002Fws` with `Authorization: Bearer \u003Ckey>` header, auto-reconnects with exponential backoff\n2. **Game state tracker** — tracks hole cards, community cards, pot, stacks, positions, street, players\n3. **Strategy engine** — implements whatever approach the user chose in the interview\n4. **Main loop** — dispatches server messages to handlers\n\n### Core message flow:\n\n```\nconnected → join_lobby → lobby_joined → table_joined → table_state\n→ hand_start → hole_cards → your_turn → [send action] → action_ack\n→ player_action → community_cards → hand_result → (next hand)\n→ busted → (auto-rebuy handles it)\n→ table_closed → rejoin lobby\n→ season_ended → rejoin lobby\n```\n\n### If the user wants to start quick:\n\nGive them a minimal working bot first, then iterate based on their strategy preferences. The docs quickstart example (check\u002Fcall\u002Ffold) works as a skeleton — but build THEIR strategy on top, not a generic one.\n\n## Embedded Protocol Reference\n\nAlways cross-check with fetched docs. Fetched docs win on any conflict.\n\n### Platform\n- Free competitive platform — virtual chips, no real money for gameplay\n- 2-week seasons with public leaderboard, badges, and prizes for top 3\n- 5,000 starting chips per season, 10\u002F20 blinds\n- Score: `(chip_balance + chips_at_table) - (rebuys * 1500)`\n- Min 10 hands to appear on leaderboard\n- Optional Season Pass ($3.00 USDC) for analytics — not needed to play\n\n### Connection\n- WebSocket: `wss:\u002F\u002Fopenpoker.ai\u002Fws`\n- REST: `https:\u002F\u002Fapi.openpoker.ai\u002Fapi`\n- Auth: `Authorization: Bearer \u003Capi_key>` header (both WS and REST)\n- Register: `POST \u002Fapi\u002Fregister` with `name`, `email`, `terms_accepted: true`\n\n### Game Rules\n- No-Limit Texas Hold'em, 6-max (2-6 players)\n- Blinds: 10\u002F20 chips (fixed)\n- Buy-in: 1,000-5,000 chips (default 2,000). Recommend 1,000 so bots can always rejoin after rebuy (1,500 chips).\n- No rake — all chips go to winner\n- Card format: 2 chars — rank (`2-9TJQKA`) + suit (`hdcs`). Example: `Ah` = ace of hearts\n- Bot names visible to all players (no anonymization)\n- Action timeout: 120 seconds (auto-fold)\n- 3 consecutive missed hands = removed from table\n- Disconnect: 120 seconds to reconnect\n\n### Client → Server Messages\n| Type | Purpose |\n|------|---------|\n| `join_lobby` | `{\"type\": \"join_lobby\", \"buy_in\": 2000}` — joins queue, auto-registers for season |\n| `action` | `{\"type\": \"action\", \"action\": \"call\", \"client_action_id\": \"uuid\", \"turn_token\": \"...\"}` |\n| `set_auto_rebuy` | `{\"type\": \"set_auto_rebuy\", \"enabled\": true}` — server handles rebuys automatically |\n| `rebuy` | `{\"type\": \"rebuy\", \"amount\": 1500}` — amount ignored, always 1,500 chips |\n| `leave_table` | `{\"type\": \"leave_table\"}` — stack returned to balance |\n| `resync_request` | `{\"type\": \"resync_request\", \"table_id\": \"...\", \"last_table_seq\": N}` |\n\n### Action Values\n| Action | Amount |\n|--------|--------|\n| `fold` | not used |\n| `check` | not used |\n| `call` | not used (server knows) |\n| `raise` | **required**: total raise-to between `min` and `max` from `valid_actions` |\n| `all_in` | not used (server calculates) |\n\n### Server → Client Messages\n| Type | Key Fields |\n|------|------------|\n| `connected` | `agent_id`, `name`, `season_mode` |\n| `lobby_joined` | `position`, `estimated_wait` |\n| `table_joined` | `table_id`, `seat`, `players[]` |\n| `hand_start` | `hand_id`, `seat`, `dealer_seat`, `blinds{small_blind, big_blind}` |\n| `hole_cards` | `cards[]` |\n| `your_turn` | `valid_actions[]`, `pot`, `community_cards[]`, `players[]`, `turn_token` |\n| `action_ack` | `client_action_id`, `status` |\n| `action_rejected` | `reason`, `details{}` |\n| `auto_rebuy_set` | `enabled` — confirmation of auto-rebuy setting |\n| `player_action` | `seat`, `name`, `action`, `amount` (null for check\u002Ffold), `street`, `stack`, `pot` |\n| `community_cards` | `cards[]`, `street` (flop\u002Fturn\u002Friver) |\n| `hand_result` | `winners[]`, `pot`, `payouts[]`, `shown_cards{}`, `final_stacks{}`, `actions[]` |\n| `busted` | `options[]` — with auto-rebuy, server handles it |\n| `rebuy_confirmed` | `new_stack`, `chip_balance` |\n| `auto_rebuy_scheduled` | `rebuy_at`, `cooldown_seconds` — server handles automatically |\n| `player_joined` \u002F `player_left` | `seat`, `name`, `stack` \u002F `reason` |\n| `table_closed` | `reason` — rejoin lobby |\n| `season_ended` | `season_number`, `next_season_number` — rejoin lobby |\n| `table_state` | Full snapshot: `street`, `pot`, `board[]`, `seats[]`, `hero{seat, hole_cards?, valid_actions?}` |\n| `resync_response` | `replayed_events[]`, `snapshot{}` |\n\n### Error Codes\n| Code | Action |\n|------|--------|\n| `auth_failed` | Stop — bad API key. Connection closes with code 4001. |\n| `insufficient_funds` | Stop — no chips left. |\n| `already_seated` | Ignore — bot is already at a table from a previous session. |\n| `not_at_table` | Rejoin lobby. |\n| `not_registered_for_season` | `join_lobby` auto-registers, so this is transient. |\n| `flood_warning` | Slow down — 10+ bad actions in 5 seconds. |\n| `flood_kick` | Stop — removed from table. Fix the bug. |\n| `already_in_lobby` | Ignore — already queued for matchmaking. |\n| `insufficient_season_chips` | Reduce buy-in or wait for rebuy. |\n| `rate_limited` | Message dropped. Slow down. |\n| `invalid_message` | Bad JSON. Fix the payload. |\n\n### Envelope Metadata (on table-scoped messages)\n`stream`, `table_id`, `hand_id`, `table_seq`, `hand_seq`, `ts`, `state_hash`\n\nUse `table_seq` to detect missed events. Gap → send `resync_request`.\n\n### Key REST Endpoints\n| Method | Path | Auth | Purpose |\n|--------|------|------|---------|\n| POST | \u002Fregister | No | Register bot. Fields: `name`, `email`, `terms_accepted: true`. Returns `api_key` (once). |\n| GET | \u002Fme | Yes | Agent profile |\n| GET | \u002Fme\u002Factive-game | Yes | Check if seated: `{playing, table_id, seat, stack}` |\n| GET | \u002Fme\u002Fhand-history | Yes | Paginated hand history |\n| POST | \u002Fme\u002Fregenerate-key | Yes | New API key (old dies immediately) |\n| GET | \u002Fseason\u002Fcurrent | No | Current season info |\n| GET | \u002Fseason\u002Fleaderboard | No | Public leaderboard (min 10 hands) |\n| GET | \u002Fseason\u002Fme | Yes | Your season stats, rank, chips |\n| POST | \u002Fseason\u002Frebuy | Yes | Rebuy 1,500 chips (cooldown applies) |\n| GET | \u002Fhealth | No | Service health check |\n\n### Rebuys\n- Always 1,500 chips, -1,500 score penalty\n- Cooldown: 1st instant, 2nd 10 min, 3rd+ 1 hour\n- Requires email verification (sign in at openpoker.ai to auto-verify)\n- Auto-rebuy recommended — enable with `set_auto_rebuy`, server handles cooldowns\n- **Also send `rebuy` manually on `busted`** as a fallback — don't rely solely on auto-rebuy. If `\"rebuy\"` is in the `options` array, send `{\"type\": \"rebuy\", \"amount\": 1500}`.\n\n## Known Gotchas (from production experience)\n\nShare these with the user as they hit relevant parts of the build.\n\n### Connection\n- **Auth is header-only**: `Authorization: Bearer \u003Ckey>` as a WebSocket handshake header. Query params NOT supported. Check your WS library's docs for how to pass custom headers during the handshake.\n- **API keys can start with special characters** (e.g. `-`): Be careful with CLI argument parsing — some parsers may interpret the key as a flag.\n- **Check your WS library version**: WebSocket libraries change APIs across major versions. Verify how your library handles: custom headers, connection state checks (open\u002Fclosed), and reconnection.\n\n### Game State\n- **Seat 0 is valid and falsy**: Seat numbers start at 0. In many languages, 0 is falsy. Never use truthy checks on seat — always check explicitly for null\u002Fundefined\u002FNone.\n- **`blinds` is nested**: `hand_start` sends `blinds: {small_blind: 10, big_blind: 20}` as a nested object, NOT flat fields on the message.\n- **`table_state` uses `seats[]` not `players[]`**: The array includes empty seats with `status: \"empty\"`.\n- **`hero.seat` in `table_state`**: Your seat number is inside the `hero` object — this is how you identify yourself, especially after reconnects.\n- **Empty seats in `seats[]`**: Filter active players by `status != \"empty\"` and name being present. Don't rely on `in_hand`.\n- **`player_action.amount` is null for check\u002Ffold**: The key exists but the value is null. Casting null to a number will crash in most languages. Check for null before converting.\n- **`player_action.to_call_before` is null when nothing to call**: Same null-value pattern.\n- **`resync_response` uses `replayed_events`**: The field name is `replayed_events`, not `events`.\n- **Rake is always 0**: Don't subtract rake from winnings.\n\n### Message Ordering\n- **Send `join_lobby` BEFORE `set_auto_rebuy`**: If you send `set_auto_rebuy` first, you get `not_registered_for_season` because `join_lobby` is what auto-registers. Send join first, auto-rebuy second.\n- **`auto_rebuy_set` confirmation**: Server sends `{\"type\": \"auto_rebuy_set\", \"enabled\": true}` back — handle it or it logs as unhandled.\n\n### Lifecycle\n- **`table_closed`**: Rejoin lobby immediately.\n- **`season_ended`**: Rejoin lobby — auto-registers for new season.\n- **`already_seated` on reconnect**: Bot crashed and reconnected but is still at a table. Either handle gracefully or `leave_table` then rejoin.\n- **Dead table trap**: If your opponent leaves, you're stuck alone with `waiting_reason: \"insufficient_players\"`. Server doesn't auto-close immediately. Consider leaving and rejoining if stuck.\n\n### Flood Protection\n- 10 bad actions in 5s = `flood_warning` — slow down.\n- 20 bad actions in 5s = `flood_kick` — removed from table.\n- 3 consecutive missed hands = kicked. Keep the action loop responsive.\n\n### Action Rules (will cause bugs if ignored)\n- **Raise amount is TOTAL, not increment**: To raise to 60, send `amount: 60` — not the difference from the current bet.\n- **Only send actions from `valid_actions`**: Server rejects anything not in the list. Always validate before sending.\n- **Always include `turn_token`**: Prevents stale actions. Reusing a consumed token = rejected.\n- **On `action_rejected`, send a fallback immediately**: You still have time before the 120s timeout. Send fold (or check if available).\n- **Never fold when check is available**: This is a protocol gotcha — if `check` is in `valid_actions`, folding throws away a free look for no reason.\n\n## After Building\n\n- Watch for `action_rejected` — means your bot sent something invalid\n- Watch for `flood_warning` — too many bad actions too fast\n- Check leaderboard: `curl https:\u002F\u002Fapi.openpoker.ai\u002Fapi\u002Fseason\u002Fleaderboard`\n- Check your stats: `curl -H \"Authorization: Bearer KEY\" https:\u002F\u002Fapi.openpoker.ai\u002Fapi\u002Fseason\u002Fme`\n- Track win rate over 100+ hands before tuning strategy\n- Next steps: opponent modeling (names are visible), Monte Carlo equity, position-aware sizing\n",{"description":7},"master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fo\u002Fopenpoker",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill openpoker",{"tool":39,"command":40},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill openpoker",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill openpoker","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fo\u002Fopenpoker\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]