
Game Jam
- 3 installs
- 64 repo stars
- Updated August 5, 2026
- contentful/skill-kit
Follow a guided workflow to design and build a browser-based Tetris game while demonstrating skill-kit interactive primitives.
About
Walks through designing, planning, and building a browser-based Tetris game as a skill-kit demo of SDK primitives. A developer uses it as a tutorial for guided game creation and skill-kit workflows.
- Guided workflow to design and build a browser-based Tetris game
- Demonstrates skill-kit primitives: askUser, confirm, plan, checklist, subagent
Game Jam by the numbers
- 3 all-time installs (skills.sh)
- Ranked #212 of 247 Game Development skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/contentful/skill-kit --skill game-jamAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 3 |
|---|---|
| repo stars | ★ 64 |
| Last updated | August 5, 2026 |
| Repository | contentful/skill-kit ↗ |
What it does
Follow a guided workflow to design and build a browser-based Tetris game while demonstrating skill-kit interactive primitives.
Files
game-jam
This skill is a structured workflow. You interact with it via MCP tools (preferred) or a CLI binary (fallback), reading its JSON output, following the instructions in the prompt field, and passing your response back. Do not show the raw JSON or tool calls to the user.
Use MCP tools if available. If you have mcp__game-jam__start and mcp__game-jam__advance, use MCP mode. Only fall back to CLI mode if MCP tools are not available in your environment.
How this skill works
This skill was built with skill-kit, a structured workflow engine. Each step provides a prompt containing XML-tagged sections:
- `<system>` — Behavioral directives: persona, tone, or constraints. Follow as
guidelines for how to behave, not as tasks to relay to the user.
- `<prompt>` — Task instructions: what to do, what context to consider, what to produce.
- `<ask-user>` — Ask the user a question. Contains
<option>children for structured
choices, or type="open" for free-form conversation.
- `<confirm>` — Binary yes/no confirmation. Attributes:
default,destructive. - `<plan>` — Present a plan for approval. Contains
<step>children. - `<checklist>` — Create tracked work items. Contains
<item>children with status. - `<subagent>` — Delegate work to an isolated sub-agent. If
no-recurseis set,
the subagent must not invoke the skill named in the attribute.
- `<rendered>` — Pre-rendered output. Emit verbatim — no edits, no added commentary.
A step may contain one or more of these sections in sequence. Follow them in order.
The skill author composed these sections to guide your behavior. The tags and tool mappings are generated by the SDK based on the author's intent and your host's capabilities. A skill-level system directive may appear in the preamble — it applies to all steps unless a step includes its own <system> override.
The preamble (sent on the first step) contains a table mapping each tag to the specific tool available in your environment. Refer to it throughout the workflow.
How to run this skill
MCP mode (preferred)
If you have MCP tools for this skill (e.g., mcp__game-jam__start and mcp__game-jam__advance), use them instead of the CLI:
1. Call the start tool (with params if the skill requires them). 2. Read the preamble field (first call only). It maps XML tags to your available tools. 3. Follow the prompt instructions. Produce a JSON object matching the schema. 4. Call the advance tool with the session, step, and output. 5. Repeat steps 3-4 until status is "done".
If you get status: "error" with retry: true, fix your output and resubmit. Do not show raw JSON, session IDs, or MCP tool calls to the user.
Skip the rest of this section — the CLI instructions below are only needed when MCP tools are not available.
CLI mode (fallback)
This SKILL.md file is inside the skill directory. Resolve the absolute path to scripts/run from this file's location (e.g., /path/to/skill/scripts/run). Use the absolute path in all Bash commands — do not cd into the skill directory.
In the examples below, <skill>/scripts/run is a placeholder for this absolute path.
Detect your host
Determine which agent host you are running in, and pass it as --host:
- Claude Code:
--host claude-code - Codex:
--host codex - OpenCode:
--host opencode - Gemini CLI:
--host gemini-cli - Cline:
--host cline - Roo Code:
--host roo-code - Kilo Code:
--host kilo-code - Cursor:
--host cursor - Amp:
--host amp - Unknown/other: omit the flag (defaults to generic)
Report your tools
Pass the tools you have available as a comma-separated --tools flag on the start command. The session remembers them — you don't need to pass --tools on advance.
When --host is provided, --tools is merged with the host's known tool registry. This means partial reporting is handled gracefully — the registry fills in any tools you omit. If --tools is omitted entirely, the skill infers tools from --host. If both are omitted, all interactions use generic fallbacks.
Subagent invocations
If you are a subagent (spawned by another agent, not the top-level agent the user is talking to), add --subagent to the start command. This tells the skill that your reported tools are a genuine subset — the skill will not merge them with the host registry.
Without --subagent, the skill assumes you are a top-level agent and merges your tools with the registry (since top-level agents often under-report their tools).
Parameters
| Name | Type | Required | Default |
|---|---|---|---|
difficulty | "advanced" \ | "beginner" \ | "intermediate" |
All parameters have defaults — --params '{}' is valid.
Example:
{ "difficulty": "intermediate" }Step 1: Start with a session
<skill>/scripts/run --params '{}' --host claude-code --tools <your-tools> --session new 2>/dev/nullThis returns a JSON pointer with sessionId, file, and line. The line field tells you which line to read — it will be 2, not 1 (line 1 is an internal header, never read it).
Read only line line from file. It contains the step prompt, schema, and preamble.
Read the `preamble` first. It contains a table mapping XML tags to the tools available in your environment. Refer to it throughout the workflow.
Step 2: Follow the prompt
Read the prompt field. It contains XML-tagged sections (described in "How this skill works" above): <system> directives to follow, <prompt> instructions to act on, and interaction tags (<ask-user>, <confirm>, <plan>, <checklist>, <subagent>) to execute using the tools mapped in the preamble. If a <rendered> block appears, emit its content verbatim.
Produce a JSON object matching the schema.
Step 3: Advance
Pass your output back with the step name:
<skill>/scripts/run advance --step <step-name> --output '<your-json>' --session abc123 2>/dev/nullThis returns a single line number (e.g., 4). Read exactly and only that line from the session file — it contains the next prompt. Do not read any other lines.
Step 4: Repeat until done
Keep advancing until the line you read contains "type":"done". The finalOutput field contains the skill's result. Present it to the user.
Step 5: Cleanup
After presenting the result, remove the session file:
<skill>/scripts/run cleanup --session <session-id> 2>/dev/nullImportant
- Never show raw JSON output or Bash commands to the user. The user sees your natural
language responses, not the protocol.
- If you get a validation error (the response has
"error": "validation"or"type":"error"),
read the message field, fix your output, and retry the same step.
Steps in this skill
- choose-variant: (dynamic)
- name-game: (dynamic)
- choose-renderer: (dynamic)
- design-review: (dynamic)
- research-renderer: (dynamic)
- implementation-plan: (dynamic)
- revise-plan: (dynamic)
- build: (dynamic)
- generate-readme: (dynamic)
- final-review: (dynamic)
- polish: (dynamic)
- summary: (dynamic)
{
"name": "game-jam",
"version": "1.0.0"
}
Tetris Game Design Patterns
Core Mechanics
Board: A 10-wide, 20-tall grid. Cells are either empty or filled with a color.
Pieces (Tetrominoes): Seven standard shapes: I, O, T, S, Z, J, L. Each is a 4-cell polyomino.
Gravity: Pieces fall at a rate that increases with level. Soft drop (accelerate) and hard drop (instant place) are standard.
Line Clearing: When a row is completely filled, it is removed and all rows above shift down. Clearing multiple lines at once awards bonus points.
Rotation: Use the Super Rotation System (SRS) for wall kicks and floor kicks. This allows pieces to rotate even when adjacent to walls or other pieces.
Scoring
| Action | Points |
|---|---|
| Single line | 100 × level |
| Double | 300 × level |
| Triple | 500 × level |
| Tetris (4 lines) | 800 × level |
| T-Spin Single | 800 × level |
| T-Spin Double | 1200 × level |
| Soft drop | 1 per cell |
| Hard drop | 2 per cell |
Rendering Approaches
Canvas: Best for performance. Draw the grid as colored rectangles. Straightforward to implement ghost pieces and animations.
DOM: Use a CSS Grid or table of div elements. Easier to style with CSS but slower for animations. Good for simple implementations.
WebGL: Overkill for standard Tetris, but enables 3D effects, particle systems, and shader-based visuals.
Architecture Tips
- Separate game state from rendering. The board should be a pure data structure.
- Use a game loop with requestAnimationFrame for smooth rendering.
- Handle input through a key-state map, not individual keydown events.
- Implement a "bag" randomizer: shuffle all 7 pieces, deal them in order, repeat. This prevents long droughts of any piece.
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SKILL_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
if ! command -v node &>/dev/null; then
echo "error: Node.js is required but not found. Install Node.js >= 24." >&2
exit 1
fi
NODE_VERSION="$(node -e 'process.stdout.write(process.versions.node.split(".")[0])')"
if [ "$NODE_VERSION" -lt 24 ] 2>/dev/null; then
echo "error: Node.js >= 24 required, found v$(node --version | tr -d v)" >&2
exit 1
fi
export SKILL_DIR
exec node "$SKILL_DIR/bin/game-jam.mjs" "$@"