Agent skill
start-game
Initialize and run a game with coordinated multi-agent architecture. Use when user wants to start a playtest, run a game, test game rules, or launch multi-agent game simulation.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/start-game
SKILL.md
Start Game - Coordinated Multi-Agent Architecture
This skill spawns ALL agents (gamemaster + players) upfront and they coordinate via file-based protocol.
Architecture Overview
Coordinator (this skill)
├─> Spawns Gamemaster (background, long-running)
├─> Spawns Player-1 (background, long-running)
├─> Spawns Player-2 (background, long-running)
└─> Spawns Player-3 (background, long-running)
All agents run in parallel, coordinate via files + hooks:
- Gamemaster writes turn-signal.json → Stop hook guides to wait
- Players use inotifywait (blocking) for turn-signal.json
- Players write player-actions/*.json → Stop hook guides to wait
- Gamemaster uses inotifywait (blocking) for player actions
- Zero polling overhead - all coordination via event-driven hooks
Arguments
$0or$ARGUMENTS[0]: Game name (e.g., "markovs-chains")$1or$ARGUMENTS[1]: Number of players (optional, defaults to game config)
Implementation Steps
Step 1: Load Game Configuration
Read the game rules and extract configuration:
const gameName = "$0"; // e.g., "markovs-chains"
const numPlayersOverride = "$1" ? parseInt("$1") : null;
// Read game rules
const rulesPath = "games/" + gameName + "/RULES.md";
const rulesContent = await Read(rulesPath);
// Parse YAML frontmatter for config
// Extract: name, version, players, starting_cards, max_turns, win_condition
Step 2: Clean Up Previous Game State
CRITICAL: Remove any existing game state files:
rm -f games/${gameName}/state/game-state.json
rm -f games/${gameName}/state/turn-signal.json
rm -f games/${gameName}/state/player-actions/*.json
Step 3: Create Game Directories
mkdir -p games/${gameName}/state/player-actions
mkdir -p games/${gameName}/logs
mkdir -p games/${gameName}/traces
Step 4: Load and Fill Agent Templates
Load templates from engine/templates/:
gamemaster-hook-orchestrated.mdfor gamemaster (uses stop hooks)player-hook-orchestrated.mdfor players (uses stop hooks)
Fill template variables: {{GAME_NAME}}, {{NUM_PLAYERS}}, {{RULES_CONTENT}}, etc.
IMPORTANT: These templates work with stop hooks in .claude/hooks/ to orchestrate coordination without polling.
Step 5: Spawn ALL Agents in Parallel
CRITICAL: Spawn all agents in a SINGLE message with multiple Task calls.
// 1. Spawn gamemaster (Sonnet for reasoning)
await Task({
subagent_type: "general-purpose",
model: "sonnet",
description: "Gamemaster for " + gameName,
prompt: gamemasterPrompt,
run_in_background: true
});
// 2-4. Spawn players (Haiku for speed)
for (let i = 1; i <= numPlayers; i++) {
await Task({
subagent_type: "general-purpose",
model: "haiku",
description: "player-" + i + " for " + gameName,
prompt: playerPrompts[i-1],
run_in_background: true
});
}
Step 6: Monitor Game Completion
Poll games/${gameName}/state/game-state.json every 5 seconds until gameStatus === "completed".
Step 7: Report Final Results
Display winner, total turns, and point to log files.
Reference Files
For detailed templates and schemas, see:
engine/templates/gamemaster-hook-orchestrated.md- Hook-based gamemasterengine/templates/player-hook-orchestrated.md- Hook-based playerengine/HOOKS-INTEGRATION-GUIDE.md- Complete hook orchestration guideengine/ARCHITECTURE-V2.md- Blocking waits architecture.claude/hooks/agent-stop-hook.sh- Player stop hook.claude/hooks/gamemaster-stop-hook.sh- Gamemaster stop hook
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?