infrastructure-claude-code-game-workflow
Use when starting a game project, choosing which skill to read, or navigating the game-dev skill ecosystem. Entry point for AI agents working on game development. Triggers: workflow, which skill, how to start, game project setup.
Best use case
infrastructure-claude-code-game-workflow is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use when starting a game project, choosing which skill to read, or navigating the game-dev skill ecosystem. Entry point for AI agents working on game development. Triggers: workflow, which skill, how to start, game project setup.
Teams using infrastructure-claude-code-game-workflow should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/claude-code-game-workflow/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How infrastructure-claude-code-game-workflow Compares
| Feature / Agent | infrastructure-claude-code-game-workflow | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when starting a game project, choosing which skill to read, or navigating the game-dev skill ecosystem. Entry point for AI agents working on game development. Triggers: workflow, which skill, how to start, game project setup.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
SKILL.md Source
# Claude Code Game Workflow
## Purpose
How AI coding agents navigate this game development skill ecosystem — file conventions, which skills to read first, dependency order, and workflow patterns.
## When to Use
Trigger: game dev workflow, skill navigation, which skill to use, game dev setup, project structure, skill dependencies, agent workflow, how to start, game dev ecosystem
## Prerequisites
None — this is the entry point for the entire ecosystem.
## Core Principles
1. **Read skills before coding** — always check if a relevant skill exists before implementing from scratch
2. **Follow dependency order** — skills have prerequisites; reading them out of order misses critical context
3. **Coherence check is non-negotiable** — any narrative content requires `quest-narrative-coherence` first
4. **Genre-agnostic always** — never assume a specific game genre in shared code
5. **Schema first, logic second** — start with `postgres-game-schema` before writing game logic
## Feature Guides
Dedicated files for each Claude Code feature. Read the relevant one when setting up a new project or adding a capability.
| File | Feature | When to Use |
|------|---------|-------------|
| [custom-agents.md](custom-agents.md) | Custom Claude Code agents | Setting up game-engineer, narrative-writer, game-designer agents |
| [worktrees.md](worktrees.md) | Git worktrees | Isolating a new game system or experimental change |
| [mcp-setup.md](mcp-setup.md) | MCP servers (GitHub, Playwright, Context7) | Connecting external tools to Claude Code |
| [plan-mode.md](plan-mode.md) | Plan mode | Before implementing any new game system |
| [todo-patterns.md](todo-patterns.md) | TodoWrite task tracking | Multi-step feature implementation |
| [vision-multimodal.md](vision-multimodal.md) | Screenshots + vision | Debugging UI, reviewing level design, game state |
| [settings-full.md](settings-full.md) | Full `.claude/settings.json` | Permissions, hooks, and env vars for a game project |
| [templates/game-agents/](templates/game-agents/) | Agent definition files | Copy to `.claude/agents/` in your project |
| [templates/.mcp.json](templates/.mcp.json) | MCP config | Copy to project root as `.mcp.json` |
| [templates/claude-hooks-config.json](templates/claude-hooks-config.json) | Hooks config | Copy hooks section into `.claude/settings.json` |
| [templates/game-project-claude.md](templates/game-project-claude.md) | Project CLAUDE.md | Copy to game project root |
## Skill Dependency Graph
```
[claude-code-game-workflow] (YOU ARE HERE)
|
┌───────────────┼───────────────┐
▼ ▼ ▼
[postgres-game-schema] [game-design-fundamentals] [quest-narrative-coherence]
| | | |
▼ ▼ ▼ ▼
[redis] [bullmq] [level-design] [worldbuilding]
| | [game-economy] [story-structure]
▼ ▼ [ui-ux-game] [character-design]
[game-backend-architecture] | [quest-mission-design]
| |
▼ ▼
[game-state-sync] [stripe-game-payments]
[betterauth] [elevenlabs-sound-music]
```
## Workflow: Starting a New Game
1. Read `claude-code-game-workflow` (this skill)
2. Read `game-design-fundamentals` — define core loop, player motivation
3. Read `postgres-game-schema` — set up database
4. Read `game-backend-architecture` — set up Elysia server
5. Choose domain skills as needed (economy, quests, multiplayer, etc.)
## Workflow: Adding a Feature
1. Identify which skill covers the feature
2. Read that skill's SKILL.md
3. Check prerequisites — read those first if not already done
4. Copy boilerplate/ files as starting point
5. Customize using templates/ for configuration
## Workflow: Creating Narrative Content
1. **ALWAYS** read `quest-narrative-coherence` first
2. Read `worldbuilding` — load current world state
3. Read relevant narrative skill (story-structure, character-design, quest-mission)
4. Follow the 5-step coherence check
5. Register new content in quest-registry.md
## Skill Quick Reference
| Need | Skill | Domain |
|------|-------|--------|
| Database schemas | `postgres-game-schema` | Engineering |
| Job queues | `bullmq-game-queues` | Engineering |
| Game server + WebSocket | `game-backend-architecture` | Engineering |
| Caching + leaderboards | `redis-game-patterns` | Engineering |
| Authentication | `betterauth-integration` | Engineering |
| Payments / IAP | `stripe-game-payments` | Engineering |
| Sound / Music | `elevenlabs-sound-music` | Engineering |
| Netcode / State sync | `game-state-sync` | Engineering |
| Core game design | `game-design-fundamentals` | Design |
| Level / Area design | `level-design` | Design |
| Quests / Missions | `quest-mission-design` | Design |
| Economy / Currency | `game-economy-design` | Design |
| UI / UX | `ui-ux-game` | Design |
| World lore | `worldbuilding` | Narrative |
| Story / Plot | `story-structure-game` | Narrative |
| Characters / NPCs | `character-design-narrative` | Narrative |
| Narrative consistency | `quest-narrative-coherence` | Narrative |
| CI/CD | `ci-cd-game` | Infrastructure |
| Monitoring | `monitoring-game-ops` | Infrastructure |
| Cursor/Codex setup | `cursor-codex-integration` | Infrastructure |
## File Conventions
- `SKILL.md` — knowledge document, read first
- `boilerplate/` — copy as starting code
- `templates/` — configuration and document templates
- `ARCHITECTURE.md` — diagrams for infrastructure skills
## Claude Code Setup
Quick setup for a new game project (4 steps):
1. **Copy CLAUDE.md template**: `templates/game-project-claude.md` → project root as `CLAUDE.md`. Fill in Core Loop, Genre, Platforms, Multiplayer.
2. **Copy hooks**: merge hooks from `templates/claude-hooks-config.json` into `.claude/settings.json`. See `settings-full.md` for the complete settings structure with permissions.
3. **Copy MCP config**: `templates/.mcp.json` → project root. Set `GITHUB_TOKEN` in shell env.
4. **Copy custom agents**: `templates/game-agents/` → `.claude/agents/` in your project.
For detailed configuration of each Claude Code feature, see the **Feature Guides** table above.
### Skill @ Mentions
In any prompt, reference skill files directly to inject their context:
```
@skills/game-dev/engineering/postgres-game-schema/SKILL.md — add inventory table
@skills/game-dev/narrative/quest-narrative-coherence/SKILL.md — create merchant quest
@skills/game-dev/engineering/matchmaking-system/SKILL.md — implement ELO queue
```
## Hooks for Game Dev
Copy the full hooks config from `templates/claude-hooks-config.json`. Four patterns:
### Hook 1 — Skill Routing (UserPromptSubmit)
Detects keywords in the user's prompt and prints the relevant skill path before Claude responds. Runs on every prompt — zero false-negative cost.
- **Event**: `UserPromptSubmit`
- **What it does**: Scans prompt for domain keywords → prints the matching skill path as a hint
- **Keywords mapped**:
- `quest / character / NPC / story / lore / narrative` → `quest-narrative-coherence/SKILL.md`
- `schema / database / inventory / drizzle / migration` → `postgres-game-schema/SKILL.md`
- `matchmaking / lobby / ELO / rank / queue` → `matchmaking-system/SKILL.md`
- `analytics / retention / funnel / D1 / D7 / cohort` → `gameplay-analytics/SKILL.md`
- `redis / leaderboard / pubsub / cache / presence` → `redis-game-patterns/SKILL.md`
- `state / sync / netcode / delta / rollback / prediction` → `game-state-sync/SKILL.md`
- **When to use**: Always. Put in project `.claude/settings.json`.
```json
{
"hooks": {
"UserPromptSubmit": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "PROMPT=$(echo \"$CLAUDE_HOOK_INPUT\" | jq -r '.prompt // \"\"'); for kw in quest character NPC story lore narrative; do echo \"$PROMPT\" | grep -qi \"$kw\" && echo \"📚 Narrative skill: Read narrative/quest-narrative-coherence/SKILL.md first\" && break; done; for kw in schema database inventory drizzle migration; do echo \"$PROMPT\" | grep -qi \"$kw\" && echo \"📚 Engineering skill: Read engineering/postgres-game-schema/SKILL.md\" && break; done; for kw in matchmaking lobby elo rank queue; do echo \"$PROMPT\" | grep -qi \"$kw\" && echo \"📚 Engineering skill: Read engineering/matchmaking-system/SKILL.md\" && break; done; for kw in analytics retention funnel D1 D7 D30 cohort; do echo \"$PROMPT\" | grep -qi \"$kw\" && echo \"📚 Engineering skill: Read engineering/gameplay-analytics/SKILL.md\" && break; done; for kw in redis leaderboard pubsub cache presence; do echo \"$PROMPT\" | grep -qi \"$kw\" && echo \"📚 Engineering skill: Read engineering/redis-game-patterns/SKILL.md\" && break; done; exit 0"
}
]
}
]
}
}
```
### Hook 2 — Narrative Coherence Guard (PreToolUse: Write/Edit)
Blocks careless writes to narrative files by injecting a reminder before Claude touches them.
- **Event**: `PreToolUse`
- **Matcher**: `Write|Edit`
- **What it does**: Checks if the target file path matches `quest|character|story|narrative|lore|npc` — if yes, prints a reminder
- **Behavior**: Exit code 0 (reminder only, not a hard block — Claude can still proceed)
- **When to use**: Any project with narrative content
```json
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "FILE=$(echo \"$CLAUDE_HOOK_INPUT\" | jq -r '.tool_input.file_path // .tool_input.path // \"\"'); echo \"$FILE\" | grep -qiE '(quest|character|story|narrative|lore|npc)' && echo \"[game-dev] ⚠️ Narrative file: ensure quest-narrative-coherence check is complete.\"; exit 0"
}
]
}
```
### Hook 3 — Biome Guard (PostToolUse: Write/Edit)
Auto-formats TypeScript after every file write. Game projects accumulate debt fast when formatting is skipped.
- **Event**: `PostToolUse`
- **Matcher**: `Write|Edit`
- **What it does**: If `biome.json` or `biome.jsonc` exists in the project root, runs `bunx biome check --write` on the written file
- **When to use**: Any TypeScript game project
```json
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "cd \"$CLAUDE_PROJECT_DIR\" && [ -f biome.json ] || [ -f biome.jsonc ] && bunx biome check --write . 2>/dev/null || true"
}
]
}
```
### Hook 4 — Quest Registry Reminder (Stop)
After every session, reminds the developer to update the narrative registry files.
- **Event**: `Stop`
- **What it does**: Prints a reminder to update `quest-registry.md` and `world-lore.md`
- **When to use**: Any project with narrative content
- **Note**: Fires unconditionally — cheap and hard to miss
```json
{
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "echo \"[game-dev] Session ended. If you created narrative content, update quest-registry.md and world-lore.md.\""
}
]
}
]
}
}
```
## Subagent Patterns
Use parallel Claude Code agents when a feature spans multiple domains. Each agent reads its own skills, works in isolation, and produces a concrete output you merge at the end.
### Pattern 1 — Design + Engineering in Parallel
When adding a major feature, split into two agents running simultaneously:
- **Agent A** (Design): reads design skills → produces GDD section, economy balance, quest design
- **Agent B** (Engineering): reads engineering skills → implements schema + backend routes
They work on separate concerns with no shared state. Use `"worktree"` isolation to give each agent its own git branch. Merge when both complete.
**Prompt:**
```
Use the Agent tool to run 2 parallel agents:
- Agent 1: Read skills/game-dev/design/game-economy-design/SKILL.md and design the currency economy for our idle game. Output: economy-design.md
- Agent 2: Read skills/game-dev/engineering/postgres-game-schema/SKILL.md and create the initial player schema. Output: modify db/schema.ts
```
### Pattern 2 — Narrative Team
For a narrative-heavy session with multiple interconnected characters and quests:
- **Agent A**: reads `quest-narrative-coherence` + creates new quest (loads `world-lore.md`, checks consistency)
- **Agent B**: reads `character-design-narrative` + creates NPCs for that quest
Run in parallel. Then have the coherence agent review both outputs before merging to catch conflicts.
**Prompt:**
```
Use the Agent tool to run 2 parallel agents:
- Agent 1: Read narrative/quest-narrative-coherence/SKILL.md and narrative/worldbuilding/SKILL.md. Create a new merchant guild quest. Check world-lore.md for faction alignment. Output: quests/merchant-guild-q1.md
- Agent 2: Read narrative/character-design-narrative/SKILL.md. Create 2 NPCs for a merchant guild quest — a quest giver and antagonist. Output: characters/merchant-npcs.md
```
### Pattern 3 — Full-Stack Feature
Breaking down "add matchmaking" into parallel workstreams:
1. **Design agent**: reads `matchmaking-system` + `game-economy-design` → produces matchmaking config doc
2. **Backend agent**: reads `matchmaking-system` + `bullmq-game-queues` → implements server-side queue logic
3. **DB agent**: reads `postgres-game-schema` + `redis-game-patterns` → creates tables + Redis key design
All three run in parallel. One integration agent (sequential, after all three complete) assembles the final feature.
**When not to parallelize**: When Agent B's output depends on Agent A's output. Keep those sequential.
## Memory Patterns
What to persist across Claude Code sessions so agents never lose context.
### What to Save in MEMORY.md
Write to `~/.claude/projects/<project>/memory/MEMORY.md` after making significant decisions:
- **Architectural decisions**: "Chose Glicko-2 over ELO for matchmaking — handles new players better"
- **Schema choices**: "Player attributes use JSONB for flexibility — indexed on `attributes->>'class'`"
- **Economy parameters**: "Gem earn rate: 10/day soft cap. First-time bonus: 200 gems."
- **World state summary**: "3 factions: Merchant Guild (neutral), Iron Brotherhood (hostile), Arcane Circle (allied). Merchants control trade routes."
- **Active quest registry**: link to `quest-registry.md`
### Memory File Structure
```
~/.claude/projects/<your-project>/memory/
MEMORY.md # key decisions — loaded every session automatically
world-state.md # factions, geography, lore summary
economy-state.md # current balance parameters
schema-decisions.md # why each schema looks the way it does
```
Keep companion files (`world-state.md`, etc.) in the project repo under `docs/memory/` and symlink or reference them from `MEMORY.md` so they travel with the codebase.
### Rules for Memory
- Write immediately after making a significant architectural or design decision
- Never write temporary or session-specific context (e.g., "currently debugging X")
- Review and update when a decision changes — stale memory is worse than no memory
- Keep `MEMORY.md` under 150 lines (Claude truncates at ~200)
- Use bullet points, not prose — agents scan memory, not read it
## Sources
- This ecosystem's own architecture
- Claude Code documentation: hooks, memory, subagents
- "Overwatch Gameplay Architecture and Netcode" — inspiration for subagent parallelism in game systemsRelated Skills
game-lore
Adds or updates a single world lore entry (faction, location, NPC, or event) — validates against existing lore for consistency, applies the right template, and updates docs/world-lore.md. Extract the entry type (faction/location/npc/event) and name from the user's message.
game-expand
Adds a new feature to an existing MVP plan — scoped architect interview, scope validation against original plan, and integration into the build sequence. Extract the feature name or description from the user's message. Requires docs/mvp-first-draft.md — run game-architect first.
game-build
Builds a game component from the MVP plan — production TypeScript + Vitest tests + mock dependencies + build registry tracking. Extract the component name from the user's message (or "status" to check progress). Requires docs/mvp-first-draft.md — run game-architect first.
game-balance
Analyzes a game system against design principles — economy health metrics, difficulty curve, reward schedules, and progression cost curves. Flags imbalances with severity levels. Use after creating an MVP plan with game-architect. Extract the analysis scope (economy/difficulty/progression/rewards/all) from the user's message.
game-architect
Comprehensive game MVP interviewer and planner. Interviews you in progressive groups, researches genre conventions and reference games, then produces an actionable MVP First Draft with starter project files. Use when starting a new game project from scratch.
claude-agent-sdk
Build production AI agents with the Claude Agent SDK (TypeScript: @anthropic-ai/claude-agent-sdk, Python: claude-agent-sdk). Use this skill whenever: building programmatic agents with Claude, using query() or ClaudeSDKClient, configuring hooks/subagents/MCP servers/custom tools, setting up permissions or sessions, deploying agents to Docker/CI/CD/cloud, importing @anthropic-ai/claude-agent-sdk or claude-agent-sdk, mentioning 'agent sdk' or 'claude sdk' in a coding context, building autonomous agents that read files/run commands/edit code, or any task involving programmatic Claude Code integration. Even if the user just says 'build an agent' or 'automate with Claude' — use this skill.
narrative-story-structure-game
Use when designing interactive narratives, branching storylines, player agency systems, non-linear story structures, or act frameworks for games. Triggers: branching narrative, player agency, story arc, interactive story, dialogue.
infrastructure-monitoring-game-ops
Use when implementing game monitoring, structured logging, player telemetry, alerting rules, or performance budgets. Triggers: monitoring, logging, telemetry, alerts, observability, metrics.
infrastructure-cursor-codex-integration
Use when configuring Cursor IDE or OpenAI Codex for game development — .cursorrules files, prompt conventions, context injection. Triggers: cursor, .cursorrules, codex, IDE setup.
infrastructure-ci-cd-game
Use when setting up CI/CD pipelines, GitHub Actions workflows, deployment automation, migration safety, or staging environments for game projects. Triggers: CI/CD, GitHub Actions, deployment, pipeline, staging.
engineering-stripe-game-payments
Use when implementing game payments, in-app purchases, subscriptions, Stripe webhooks, or monetization flows. Triggers: payments, IAP, subscription, Stripe, checkout, webhooks, monetization.
engineering-redis-game-patterns
Use when implementing Redis patterns for games — caching, leaderboards, pub/sub messaging, session storage, rate limiting, or ephemeral game state. Triggers: Redis, cache, leaderboard, pub/sub, rate limit, session.