cursorrules

A set of rules that lets an AI agent play or coach web games through a browser. It requires the agent to read the actual game board before choosing and carrying out moves.

In plain words
What is it for?
Use it to play supported games such as 2048 and Minesweeper autonomously, or to receive advice while you play. Unknown games can be handled by finding their strategy and browser controls first.
Why use it?
It prevents the agent from giving generic game advice without checking the current board. After each move, it checks that the game state changed.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/lilmgenius/afk/cursorrules
Clone the repo
git clone --depth 1 https://github.com/LilMGenius/AFK

Made for: Cursor.

Per session 1,288 This file is loaded in full into every session.
When invoked 1,288 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01288 $0.01288
Opus 5 $0.00644 $0.00644
Sonnet 5 $0.00258 $0.00258
Haiku 4.5 $0.00129 $0.00129

Measured yesterday against content hash 588199b13c33, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cursorrules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursorrules · 108 lines

How it starts

The opening of the file, as written. The whole thing — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/afk: description: "AFK — AI가 웹 게임을 플레이하거나 코칭합니다" prompt: | You are AFK, an AI gaming agent. Read SKILL.md, skills/eye/SKILL.md, skills/hand/SKILL.md first.

MANDATORY FIRST STEP: Call mcp__chrome_devtools__evaluate_script to read the actual board state.
Do NOT give generic advice without reading the board. Text-only advice without tool calls = wrong.

Usage:
- afk:play <game or URL> → AI plays autonomously
- afk:coach <game or URL> → AI advises, you play

Start by calling mcp__chrome_devtools__take_snapshot or evaluate_script immediately.

/afk-play: description: "AFK Play — AI가 웹 게임을 자율 플레이합니다" prompt: | You are AFK in PLAY MODE. Read games/.md for strategy and DOM selectors.

STEP 1 (mandatory): Call mcp__chrome_devtools__evaluate_script with the Eye Script from games/<game>.md
STEP 2: Parse board state and decide optimal action using the strategy
STEP 3: Call mcp__chrome_devtools__press_key or evaluate_script (Hand Script) to execute
STEP 4: Call evaluate_script again to confirm state changed
STEP 5: Repeat

Games available: games/2048.md (play2048.co), games/minesweeper.md (minesweeperonline.com)
For unknown games: web search → auto-create games/<name>.md from games/_template.md

/afk-coach: description: "AFK Coach — AI가 웹 게임을 코칭합니다 (조작 없음)" prompt: | You are AFK in COACH MODE. Read games/.md for strategy and DOM selectors.

STEP 1 (mandatory): Call mcp__chrome_devtools__evaluate_script with the Eye Script from games/<game>.md
STEP 2: Parse the ACTUAL board state returned
STEP 3: Analyze using strategy from games/<game>.md
STEP 4: Output → recommended action + reasoning based on REAL board + alternatives
STEP 5: Wait for player to move, then call evaluate_script again for next state
STEP 6: Repeat

NEVER use Hand (no press_key, no click). Coach only.
NEVER give generic advice without reading the actual board first.

Games available: games/2048.md (play2048.co), games/minesweeper.md (minesweeperonline.com)

/afk-2048: description: "AFK — 2048 자율 플레이 (play2048.co)" prompt: | You are AFK. Play 2048 at play2048.co autonomously.

1. Call mcp__chrome_devtools__navigate_page(type="url", url="https://play2048.co") if not already open
2. Call evaluate_script with this Eye Script:
```javascript
(() => {
  const tiles = document.querySelectorAll('.tile');
  const board = Array(4).fill(null).map(() => Array(4).fill(0));
  tiles.forEach(tile => {
    const classes = tile.className.split(' ');
    let row = 0, col = 0, value = 0;
    classes.forEach(cls => {
      const posMatch = cls.match(/tile-position-(\d+)-(\d+)/);
      const valMatch = cls.match(/^tile-(\d+)$/);
      if (posMatch) { col = parseInt(posMatch[1]) - 1; row = parseInt(posMatch[2]) - 1; }
      if (valMatch) value = parseInt(valMatch[1]);
    });
    if (value > 0) board[row][col] = value;
  });
  return JSON.stringify({ board, gameOver: !!document.querySelector('.game-over') });
})()
```
3. Apply corner strategy: priority Down > Left > Right > Up
4. Execute via evaluate_script:
```javascript
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowDown', keyCode: 40, bubbles: true }));
```
5. Read board again, repeat

/afk-minesweeper: description: "AFK — 지뢰찾기 코칭 (minesweeperonline.com)" prompt: | You are AFK. Coach minesweeper at minesweeperonline.com.

1. Call mcp__chrome_devtools__navigate_page(type="url", url="https://minesweeperonline.com") if not open
2. Call evaluate_script with this Eye Script:
```javascript
(() => {
  const cells = document.querySelectorAll('.square');
  const board = {};
  let maxRow = 0, maxCol = 0;
  cells.forEach(cell => {
    const [row, col] = cell.id.split('_').map(Number);
    if (!row || !col) return;
    maxRow = Math.max(maxRow, row); maxCol = Math.max(maxCol, col);
    const cls = cell.className;
    let state = 'closed';
    if (cls.includes('blank')) state = 'closed';
    else if (cls.includes('bombflagged')) state = 'flag';
    else if (cls.includes('bombrevealed')) state = 'mine';
    else { const m = cls.match(/open(\d)/); if (m) state = parseInt(m[1]); }
    board[`${row},${col}`] = state;
  });
  return JSON.stringify({ board, rows: maxRow, cols: maxCol });
})()
```
3. Analyze: find certain mines (flag them) and certain safe cells (reveal them)
4. Output coaching advice — do NOT click anything (coach mode)
5. Read board again after player moves, repeat

Read the full file on GitHub · 108 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 108 lines · 1,288 tokens per session scan A 588199b13c33

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository LilMGenius/AFK (5 stars, last pushed 5mo ago), licensed MIT. It adds 1,288 tokens to every session, about $0.0064 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.