puzzle
What it does
This skill guides building discrete board puzzles where moves change the board by fixed rules. It is for developers making match-3, block-pushing, or logic puzzle games.
When to use it
- βWhen you are building a match-3 game with cascades or a sokoban style block pusher.
- βWhen you need undo for a grid-based puzzle.
- βWhen you want levels to be solvable and the rules to resolve the same way every time.
Skill link
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/genres/puzzle/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βI am making a match-3 puzzle game. Can you set up the grid, the match detection, cascades and an undo button?β
5 new skills a week. 1 minute to read.
How it works
The agent builds a board model as the single source of truth, applies each move through fixed rules such as matching, falling, and filling, and resolves cascades in order. It stores moves so the player can undo them.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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 + RNG).
def make_move(move):
history.append(snapshot(board, score, moves_left, rng.state)) # push BEFORE applying
apply(move); resolve(board); moves
FAQ
Why must the board resolve deterministically?
The skill says the same move must always give the same result, so the puzzle stays fair and bugs can be repeated.
Does it cover real-time grid action?
No. Real-time grid action with permadeath is covered by the roguelike skill.
Does it cover tile rendering?
Tile drawing is covered by the engine tilemap skills, which this one points to.
Details
Original description by the author
Build a puzzle game: grid/board state, move input, rule-based resolution (match-3 cascades, sokoban pushes, tile logic), scoring, and undo. Use for a match-3, sokoban, or grid-logic puzzle.
Popularity
- GitHub stars
- 6.6k
- Ranking position
- #13810
- License
- Apache-2.0
- Updated
- 10/28/2026
Comments
- β¦
More skills from this repository
router
6.6kHelps your agent pick the right game development skill for a request by detecting your engine and the kind of task you need.
ai-behavior-trees-utility-ai
6.6kHelps your agent build a behavior tree and utility AI system for game enemies and characters that choose actions by priority and score.
audio-design
6.6kTeaches your agent game audio mixing: buses, decibel volume, ducking under dialogue, adaptive music and sound effect variation.
camera-systems
6.6kHelps your agent build game cameras that follow smoothly, stay inside the level, and orbit or look around in 3D.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.