/gameplay-debugging-toolkit:verifying-turn-based-gamesfrom Gameplay Verification & Debugging Toolkit
Provides a pure-function engine contract and bot-ladder / win-rate / tension metrics for verifying two-player strict-alternating-turn board or card games. Use when designing games needing replay, search, or quality analysis.
Ships in Gameplay Verification & Debugging Toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A reusable contract + measurement methodology for two-player turn-based games.
Two parts:
This skill prescribes the what (contract and metric definitions). It does not prescribe language / runtime / file layout / build system / tooling commands, ideation or tag workflows, player-facing documentation format, or engine code generation — those are project-local choices.
In scope:
Out of scope (do not apply):
If the target game does not fit the in-scope list, stop and tell the user this skill does not apply rather than forcing the contract.
The engine MUST expose these pure functions. Signatures shown in TypeScript-ish notation; translate to the host language as needed.
init(config?: Config, seed?: number): State
step(state: State, action: Action): { state: State, reward?: number, done: boolean, info: object }
getLegalActions(state: State): Action[]
getObservation(state: State, playerId: PlayerId): State
getResult(state: State): { done: boolean, winners: PlayerId[], reason: string, scores?: Record<PlayerId, number> }
scoreState(state: State, playerId: PlayerId): number
replayLog(state: State): string
cloneState?(state: State): State
Contract notes:
getLegalActions and step use state.currentPlayer implicitly. The contract assumes strict alternating turns; do not extend it to simultaneous play.state.history: Event[] MUST exist and MUST be appended to inside step. replayLog is a pure formatter over state.history; no external collector.state.rngSeed MUST exist; all randomness inside step derives from it deterministically. No Math.random(), clock reads, or other side-effect randomness.getObservation returns the same State type with hidden fields nulled or masked, NOT a different observation type. This keeps bots type-compatible with the engine.getResult replaces a simpler getWinner so callers can distinguish win-by-HP / win-by-deck-out / draw-by-turn-cap. The reason string is required.scoreState is required by the measurement layer (Part 2). An engine that omits scoreState cannot be quality-evaluated by this skill.cloneState is only required when State is not fully immutable. If the host language guarantees immutability (or you use structural sharing), omit it.step does not mutate its input state. Branch search via step(cloneState(s), a) or rely on immutability.seed and a fixed action sequence, init followed by repeated step produces byte-identical states across runs.{ state: s, done: false, info: { illegal: true } } without state change, or auto-pass. Do not mix policies.Action and State must be JSON-serializable (replay, persistence, search caching all depend on this).Before writing the engine, the rules document must specify:
State (turn, currentPlayer, public board, private state, rngSeed, history)reason stringgetLegalActions returns emptygetObservation)If any item above is unspecified, do not start engine implementation — return to rule design first.
Once the engine satisfies Part 1, evaluate quality on two layers.
Run Part 2 when quality itself is the question: a new or reworked rule set, an explicit balance or bot-strength assessment, or a change to scoreState, action legality, or bot logic. UI, wording, rendering, and pure serialization changes that leave the rule semantics untouched need the Part 1 contract checks only — do not re-run the ladder and metric suite for them.
Implement three bots over the contract:
getLegalActionsscoreStatescoreStateMeasure with N ≥ 200 games per matchup, swapping seats to control for first-move advantage.
| Metric | Definition | Target |
|---|---|---|
| Baseline vs Random win rate | Fraction of games the Baseline bot wins against Random, averaged across swapped seats | ≥ 0.65 |
| Strong vs Baseline win rate | Fraction of games the Strong bot wins against Baseline, averaged across swapped seats | ≥ 0.60 |
| First-player advantage | win-rate gap between seats in the same matchup | ≤ 0.10 |
| Action usage distribution | per-action usage rate, per bot | no core action below 0.05 |
Per game, snapshot scoreState each turn. Derive WP (win probability) as WP = sigmoid((score0 − score1) / T). Calibrate temperature T per game so that Random-vs-Strong terminal WP for Strong averages ≈ 0.9.
| Metric | Definition | Target |
|---|---|---|
| Tension Score | std-dev of the WP time-series | 0.15–0.35 |
| Lead Change Count | times WP crossed 0.5 | ≥ 2 per game |
| Comeback Rate | fraction of games won by a player who had WP ≤ 0.25 | 0.05–0.25 |
| Flatness Ratio | fraction of games with ≥ 5 consecutive turns of |ΔWP| ≤ 0.03 | ≤ 0.20 |
| Final-Stretch Volatility | WP std-dev in the last 25% of turns | ≥ 0.8 × Tension Score |
| Decision Density | mean count of distinct legal actions per turn | game-dependent; report distribution |
When metrics miss targets, look for:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub abagames/agentic-gamedev-skills --plugin gameplay-debugging-toolkit5 skills in this plugin
/adversarially-validating-game-repairsStress-tests an already-written game bug fix with adversarial cases selected from the state, timing, identity, lifecycle, persistence, and input surfaces the patch can actually reach, then returns a PatchEvidence record covering fail-to-pass, relevant pass-to-pass, inverse-case, invariant, and untested-scope evidence. Use when a fix makes the reported symptom go away and it is still unknown whether the fix is the real one or an overfit, coincidental, or plausible-but-wrong one. Not for finding unknown defects in a build (that is runtime smoke testing), checking one mechanic against its written spec, or judging difficulty, fun, or balance./auditing-gameplay-implementation-coverageAudits a stateful game's specification, phase/state machine, implementation, presentation, and tests for scenario-specific omissions such as one phase missing an input alias, one actor skipping a rule, a state change lacking HUD feedback, an event lacking audio, or a lifecycle boundary failing to reset or freeze state. Use when a game mostly works but may contain unimplemented sibling cases, inconsistent behavior across phases or actors, or important rules with no concrete probe; scope the audit to behavior surfaces changed or plausibly reached by a cross-cutting mechanic, to named high-risk surfaces before release, or to a family implicated by repeated forgotten-case bugs. Do not use for a small isolated change already covered by a direct distinguishing assertion, and do not expand into unrelated behavior surfaces. Not for localizing an already-reproduced semantic divergence, validating an existing patch, measuring balance, or proving exhaustive correctness.Other plugins' skills for the same job