Files
Donchitos ad540fe75d Game Studio Agent Architecture — complete setup (Phases 1-7)
48 coordinated Claude Code subagents for indie game development:
- 3 leadership agents (creative-director, technical-director, producer)
- 10 department leads (game-designer, lead-programmer, art-director, etc.)
- 23 specialist agents (gameplay, engine, AI, networking, UI, tools, etc.)
- 12 engine-specific agents (Godot, Unity, Unreal with sub-specialists)

Infrastructure:
- 34 skills (slash commands) for workflows, reviews, and team orchestration
- 8 hooks for commit validation, asset checks, session management
- 11 path-scoped rules enforcing domain-specific standards
- 28 templates for design docs, reports, and collaborative protocols

Key features:
- User-driven collaboration protocol (Question → Options → Decision → Draft → Approval)
- Engine version awareness with knowledge-gap detection (Godot 4.6 pinned)
- Phase gate system for development milestone validation
- CLAUDE.md kept under 80 lines with extracted doc imports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 21:04:24 +11:00

2.7 KiB

Hook Input/Output Schemas

This documents the JSON payloads each Claude Code hook receives on stdin for every event type.

PreToolUse

Fired before a tool is executed. Can allow (exit 0) or block (exit 2).

PreToolUse: Bash

{
  "tool_name": "Bash",
  "tool_input": {
    "command": "git commit -m 'feat: add player health system'",
    "description": "Commit changes with message",
    "timeout": 120000
  }
}

PreToolUse: Write

{
  "tool_name": "Write",
  "tool_input": {
    "file_path": "src/gameplay/health.gd",
    "content": "extends Node\n..."
  }
}

PreToolUse: Edit

{
  "tool_name": "Edit",
  "tool_input": {
    "file_path": "src/gameplay/health.gd",
    "old_string": "var health = 100",
    "new_string": "var health: int = 100"
  }
}

PreToolUse: Read

{
  "tool_name": "Read",
  "tool_input": {
    "file_path": "src/gameplay/health.gd"
  }
}

PostToolUse

Fired after a tool completes. Cannot block (exit code ignored for blocking). Stderr messages are shown as warnings.

PostToolUse: Write

{
  "tool_name": "Write",
  "tool_input": {
    "file_path": "assets/data/enemy_stats.json",
    "content": "{\"goblin\": {\"health\": 50}}"
  },
  "tool_output": "File written successfully"
}

PostToolUse: Edit

{
  "tool_name": "Edit",
  "tool_input": {
    "file_path": "assets/data/enemy_stats.json",
    "old_string": "\"health\": 50",
    "new_string": "\"health\": 75"
  },
  "tool_output": "File edited successfully"
}

SubagentStart

Fired when a subagent is spawned via the Task tool.

{
  "agent_name": "game-designer",
  "model": "sonnet",
  "description": "Design the combat healing mechanic"
}

SessionStart

Fired when a Claude Code session begins. No stdin input — the hook just runs and its stdout is shown to Claude as context.

PreCompact

Fired before context window compression. No stdin input — the hook runs to save state before compression occurs.

Stop

Fired when the Claude Code session ends. No stdin input — the hook runs for cleanup and logging.

Exit Code Reference

Exit Code Meaning Applicable Events
0 Allow / Success All events
2 Block (stderr shown to Claude) PreToolUse only
Other Treated as error, tool proceeds All events

Notes

  • Hooks receive JSON on stdin (pipe). Use INPUT=$(cat) to capture.
  • Parse with jq if available, fall back to grep for cross-platform compatibility.
  • On Windows, grep -P (Perl regex) is often unavailable. Use grep -E (POSIX extended) instead.
  • Path separators may be \ on Windows. Normalize with sed 's|\\|/|g' when comparing paths.