Agent skill
stop-game
Emergency halt of active game session. Use when user wants to stop a running game, halt playtest, cancel game simulation, or clean up game state.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/stop-game
SKILL.md
Stop Game - Emergency Halt
Emergency halt an active game session and clean up state files.
Arguments
$0(optional): Game name to stop. If omitted, finds the active game.
Implementation Steps
1. Find Active Game
let gameName = "$0";
if (!gameName) {
// Find active game by checking for active game-state files
const stateFiles = await Glob("games/*/state/game-state.json");
for (const stateFile of stateFiles) {
const state = JSON.parse(await Read(stateFile));
if (state.gameActive) {
gameName = stateFile.split('/')[1];
break;
}
}
if (!gameName) {
console.log("No active games found");
return;
}
}
2. Read Current State
const statePath = `games/${gameName}/state/game-state.json`;
const gameState = JSON.parse(await Read(statePath));
if (!gameState.gameActive) {
console.log(`Game ${gameName} is not active`);
return;
}
3. Mark Game as Stopped
gameState.gameActive = false;
gameState.gameStatus = "stopped";
gameState.stoppedAt = new Date().toISOString();
gameState.stoppedReason = "Manual stop by user";
await Write(statePath, JSON.stringify(gameState, null, 2));
4. Write Partial Log
Save incomplete game log for analysis:
const logTimestamp = new Date().toISOString().replace(/[:.]/g, '-');
const partialLog = {
fileType: "game-log",
status: "stopped",
game: gameName,
gameId: gameState.gameId,
stoppedAt: gameState.stoppedAt,
completedTurns: gameState.turnNumber,
finalState: gameState
};
await Write(
`games/${gameName}/logs/game-stopped-${logTimestamp}.json`,
JSON.stringify(partialLog, null, 2)
);
5. Clean Up State Files
rm -f games/${gameName}/state/turn-signal.json
rm -f games/${gameName}/state/player-actions/*.json
rm -rf games/${gameName}/state/.locks/*
6. Report to User
Display:
- Game name and ID
- Turn number when stopped
- Final player states
- Location of partial log
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?