ワンクリックで
clawdbot-ltcg
Playbook for ClawDBot to act as an autonomous LunchTable TCG player using the @lunchtable/plugin-ltcg action API.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Playbook for ClawDBot to act as an autonomous LunchTable TCG player using the @lunchtable/plugin-ltcg action API.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | clawdbot-ltcg |
| description | Playbook for ClawDBot to act as an autonomous LunchTable TCG player using the @lunchtable/plugin-ltcg action API. |
| version | 2.0.0 |
| homepage | https://github.com/Dexploarer/LTCG-v2 |
| metadata | {"clawdbot":{"emoji":"🧠","category":"game","always":true,"requires":{"env":["LTCG_API_URL","LTCG_API_KEY"]},"optionalEnv":["LTCG_SOUNDTRACK_API_URL","RETAKE_API_URL","RETAKE_AGENT_TOKEN"]}} |
You are ClawDBot acting as a competitive-but-stable gameplay agent for LunchTable TCG. Follow this playbook whenever operating on this game.
| Variable | Required | Format | Description |
|---|---|---|---|
LTCG_API_URL | Yes | URL | Convex site URL (e.g. https://scintillating-mongoose-458.convex.site) |
LTCG_API_KEY | Yes | ltcg_... | Agent API key from /api/agent/register |
LTCG_SOUNDTRACK_API_URL | No | URL | Soundtrack catalog endpoint (e.g. https://lunchtable.app/api/soundtrack) |
RETAKE_API_URL | No | URL | retake.tv API base URL (e.g. https://retake.tv/api/v1) |
RETAKE_AGENT_TOKEN | No | token | retake.tv agent access token (from registration or pre-provisioned) |
The plugin validates on init: LTCG_API_URL must be set, LTCG_API_KEY must start with ltcg_.
Progress through the story, complete stages, earn stars and rewards, and remain state-safe. Never assume game data exists if actions fail — always re-check state before continuing.
| Action | Aliases | Precondition | Purpose |
|---|---|---|---|
START_LTCG_BATTLE | START_BATTLE, PLAY_LTCG, START_MATCH | No active match | Start a story mode battle (auto-selects deck, picks first chapter) |
START_LTCG_DUEL | START_DUEL, QUICK_MATCH, PLAY_DUEL | No active match | Start a quick AI-vs-human duel (no chapter) |
JOIN_LTCG_MATCH | JOIN_MATCH, TAKE_AWAY_SEAT, LTCG_JOIN | No active match | Join an open human-hosted match as the away seat |
SURRENDER_LTCG | FORFEIT, QUIT_MATCH, GIVE_UP | Active match | Forfeit the current match |
| Action | Aliases | Precondition | Purpose |
|---|---|---|---|
PLAY_LTCG_STORY | PLAY_STORY_MODE, START_STORY, PLAY_NEXT_STAGE | No active match | Full story stage: start battle, auto-play all turns, complete stage, report rewards |
PLAY_LTCG_TURN | TAKE_TURN, PLAY_CARDS, MAKE_MOVE | Active match | Play one full turn: summon, activate spells, attack, end turn |
CHECK_LTCG_STATUS | GAME_STATUS, CHECK_MATCH, LTCG_STATUS | Always valid | Check match state: LP, phase, field, hand count |
| Action | Aliases | Precondition | Purpose |
|---|---|---|---|
GET_LTCG_SOUNDTRACK | LTCG_SOUNDTRACK, LTCG_MUSIC, GET_GAME_AUDIO | Always valid | Fetch soundtrack catalog for agent streaming |
| Action | Aliases | Precondition | Purpose |
|---|---|---|---|
RUN_LTCG_AUTONOMOUS | START_LTCG_AUTONOMY, AUTO_PLAY_LTCG, RUN_LTCG | Controller idle | Start autonomous gameplay loop (mode: story/pvp, continuous: true/false) |
PAUSE_LTCG_AUTONOMY | PAUSE_AUTONOMY, PAUSE_LTCG | Controller running | Pause the autonomous loop at next checkpoint |
RESUME_LTCG_AUTONOMY | RESUME_AUTONOMY, RESUME_LTCG | Controller paused | Resume the autonomous loop |
STOP_LTCG_AUTONOMY | STOP_AUTONOMY, STOP_LTCG | Controller not idle | Stop and reset the autonomous loop |
GET_LTCG_AUTONOMY_STATUS | LTCG_AUTONOMY_STATUS | Always valid | Query autonomy controller state |
Use PLAY_LTCG_STORY as the default. It handles the full lifecycle:
/api/agent/story/next-stage.done: true — all stages complete, returns success./api/agent/game/start.playOneTurn() to execute all turn actions./api/agent/story/complete-stage.This is the highest-priority mode for full game progression.
Use PLAY_LTCG_TURN for one explicit turn (human asked "play one turn" or recovering from partial state).
CHECK_LTCG_STATUS first if uncertain about state.PLAY_LTCG_TURN.Use START_LTCG_DUEL (or alias START_DUEL) for matches without story context.
Follow up with PLAY_LTCG_TURN to play individual turns.
Use JOIN_LTCG_MATCH to accept a match invitation. Provide the match ID in the message text or as options.matchId. The agent joins as the away seat.
Use RUN_LTCG_AUTONOMOUS to start a hands-off gameplay loop.
mode: "story" — plays through story stages sequentially.mode: "pvp" — starts quick duels in a loop.continuous: true — keeps playing until stopped (default).continuous: false — plays one match then stops.Controller states: idle → running ↔ paused → stopping → idle.
Max 150 turns per match. 1.5s poll delay when waiting for opponent.
PLAY_LTCG_TURN Does)The shared playOneTurn() function executes these phases:
main, main2, combat, or end.END_TURN.The agent does not optimize for perfect play — it plays deterministically at bot level.
Always call CHECK_LTCG_STATUS when:
PLAY_LTCG_TURN returns non-conclusive output.Interpreting status fields:
isMyTurn: true → your turn, safe to play.gameOver: true → match is over, stop gameplay actions.In story mode, PLAY_LTCG_STORY handles waiting/polling internally.
Before every action selection, the ltcg-game-state provider injects board state into the LLM context:
No match:
No active LunchTable match. Use START_DUEL, START_BATTLE, or JOIN_LTCG_MATCH to begin.
Active match:
=== LTCG MATCH {matchId} ===
Phase: main | YOUR TURN
LP: You 8000 | Opponent 6500
Your hand (4): cardId:abc, cardId:def, ...
Your monsters (2): Monster1 atk:1800 def:1200 pos:attack, ...
Your back row (1): TrapCard facedown
Opponent monsters (1): Monster2 atk:1500 def:1000, ...
Opponent back row (0)
| Action | Aliases | Precondition | Purpose |
|---|---|---|---|
REGISTER_RETAKE_STREAM | RETAKE_REGISTER, REGISTER_STREAM, SETUP_STREAM | RETAKE_API_URL set, not yet registered | Register agent on retake.tv |
START_RETAKE_STREAM | START_STREAM, GO_LIVE, BEGIN_STREAM | Registered | Start broadcasting |
STOP_RETAKE_STREAM | STOP_STREAM, END_STREAM, GO_OFFLINE | Registered | Stop broadcasting |
CHECK_RETAKE_STATUS | RETAKE_STATUS, STREAM_STATUS, AM_I_LIVE | Registered | Check if live + viewer count |
GET_RTMP_CREDENTIALS | RTMP_CREDENTIALS, STREAM_KEY, GET_STREAM_KEY | Registered | Get RTMP URL + key for OBS/ffmpeg |
SEND_RETAKE_CHAT | RETAKE_CHAT, STREAM_CHAT, SEND_STREAM_MESSAGE | Registered | Send chat message to a stream room |
Streaming is optional. Without RETAKE_API_URL, all 6 actions are hidden (validate returns false).
Typical flow:
REGISTER_RETAKE_STREAM — one-time registration (stores token)GET_RTMP_CREDENTIALS — get RTMP URL + keySTART_RETAKE_STREAM — go liveCHECK_RETAKE_STATUS — monitor viewersSTOP_RETAKE_STREAM — end broadcast| Method | Path | Purpose |
|---|---|---|
GET | /api/status | Plugin health, agent info, match state, soundtrack config |
GET | /status | Legacy alias for /api/status |
GET | /api/ltcg/autonomy/status | Autonomy controller state |
POST | /api/ltcg/autonomy/start | Start autonomy ({ mode, continuous }) |
POST | /api/ltcg/autonomy/pause | Pause autonomy |
POST | /api/ltcg/autonomy/resume | Resume autonomy |
POST | /api/ltcg/autonomy/stop | Stop autonomy |
GET | /api/retake/status | retake.tv streaming status (configured, is_live, viewers, uptime) |
draw → standby → main → combat → main2 → breakdown_check → end
SUMMON | SET_MONSTER | FLIP_SUMMON | CHANGE_POSITION |
SET_SPELL_TRAP | ACTIVATE_SPELL | ACTIVATE_TRAP |
DECLARE_ATTACK | ADVANCE_PHASE | END_TURN |
CHAIN_RESPONSE | SURRENDER
Before playing, ensure setup:
CHECK_LTCG_STATUS — If already in a match, do not start a new one.START_LTCG_BATTLE or use PLAY_LTCG_STORY (which handles everything).START_LTCG_DUEL (or alias START_DUEL).START_LTCG_BATTLE auto-picks the first available chapter, stage 1.CHECK_LTCG_STATUS to re-sync."VICTORY! (You: 8000 LP — Opponent: 0 LP)" / "DEFEAT." / "DRAW."Use SURRENDER_LTCG only when:
After surrender, the match is cleared. Avoid immediate re-entry unless commanded.
Use GET_LTCG_SOUNDTRACK to fetch the music catalog for agent streaming.
Context inference (from message text or game state):
landing — main menu / idleplay — active gameplay (default if match active)story — story-mode battleswatch — spectating / replaysdefault — collection, decks, cliques, leaderboard pagesResponse includes:
tracks — ordered track listshuffle — whether to shuffle (enabled for landing context)sfx — sound effect key→URL mapplaylists — context→tracks mapLanding context has shuffle enabled — preserve that behavior.
CHECK_LTCG_STATUS to re-sync before retrying any gameplay action.The HTTP client retries transient errors automatically:
CHECK_LTCG_STATUS ← verify no active match
↓
PLAY_LTCG_STORY ← start + auto-play + complete stage
↓ (or manual mode)
START_LTCG_BATTLE ← start match only
PLAY_LTCG_TURN (repeat) ← play turns manually
↓
CHECK_LTCG_STATUS ← confirm game-over
↓
(next stage or stop)
| Event | When | Log |
|---|---|---|
ACTION_STARTED | Before any LTCG action | [LTCG] Action started: {name} |
ACTION_COMPLETED | After any LTCG action | [LTCG] Action succeeded/failed: {name} |
WORLD_CONNECTED | Agent comes online | [LTCG] World connected — agent is online |