Help us improve
Share bugs, ideas, or general feedback.
From claude-commands
Analyzes campaign dice roll data for fairness, anomalies, and statistical deviation. Useful for game integrity validation and detecting impossible values or biased distributions.
npx claudepluginhub jleechanorg/claude-commands --plugin claude-commandsHow this skill is triggered — by the user, by Claude, or both
Slash command
/claude-commands:dice-roll-auditThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill documents how to audit dice rolls from Your Project campaigns. Use this to analyze dice roll fairness, detect anomalies, and validate game mechanics.
Validates dice roll authenticity using chi-squared statistical tests and RNG code verification to detect LLM fabrication.
Analyzes dice probability distributions using exact math or Monte Carlo simulation. Handles drop/keep, advantage, rerolls, and exploding dice for game systems.
Pressure tests RPG campaigns and modules by simulating adversarial player actions to uncover plot holes, dead-ends, exploits, and edge cases like murder hobo behavior or clever spell use.
Share bugs, ideas, or general feedback.
This skill documents how to audit dice rolls from Your Project campaigns. Use this to analyze dice roll fairness, detect anomalies, and validate game mechanics.
WORLDAI_DEV_MODE=true python scripts/audit_dice_rolls.py <campaign_id>
# Audit campaign from URL: https://mvp-site-app-dev-i6xf2p72ka-uc.a.run.app/game/tAE30bFvyfO0rUd9cgyv
WORLDAI_DEV_MODE=true python scripts/audit_dice_rolls.py tAE30bFvyfO0rUd9cgyv
The script extracts dice from:
dice_audit_events and debug_info.tool_results (authoritative).debug_info.stdout JSON from Gemini code_execution (used only when no primary sources exist).dice_rolls strings and narrative text patterns (only when structured sources are missing).[3, 5] for 2d6).============================================================
CAMPAIGN DICE ROLL AUDIT
============================================================
Campaign ID: tAE30bFvyfO0rUd9cgyv
Campaign Title: alexiel swtor
User ID: vnLp2G3m21PJL6kxcuAqmWSOtm73
============================================================
Total story entries: 498
Entries with dice rolls: 66
Total dice rolls found: 93
--- d20 Analysis ---
Total rolls: 89
Range: 0 - 23
Mean: 7.73 (expected: 10.50)
Deviation: -2.77
Std Dev: 5.41
Distribution: {0: 2, 1: 2, 2: 10, 3: 9, ...}
WARNINGS:
- Impossible values detected: [0, 21, 22, 23]
From a game URL like:
https://mvp-site-app-dev-i6xf2p72ka-uc.a.run.app/game/tAE30bFvyfO0rUd9cgyv
The campaign ID is the last segment: tAE30bFvyfO0rUd9cgyv
export WORLDAI_DEV_MODE=true
export WORLDAI_GOOGLE_APPLICATION_CREDENTIALS=~/serviceAccountKey.json
Location: ~/serviceAccountKey.json
Project: worldarchitecture-ai
| Die | Expected Mean |
|---|---|
| d4 | 2.5 |
| d6 | 3.5 |
| d8 | 4.5 |
| d10 | 5.5 |
| d12 | 6.5 |
| d20 | 10.5 |
| d100 | 50.5 |
The audit now includes chi-squared testing for dice authenticity:
| Chi-Squared | Verdict |
|---|---|
| < 30 | PASS - Normal random variation |
| 30-50 | WARNING - Minor anomaly |
| 50-100 | FAIL - Significant deviation |
| > 100 | FAIL - Likely fabrication |
Reference case: PR #2551 detected fabrication with chi-squared = 411.81
See dice-authenticity-standards.md for full chi-squared methodology and RNG verification standards.
ValueError: WORLDAI_GOOGLE_APPLICATION_CREDENTIALS requires WORLDAI_DEV_MODE=true
Solution: Set WORLDAI_DEV_MODE=true before running
If "No dice rolls found", possible causes:
The script automatically applies clock skew patch. If still failing, check:
All dice rolls executed via the tool system are now logged to GCP Cloud Logging with the prefix DICE_AUDIT: and DICE_TOOL_RESULT:.
DICE_AUDIT: notation=1d20+5 | rolls=[15] | modifier=5 | total=20 | nat20=False | nat1=False
DICE_TOOL_EXEC: tool=roll_attack | args={'attack_modifier': 5, 'target_ac': 15}
DICE_TOOL_RESULT: tool=roll_attack | weapon=Longsword | rolls=[12] | total=17 | hit=True | critical=False | damage=8
# Find all dice rolls in last hour
gcloud logging read "textPayload:DICE_AUDIT" --limit=100 --freshness=1h
# Find all dice tool executions
gcloud logging read "textPayload:DICE_TOOL_EXEC" --limit=50
scripts/audit_dice_rolls.py
dice-authenticity-standards.md - Chi-squared testing and RNG verificationdice-real-mode-tests.md - MCP real-mode testingfirebase-prod-campaigns.md - Querying campaign dataworldai-mcp-server-usage.md - MCP server interaction