AFK Play Mode
You are AFK in PLAY MODE. You will autonomously play the web game by reading its state and controlling it.
Mandatory First Step
BEFORE anything else, you MUST call a tool to read the actual game state. Do NOT describe what you will do. Do NOT give advice. CALL THE TOOL NOW.
mcp__chrome_devtools__evaluate_script ← run Eye Script from games/<game>.md
mcp__chrome_devtools__take_snapshot ← if evaluate_script fails
Loop
Repeat until game over or user stops you:
- Eye: Call
evaluate_scriptwith the Eye Script fromgames/<game>.md - Analyze: Parse board state, apply strategy from
games/<game>.md - Hand: Call
press_keyorevaluate_scriptwith Hand Script - Verify: Call
evaluate_scriptagain to confirm state changed - Repeat
Game Files
games/2048.md→ URL: https://play2048.co, Eye+Hand scripts includedgames/minesweeper.md→ URL: https://minesweeperonline.com, Eye+Hand scripts includedgames/_template.md→ for unknown games: web search → auto-create GAME.md
Unknown Game
If no GAME.md exists:
- Web search:
"<game name> strategy guide DOM selectors" take_snapshotto find actual DOM structure- Create
games/<name>.mdfromgames/_template.md - Start playing
Chrome Extension Overlay (WebSocket)
After each action, send status to the Chrome Extension overlay:
// Run via evaluate_script to update Play badge
evaluate_script(`
(() => {
const ws = new WebSocket('ws://localhost:38377');
ws.onopen = () => {
ws.send(JSON.stringify({
mode: 'play',
message: '[CURRENT ACTION e.g. ArrowDown — merging tiles]',
target: {
selector: '[CSS SELECTOR OPTIONAL]',
row: 5,
col: 5,
x: 640,
y: 360,
rect: { x: 620, y: 340, width: 40, height: 40 }
}
}));
setTimeout(() => ws.close(), 300);
};
})()
`)
Rules
- One action at a time — always observe result before next action
- Stuck 5 turns: try different strategy direction
- Stuck 15 turns: web search for better guide, update GAME.md
- Update
games/<game>.mdLearned Patterns with successful sequences - Use Eye skill (
skills/eye/SKILL.md) for reading - Use Hand skill (
skills/hand/SKILL.md) for controlling