play-llm-connect4
Play a complete Connect Four game through the installed `connect4` CLI, against a person in the browser or as one color in independent CLI-vs-CLI play. Use for moves, waiting, takebacks, resignation,
SKILL.mdconnect4/src/llm_connect4/skills/play-llm-connect4/SKILL.md
GitHubPlay LLM Connect Four
A person starts and plays a human-vs-LLM game in the browser. In CLI-vs-CLI mode, two independent assistant sessions control Red and Yellow. Use each returned state snapshot as the current game state.
Start or resume
- Check
connect4 --helpfor the available commands, then readconnect4 status. - If the command is missing, tell the user that LLM Connect Four must be installed. If the server is unreachable, start
connect4 startas a persistent process and use a separate shell for play commands. - If
statusreportssetup, ask the user to choose the game mode and optional names in the browser. In human-vs-LLM mode, the person chooses Red or Yellow there. The CLI has no game-creation command. - In CLI-vs-CLI mode, assign one independent session to each color. Prefix every participant command with
connect4 --color redorconnect4 --color yellow, includingstatus,wait,move,takeback, andresign.
Play each turn
- Read the returned
status,turn,legal_columns,takeback,event, andresult. Red moves first. A move is a number from the currentlegal_columns, submitted asconnect4 move COLUMNorconnect4 --color COLOR move COLUMN. - If it is the person's turn, run
connect4 waitand continue from the returned snapshot. In CLI-vs-CLI mode, use the session's color withwaitwhile the other color acts. Keep at most one pending wait command per session. - By default,
movewaits until this participant can act again or a relevant game state arrives. Use--no-waitwhen an immediate return is needed; then usestatusorwaitto continue. - When a pending takeback request comes from the other participant, decide whether to accept or reject it using the user's direction and game context. Run
connect4 takeback acceptorconnect4 takeback rejectwith the session's color when applicable. Resolve the request before trying another move. - To undo this participant's most recent move, run
connect4 takeback request. The request waits for the other participant's reply. Acceptance restores the position before that move, also removing any subsequent moves. - To resign, run
connect4 resignwith the session's color when applicable. End the game loop whenstatusiswon,draw, orresigned, and reportresult. - A
game_resetevent means a new game has replaced the previous one. Runstatusagain and follow the new game state.
Operating boundaries
- Choose moves from
legal_columnsin the latest returned snapshot; do not guess legal columns or a result from the displayed board alone. - The browser controls human moves, color choice, and starting or resetting a game. The CLI does not run the other assistant session automatically.
- Keep the server process running throughout play.