canvas-2d-gameplay

canvas-2d-gameplay is a skill for Claude Code, Codex from vucinatim/air-jam. It costs 47 tokens per session (367 once invoked), scanned A, original, MIT.

A guide for building 2D Air Jam games using canvas, the browser's drawing surface, while keeping game logic and interface code separate.

In plain words
What is it for?
Use it to structure game simulation, rendering, movement, collisions, scaling, sprites, SVG assets, menus, and heads-up displays.
Why use it?
It prevents gameplay, drawing, input, sizing, and collision code from becoming tangled in browser page elements.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to structure game simulation, rendering, movement, collisions, scaling, sprites, SVG assets, menus, and heads-up displays.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vucinatim/air-jam/canvas-2d-gameplay
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.

Any agent
npx skills add vucinatim/air-jam --skill canvas-2d-gameplay
Clone the repo
git clone --depth 1 https://github.com/vucinatim/air-jam

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for canvas-2d-gameplay

README.md
[![agentmods](https://agentmods.dev/badge/skills/vucinatim/air-jam/canvas-2d-gameplay/github.svg)](https://agentmods.dev/skills/vucinatim/air-jam/canvas-2d-gameplay)
Your own site
<a href="https://agentmods.dev/skills/vucinatim/air-jam/canvas-2d-gameplay"><img src="https://agentmods.dev/badge/skills/vucinatim/air-jam/canvas-2d-gameplay/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for canvas-2d-gameplay

Your own site · 80×15
<a href="https://agentmods.dev/skills/vucinatim/air-jam/canvas-2d-gameplay"><img src="https://agentmods.dev/badge/skills/vucinatim/air-jam/canvas-2d-gameplay.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 367 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00047 $0.00367
Opus 5 $0.00023 $0.00183
Sonnet 5 $0.00009 $0.00073
Haiku 4.5 $0.00005 $0.00037

Measured 12d ago against content hash c8d84a6bc015, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

canvas-2d-gameplay 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 12d ago.

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.

packages/cli/template-assets/bootstrap/skills/canvas-2d-gameplay/SKILL.md · 48 lines

What it actually says

Canvas 2D Gameplay

Use this skill for 2D gameplay rendered on canvas.

Read First

  1. docs/airjam/canvas-2d-gameplay.md
  2. docs/airjam/generated/state-and-rendering.md
  3. docs/airjam/generated/project-structure.md

Core Rule

Use canvas as the gameplay render surface, and keep React/DOM for shell UI and overlays.

Do not try to run the whole game through DOM layout.

Structure Rules

  1. keep simulation separate from drawing
  2. keep world coordinates separate from screen and CSS coordinates
  3. keep HUD and menus in reusable UI modules above the canvas
  4. keep input interpretation out of the render code

Asset Rules

  1. LLM-generated SVGs are fine for icons, pickups, simple props, and UI art if they are cleaned up and curated
  2. keep a consistent visual language across sprites, SVGs, and UI
  3. prefer a small curated asset set over random mixed-generation output

Movement And Collision Rule

For most 2D games, prefer simple custom movement and collision before reaching for a heavyweight physics layer.

Add a physics engine only when the mechanic truly needs it.

Anti-Patterns

  1. gameplay logic buried inside draw calls
  2. DOM elements used as the main simulation surface
  3. inconsistent scaling between world units and canvas pixels
  4. random SVGs with mismatched stroke, color, and perspective language
  5. overcomplicated physics for simple arcade movement
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. 12d ago First seen · 48 lines · 47 tokens per session scan A c8d84a6bc015

Subscribe to this mod's changes

canvas-2d-gameplay is a skill published in the GitHub repository vucinatim/air-jam (6 stars, last pushed 3d ago), licensed MIT. It adds 47 tokens to every session and 367 once invoked, about $0.0002 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.