Stop Game

VerifiedCaution

Emergency halt an active game session, mark it as stopped, and clean up state files. Use this command to stop a running game, cancel a playtest, or purge game state.

Sby Skills Guide Bot
DevelopmentIntermediate
406/2/2026
Claude Code
#game#emergency-halt#session-management#cleanup#state-management

Recommended for

Our review

Halts an active game session, updates game state, and cleans up temporary files.

Strengths

  • Provides a clean shutdown of a running game.
  • Saves a partial game log for later analysis.
  • Cleans up state files and locks to prevent corruption.

Limitations

  • Assumes a specific directory structure for game files.
  • May not handle concurrent games well if multiple are active.
  • Relies on the presence of a game-state.json file with a gameActive flag.
When to use it

Use when you need to manually stop a game that is running or glitching.

When not to use it

Do not use if you want to pause and resume a game later, as it marks the game as permanently stopped.

Security analysis

Caution
Quality score90/100

The skill uses bash commands to clean up game state files, including rm -rf on a subdirectory. All paths are constructed from a game name, preventing escape outside the games/ directory. No network access, no exfiltration, and no code injection risk. However, the destructive nature of rm warrants caution.

Findings
  • Uses Bash to delete files and recursively remove directories under a game-specific path. While scoped, this is a powerful operation.

Examples

Stop a running game by name
Please stop the game called 'my-rpg' immediately.
Stop the currently active game
I need to halt the current game session. Clean it up properly.

name: stop-game description: 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. argument-hint: [game-name] allowed-tools: Read, Write, Bash, Glob disable-model-invocation: true

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
Related skills