mcpbeat Sign in

Puzzle Agent Skill

> pushes, tile logic), scoring, and undo. Use for a match-3, sokoban, or grid-logic puzzle.

3k tokens
context cost
the whole folder, loaded on every use
2
files
instructions only
0
copies elsewhere
how many repositories repackaged it
401
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/gamedev-skills/awesome-gamedev-agent-skills --skill puzzle

The instruction itself

12 sections, as written by the author

Puzzle

A playbook for grid/board puzzle games — the board model, move input, rule resolution

(matching, pushing, logic), scoring, undo, and level progression. This is a compositional

skill: it models board state and rules and presents them through a tilemap/UI. It does not

re-teach tilemaps; it defines the resolution loop and the correctness rules (clean state,

deterministic resolution, undo) that keep a puzzle fair and bug-free.

When to use

  • Use when the game is a discrete board the player changes with moves, and the board

resolves by rules: match-3/tile-matching, sokoban/block-pusher, sliding puzzle, logic grid.

  • Use when designing match/cascade resolution, undo, level progression, or solvability.

When *not* to use: real-time grid action with permadeath → roguelike. Card zones/turns →

card-game. Physics-based "puzzle platformer" → platformer + physics-tuning. For the tile

rendering, use godot-tilemap / unity-tilemap-2d.

Core loop

**Read the board → plan a move → make the move → the board resolves by its rules (match, push,

fall, fill, cascade) → see progress toward the objective → repeat until solved/failed.** The

fun is the *planning*; the engine's job is to resolve each move deterministically and

present it clearly.

Must-have systems

  • Board model — a grid of cells holding pieces; the single source of truth (logic, not visuals).
  • Move input — swap, push, drag, rotate, or place; validate legality before applying.
  • Rule resolution — detect and apply the genre's rule (matches, pushes, logic) until stable.
  • Cascades/chains — when resolution changes the board, re-resolve until no more changes.
  • Objectives + scoring — win/lose conditions (score, clear all, reach goal); move/time limits.
  • Undo — revert the last move (and its resolution) exactly; essential for thinky puzzles.
  • Level progression + (often) generation — hand-authored or generated solvable boards.
  • Feedback ("juice") — clear, satisfying animation/sound for matches, falls, and chains.

Design knobs

| Knob | Effect | Notes |

|------|--------|-------|

| Grid size / shape | complexity | Square is standard; hex/irregular change feel. |

| Match/push rule | genre identity | 3-in-a-row, shapes, push-into-goal, etc. |

| Cascade scoring | reward depth | Bigger chains = exponential payoff. |

| Move / time limit | pressure | Move-limited = puzzly; time = arcade. |

| Difficulty curve | learning | Introduce one mechanic at a time. |

| Undo depth | forgiveness | Single-step vs. full history. |

| Solvability guarantee | fairness | Generated boards must be solvable. |

| Deadlock handling | no dead ends | Detect no-moves; shuffle or end (refs). |

Patterns

1. Board model + match detection (logic separate from visuals)

# Pseudocode. The board is the truth; rendering reads from it. (0,0) top-left, y grows down.
board = [[piece_or_empty for _ in range(W)] for _ in range(H)]

def find_matches(board):
    matched = set()
    for y in range(H):                       # horizontal runs of >= 3 equal pieces
        run = 1
        for x in range(1, W):
            if board[y][x] and board[y][x] == board[y][x-1]: run += 1
            else:
                if run >= 3: matched |= {(y, k) for k in range(x-run, x)}
                run = 1
        if run >= 3: matched |= {(y, k) for k in range(W-run, W)}
    # ... repeat the same scan vertically (columns) ...
    return matched

2. Resolve → collapse → refill → cascade (repeat to stability)

# Pseudocode. One player move can trigger a chain; loop until the board stops changing.
def resolve(board):
    chain = 0
    while True:
        matches = find_matches(board)
        if not matches: break                 # stable: resolution complete
        chain += 1
        score += score_for(matches, chain)    # later chain steps score more (see refs)
        clear(board, matches)                  # remove matched pieces
        apply_gravity(board)                   # pieces fall into the gaps
        refill(board, rng)                      # spawn new pieces at the top (seeded RNG)
    return chain

3. Undo via state snapshot or command

# Pseudocode. Snapshot before each move; undo restores it exactly (board + score + counters).
def make_move(move):
    history.append(snapshot(board, score, moves_left))   # push BEFORE applying
    apply(move); resolve(board); moves_left -= 1

def undo():
    if history:
        board, score, moves_left = history.pop()         # exact revert, including resolution

For large boards prefer the command pattern (store the move + enough to invert it) over full

snapshots to save memory; snapshots are simplest and fine for small boards.

Pitfalls / failure modes

  • Mixing logic and visuals → animations desync from state and cause bugs. The board model is

the single source of truth; the view only renders it.

  • Resolving only once → cascades/chains are missed. Loop resolution until the board is stable

(Pattern 2).

  • Undo that doesn't restore everything → score/move-count/random-state drift. Snapshot *all*

state, or make the move fully invertible.

  • Unseeded refill RNG → can't reproduce a level / no deterministic undo or daily puzzle. Seed it.
  • Generated boards that aren't solvable → unfair dead ends. Generate-and-verify, or generate

from a known solution backward (refs).

  • No deadlock detection (match-3) → board with no valid moves softlocks. Detect "no moves"

and shuffle or end the level (refs).

  • Difficulty spikes → too many mechanics at once. Teach one mechanic per level before combining.
  • Resolution mid-animation accepts input → double-moves/corruption. Lock input until the

board is stable.

Composition (build it from these skills)

  • Board rendering: godot-tilemap / unity-tilemap-2d for the grid; godot-ui-control for HUD, score, and menus.
  • Levels: level-design for hand-authored puzzles and difficulty pacing; procedural-gen for solvable generated boards.
  • Persistence: save-systems for level progress, high scores, and seeded daily puzzles.
  • Juice: game-feel for match/cascade pop, screen shake, and chain feedback; the engine animation/Tween skill for swaps/falls/clears; audio-design for match and chain cues.
  • Scripting: godot-gdscript / unity-csharp-scripting for the resolution loop and rules.

References

  • For match-3 detection/gravity/refill/cascade detail, deadlock detection and reshuffles,

sokoban/rule-based puzzles, undo strategies, solvable generation, and scoring, read

references/board-and-resolution.md.

Other skills for the same job

different authors, same section of the catalogue
Protocolsio Integration
by christophacham
×4

Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.

16k tokens
Tailored Resume Generator
by frostant
×4

Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances

3k tokens
Excalidraw Diagram Generator
by github
vendor ×3

Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.

36k tokens scripts
Expo Dev Client
by openai
vendor ×3

Build and distribute Expo development clients locally or via TestFlight

961 tokens
Executing Plans
by ZhanlinCui
×3

Use when you have a written implementation plan to execute in a separate session with review checkpoints

542 tokens
Anndata
by christophacham
×3

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

16k tokens
Benchling Integration
by christophacham
×3

Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.

14k tokens
Biopython
by christophacham
×3

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

24k tokens

How to use it

Copy the folder

Take gamedev-skills/puzzle from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.