Skip to content

The lattice-gamedev Claude Code skill

lattice-gamedev is a Claude Code skill that helps a developer use AI tooling to build a multiplayer game on Lattice — the C++ core + stable C ABI (lattice.h) + per-game game-sim module + engine bindings.

It teaches the assistant the Lattice mental model (core / C ABI / module / bindings; server/host/client roles; self-host native vs managed WASM and the write-once promise) and a step-by-step workflow, and gives it accurate, cross-checked API detail so the code it writes actually compiles against lattice.h.

What it gives the assistant

A skill is plain Markdown plus YAML frontmatter — zero runtime. SKILL.md stays lean and the detail is loaded on demand from reference/:

File Contents
SKILL.md Entry point: frontmatter (name + trigger-rich description) + the Lattice mental model + the build workflow.
reference/api-cheatsheet.md The public C ABI by area, with real signatures and one-line examples. Mirrors lattice.h.
reference/getting-started.md Scaffold a module, build native + WASM, self-host vs managed, register a game, wire a binding.
reference/recipes.md Spawn + replicate, RPC, chat via custom events, shared authority, anti-cheat, store persistence, web fetch, auth + social.
reference/troubleshooting.md RANGED_INT, ordered-channel reorder, ABI bounds, MinGW, schema hash, and other footguns.

It maps directly onto the rest of this site: the API surface in the cheatsheet is the same one in the API Reference, and the hosting/workflow content tracks Getting Started and the design docs.

Install it into a project

A skill is installed by placing the lattice-gamedev folder under a project's (or your user's) .claude/skills/ directory — the folder name must match the skill name (lattice-gamedev):

# Project-scoped (recommended for a game repo built on Lattice):
mkdir -p <your-project>/.claude/skills
cp -r tools/lattice-claude-skill/lattice-gamedev \
      <your-project>/.claude/skills/

# Or user-scoped (available in every project):
mkdir -p ~/.claude/skills
cp -r tools/lattice-claude-skill/lattice-gamedev \
      ~/.claude/skills/

Claude Code discovers it from the YAML frontmatter in SKILL.md (name: lattice-gamedev plus a trigger-rich description). There is no build step. Verify it appears with /skills, or just let it trigger on a matching prompt.

Run from a checkout with the reference material

For best results, run Claude Code from a checkout that also contains the Lattice reference/, docs/, examples/, and bindings/ so the assistant can read lattice.h and the examples directly — the skill points at those paths.

When it triggers

The skill activates whenever the task is to build, extend, debug, or ship multiplayer on Lattice. Sample prompts:

  • "Add multiplayer to my game with Lattice — I want a server-authoritative player object with position and score replicated."
  • "Scaffold a Lattice game-sim module and show me the dedicated-server and P2P host entry points."
  • "Write a Lattice RPC for firing a weapon, and a global chat using custom events."
  • "Turn on Lattice anti-cheat for speed-hacks and RPC floods."
  • "How do I host my game server on Lattice managed hosting vs self-host? Compile my game-sim to WASM."
  • "Set up the Lattice store to persist player profiles without blocking the tick."

Keeping it accurate

The cheatsheet mirrors lattice.h, but the header is the source of truth. After a core ABI change, re-diff api-cheatsheet.md against lattice.h and re-run the reference build to confirm it still passes. The skill itself instructs the assistant to verify every signature against the header before emitting a call.

MCP server alternative

The same knowledge could be delivered as an MCP server exposing Lattice as tools (e.g. lattice_lookup_api, lattice_scaffold_module) or resources backed live by lattice.h. For Claude Code the skill form is simpler and self-contained; the MCP form is worth it if you want the same knowledge usable from other MCP-aware tools or auto-synced to the header.

Reference

  • Skill source: tools/lattice-claude-skill/lattice-gamedev/
  • Migrating an existing Fusion project? See the Migrating from Fusion hub.