Skip to content

Fully automated game creation pipeline using Anthropic's Agent SDK, Claude Code, and MCP integrations.

License

Notifications You must be signed in to change notification settings

PSthelyBlog/game-workflow

Repository files navigation

Game Workflow

CI Python 3.11+ License: MIT Code style: ruff

Fully automated game creation pipeline using Anthropic's Claude API, Claude Code, and MCP integrations.


Overview

Game Workflow automates the entire game creation process from concept to publication:

Prompt --> [Design] --> [Build] --> [QA] --> [Publish] --> itch.io
              |           |          |          |
              v           v          v          v
          Concepts    Game Code   Test      Store Page
            GDD       + Assets   Reports    + Release
  1. Design - Generate game concepts and Game Design Documents from natural language prompts
  2. Build - Implement games using Claude Code as a subagent with Phaser.js or Godot
  3. QA - Automatically test and validate builds with Playwright
  4. Publish - Release to itch.io with human approval gates via Slack

Features

  • Multi-engine support: Phaser.js (default) and Godot
  • Human-in-the-loop: Slack approval gates at key checkpoints
  • Comprehensive testing: Smoke tests, performance benchmarks, visual regression
  • State persistence: Resume workflows from any checkpoint
  • Extensible skills: Add custom knowledge for Claude Code

Quick Start

Installation

# Clone the repository
git clone https://github.com/PSthelyBlog/game-workflow.git
cd game-workflow

# Create virtual environment (Python 3.11+ required)
python3.11 -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install the package
pip install -e .

Authentication

The workflow supports two authentication methods:

Option 1: Claude Subscription (Pro/Max) - Recommended

If you have a Claude subscription, simply run claude in your terminal to login. The Claude Agent SDK will automatically use your subscription authentication.

claude  # Login to Claude Code CLI

Option 2: API Key

Set your Anthropic API key as an environment variable:

export ANTHROPIC_API_KEY=sk-ant-...

The Claude Agent SDK automatically detects and uses whichever authentication is available. For Slack approvals and itch.io publishing, see the Setup Guide.

Create Your First Game

# Generate a puzzle platformer
game-workflow run "Create a puzzle platformer about time manipulation"

The workflow will:

  1. Generate 3 game concepts for you to choose from
  2. Create a detailed Game Design Document
  3. Implement the game with Phaser.js
  4. Run automated tests
  5. Prepare assets for itch.io publishing

Commands

# Start a new workflow
game-workflow run "Your game idea here"

# Use a specific engine
game-workflow run --engine godot "A top-down adventure game"

# Check current workflow status
game-workflow status

# Resume an interrupted workflow
game-workflow resume

# Resume from a specific checkpoint
game-workflow resume --checkpoint <checkpoint-id>

# Cancel the current workflow
game-workflow cancel

# View workflow state
game-workflow state show
game-workflow state list
game-workflow state cleanup --days 30

Architecture

+---------------------------------------------------------+
|                ORCHESTRATOR (Python)                     |
|  State machine | Hook system | Human approval gates      |
+---------------------------------------------------------+
          |              |              |              |
          v              v              v              v
    +-----------+  +-----------+  +---------+  +-----------+
    |  Design   |  |   Build   |  |   QA    |  |  Publish  |
    |   Agent   |  |   Agent   |  |  Agent  |  |   Agent   |
    +-----------+  +-----------+  +---------+  +-----------+
          |              |              |              |
          v              v              v              v
      Claude API    Claude Code    Playwright    itch.io API
                    + Phaser/       + Tests       + butler
                    Godot Skills

Agents

Agent Purpose Tools
DesignAgent Generate concepts, GDDs, tech specs Claude API
BuildAgent Implement games from specs Claude Code
QAAgent Test and validate builds Playwright
PublishAgent Prepare release assets Claude API, butler

Skills

Skills are knowledge files that guide Claude Code during implementation:

Skill Engine Coverage
phaser-game Phaser.js 2,700 lines of patterns and examples
godot-game Godot 4.x 2,100 lines of GDScript guidance
game-testing Playwright 3,700 lines of test patterns

See Skills Documentation for details.


Requirements

Required

Requirement Version Purpose
Python 3.11+ Core runtime
Claude Code Latest Game implementation (build phase)

Authentication: Either a Claude subscription (Pro/Max) OR an Anthropic API key is required.

Optional (for game development)

Requirement Version Purpose
Node.js 18+ Phaser.js builds
Godot 4.x Godot game development

Optional (for publishing)

Requirement Version Purpose
Slack - Approval gates
itch.io account - Game publishing
butler CLI Latest itch.io uploads

Configuration

Environment Variables

# Authentication (one of the following)
# Option 1: Use Claude subscription (just run 'claude' to login)
# Option 2: Set API key
export ANTHROPIC_API_KEY=sk-ant-...

# Optional - Slack approvals
export SLACK_BOT_TOKEN=xoxb-...
export SLACK_CHANNEL=#game-dev

# Optional - GitHub integration
export GITHUB_TOKEN=ghp_...

# Optional - itch.io publishing
export ITCHIO_API_KEY=...

Config File

Create ~/.game-workflow/config.toml:

[workflow]
default_engine = "phaser"  # or "godot"
auto_publish = false
require_all_approvals = true

[slack]
channel = "#game-dev"
notify_on_error = true

[itchio]
username = "your-username"
default_visibility = "draft"

See Configuration Reference for all options.


Development

Setup

# Install dev dependencies
pip install -e ".[dev]"

# Install pre-commit hooks
pre-commit install

Testing

# Run all tests
pytest

# Run specific test categories
pytest tests/unit -v
pytest tests/integration -v
pytest tests/e2e -v

# With coverage
pytest --cov=game_workflow --cov-report=html

Linting

# Check code style
ruff check .
ruff format --check .

# Auto-fix issues
ruff check --fix .
ruff format .

# Type checking
mypy src/game_workflow

Project Structure

game-workflow/
├── src/game_workflow/
│   ├── agents/          # Design, Build, QA, Publish agents
│   ├── orchestrator/    # Workflow state machine
│   ├── hooks/           # Logging, checkpoints, Slack
│   ├── mcp_servers/     # itch.io MCP server
│   └── utils/           # Templates, subprocess, validation
├── skills/              # Claude Code knowledge files
├── templates/           # GDD, scaffolds, store pages
├── tests/               # Unit, integration, e2e tests
├── docs/                # Documentation
└── scripts/             # Setup helpers

Documentation


Supported Game Engines

Phaser.js (default)

Web-native HTML5 games with:

  • Arcade and Matter.js physics
  • Sprite animations and tilemaps
  • Touch and gamepad input
  • Audio with autoplay handling
  • Vite-based builds

Godot 4.x

Cross-platform games with:

  • GDScript patterns
  • Scene system and signals
  • 2D physics and tilemaps
  • HTML5 web export

Troubleshooting

Common Issues

Workflow stuck on approval

Check that your Slack bot is invited to the channel:

/invite @Game Workflow

Build fails with npm errors

Ensure Node.js 18+ is installed:

node --version

Claude Code not found

Install Claude Code or ensure it's in your PATH:

claude --version

itch.io upload fails

Run the butler setup script:

./scripts/setup-butler.sh

Getting Help


Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature
  3. Make your changes with tests
  4. Run linting: ruff check . && mypy src/game_workflow
  5. Run tests: pytest
  6. Submit a pull request

License

MIT License - see LICENSE for details.


Acknowledgments

About

Fully automated game creation pipeline using Anthropic's Agent SDK, Claude Code, and MCP integrations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •