/game:godot-testingfrom Game Design and Build
Prove Godot changes with a headless GDScript test loop. Record a baseline before you edit, write a test that fails first, run focused filters, then the full suite, a parse check and a smoke scene. Separate new failures from old ones by name. Covers red-first and mutation proofs, flaky tests and shared state, "leaked at exit" lines, audits of tests that only copy data, input injection, per-route regression tests, and the finish gate before a unit reports done. Ships a small runner, a test base class and a repeat-run script. Use it whenever someone changes GDScript or scenes and must show that the change works, or asks why a test passes alone but fails in the suite, why the suite leaks at exit, whether a failure is pre-existing, how to test menus with input, or whether a test can fail at all. Use it even if nobody says "test runner" or "regression test".
Ships in Game Design and Build. 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.
Read when SKILL.md points to them; scripts run unread.
A Godot project that many people or agents change every day needs one fast, honest proof that a change works and breaks nothing. The method is a headless test loop: record a baseline, write a test that fails for the right reason, make it pass, then widen the run from the file to the full suite and compare by failure name. It works because every claim ("my change caused no new failure", "this test catches the bug") rests on a run you can repeat, not on a reading of the code.
Rules: game:game-qa-reviewer holds the rules for test coverage and release readiness; this skill is the Godot test loop that meets them.
visual-verification or godot-perf.headless-godot-runs.safe-refactor-and-review.scripts/run_tests.gd). It runs every test_*.gd file and takes --filter=<path text>. It fails a test on a failed assert and on any engine error or push_error, through a registered Logger. It counts skips as skips, prints passed, failed and skipped, and exits 1 when 0 tests ran. Check: a run with a filter that matches nothing exits 1. Why: a green run with 0 tests looks like a pass.headless-godot-runs owns: the import after each checkout, merge or new class_name file, and the project parse check. Follow its "Import and parse hygiene" section. Check: both pass before you record the baseline. Why: a stale class cache after a merge can fail hundreds of tests that your change never touched.git archive <base> | tar -x -C <tmp> or a temporary
worktree, then import). Copy every folder the check reads. Check: if it fails there too, report it as pre-existing with the exact FAIL line, and do not fix it inside your unit.assert_equal fails at parse time and can take the whole file down.headless-godot-runs, then a main or demo scene headless with --quit-after <frames> and a log file. Run git diff --check. Check: only the files you own changed.A test that passes before the fix proves nothing about the fix. Prove each new regression test, guard test or check in one of these ways, and write both results down.
git diff <files> > <tmp>/change.patch. Revert it with git apply -R <tmp>/change.patch. Run the test and record the fail count. Apply the patch again and record the pass count. Use a patch, not a stash, so the worktree state stays visible.git diff to show nothing is left.Tests that pass before the change describe current behaviour. Keep them, but do not count them as proof. Sort each failure into a test fault or a code fault before you change anything. Report both counts, for example "all 5 fail without the fix, all 5 pass with it".
A test that passes alone and fails in the suite almost always reads shared state. Find the state; do not add waits.
scripts/repeat_run.sh) and count the failed runs.user:// paths, static vars, autoloads, live signal handlers and lambdas, node meta, timing budgets, and global input state.scratch_path() in scripts/test_case.gd). Give each tool run its own save. Turn telemetry and analytics off in test runs. Why: 2 suites from 2 worktrees share 1 user folder.reset_tests.gd), and in the setup of any test that opens a screen that reads it. Save global state in before_each and restore it in after_each. Clear lambdas in after_each.active flag. Do not call a reset that fires signals with side effects. Load an empty save, then the target save, instead.A clean exit is part of a pass. A suite that prints "leaked at exit" or RID leak lines is not clean.
--verbose to list the leaked objects by type.A known trap: a static function whose return type is its own class can form a reference cycle. Return an untyped value and let callers cast. Another: a headless "leak" can come from the placeholder renderer; confirm a render leak in a window run.
Tests should assert rules and relations, not copies of data tables or tuned numbers. A test that recomputes the expected value from the same table proves nothing and breaks on every valid tuning change. Audit a suite in 4 phases.
--list-unchecked. Record passed, failed, skipped and unchecked per folder. Count tests per file so the verdict table covers every test. An unchecked hit is a candidate, not a verdict; a test can check through fail().shasum or diff -q. Never re-type the original by hand.When a planned change or a merge breaks old tests: reproduce each failure, write the test's intent in 1 line, and probe real values with a temporary test. Decide "stale test" or "wrong code". For a stale test, change only the expected values, keep the intent, and add 1 assert for the new rule. Grep for fake classes that copy a changed signature. A pass with 0 edits is a valid result.
Drive menus and the player through the same input actions a real player uses.
ui_* actions in menu code, so keys, pads and tests share 1 path.tap() in scripts/test_case.gd).after_each, so a failed test does not change later tests.ui_accept and ui_cancel have no joypad events. Let 1 owner change the input map; everyone else tests through action injection.Use this when a player reports that a screen shows the wrong state and several menu routes lead to that screen.
A known trap: a hover signal fires from a pointer that rests over a card when the screen opens. Take focus from the mouse only on real mouse motion.
Run this gate before a unit of work reports done or ready to land.
headless-godot-runs).git diff --stat <merged base commit>. It lists only your files. Review your own diff once.git status is clean, that staged renames are committed, and that none of your Godot processes still runs. Match the real binary path, not the word "godot".| Symptom | Cause | Fix |
|---|---|---|
| Hundreds of failures after a merge | Stale import or class cache | Import, then run again |
| Failures from conflict markers | Suite ran on an unresolved merge | Resolve the merge first; discard the result |
| Runner green with 0 tests | No skip state; no 0-test rule | Count skips; exit 1 on 0 tests |
| Filtered run ran the full suite, or 0 tests | Wrong flag or a comma list | Check the passed count before you report |
| 1 bad file fails dozens of tests | Typed var with an untyped value | Parse check names the file; add a type |
| Test file does not load | Class name not in scope | Add a preload const in the test |
| Whole test file fails to parse | Multi-line lambda, bad string escape | Plain helper function; plain string |
| Wrong helper name | Guessed API (assert_equal) or clash with base | Read the base class; unique helper names |
| Async helper did nothing | Called without await | await it |
| Node name compare fails | name is a StringName | Compare String(name) |
| Local var acts odd | It shadows a node property (scale) | Rename the local |
| Inner class cannot call outer statics | GDScript scope rule | Pass values in from the outer code |
| Packed array edit has no effect | You edited a copy | Assign the whole array back |
node.get("CONST") returns null | get does not read script constants | Read the script's constant map |
| JSON number compare fails | JSON loads numbers as float | Compare as float or cast on load |
| Float compare fails | float32 loops, darkened colours | Tolerance about 1e-3, or 1/255 for colours |
| Angle test fails near a wrap | Angle wraps (for example -90 to 270) | Compare with fposmod |
| Recolour changed other sprites | Texture.get_image() shares the image | Recolour a copy |
| Message queue overflow | Thousands of steps with no idle frame | Let 1 frame pass per second of steps |
| HUD crash in a test | Huge test capacity built 1 tick per unit | Zero the drain instead |
| Scenario ends before the check | Test damage too large after a data change | Keep test inputs small |
| Test passes for the wrong reason | Wrong reference point | Step frame by frame; measure at the event |
| Rule never exercised | Inputs reach it rarely | Add inputs that hit the rule; prove with a mutant |
| Test stops before the event | Time cap on the loop | Cap the step count |
| Position wrong at frame 0 | Camera or spawn not settled | Wait for the event; add a 1-tick margin |
| 2 events in 1 frame | 1 replaced the other | Fire them in separate frames |
| Object always moving hides the effect | No control case | Compare a twin in and out of the effect |
| Capture hangs headless | Headless never draws | Skip headless; free the scene on wait |
| Dummy renderer returns no instance data | Logic lives in render code | Move it to a pure function; test that |
| Test reads stale log | File not flushed | flush() before the read |
| World vs local units mix | Test used world coordinates | A helper reads spots from world data |
| Test sends telemetry | Demo scene logs in tests | Turn telemetry off in test runs |
| Tool ran with the suite | Tool file had the test_ prefix | Rename the tool |
| Base copy fails with missing file | Partial copy | Copy every folder the check reads |
| Test value looks like a code bug | Wrong expectation | Read the real rule; fix the test value |
| Suite prints nothing on macOS | timeout is not installed | perl -e 'alarm N; exec @ARGV' ... |
| Glob not expanded in grep | zsh glob in --include=*.gd | Quote the glob |
| Random test fails 1 in 5 | Unseeded random draw | Seed the draw |
| Check has a 1-frame margin | Timers run before tweens; fast headless frames | Wait on timers; wait for tween end |
| Next test sees old tuning | Static var leaked | Restore it in after_each |
| Save tests fail in every run | Another branch wrote a newer save version | Per-run scratch saves |
| Focus test flakes 11 of 20 | Selection by dictionary order | Pick by a stable rule; test the tie |
| Bugs reached the build | Lands ran only named folders | Full suite at verify |
/tmp copy fails to start | No or stale imported cache | Import, then copy |
| Window gate fails once, passes next | Known gate flake | Log it; run twice; fix the gate later |
| Skips look like passes | Runner counts skips as passes | Count skips separately |
| Fail-safe path not checked | Runner ignores warnings | Count warnings in that test |
| Output folder ignored or unwritable | Ignore rule or sandbox | Write under the tests folder with .gdignore |
| Game loads a backup save | Test save missing | Write the test save in setup |
| Leak count did not change | Wrong suspect (free, type refs) | Self-typed static cycle; return untyped |
| Second tap lost | No frame between release and press | 1 frame after release |
| HUD tests fail in suite only | Pad test left device family set | Reset input state in after_each |
| Rewrite lost a real check | Audit dropped an assert | Add it back; prove it with a break |
| Data change breaks row tests | Exact row counts | Assert non-empty and unique |
| Rewrite fails on valid rows | Optional field empty by design | Read the data contract |
| Hidden changes after a mutant | Hand edit to restore | Restore from copy; compare a hash |
| Backup files left in tests | Save rotation in a test | Clean in after_each; check git status |
| Timing test fails under load only | Machine load | Record load; rerun alone |
| Test passes under 1 filter only | Order dependence | Run under 2 filters and on the base |
| Wrong screen state on open | Hover from a resting pointer | Take mouse focus only on real motion |
| Process check finds false hits | pgrep -f godot matched shells | Match the real binary and its folder |
| Base moved during the work | Long unit | Merge again; repeat the gate |
| Generator wrote outside scope | Model run side effect | git checkout that file |
Merge blocked by a .uid file | Import made a local copy | Delete the local copy |
| Merge blocked by a rename | Staged rename not committed | Commit the rename first |
| Diff shows other work | Base tip moved after the merge | Diff against the commit you merged |
| New guard test fails on your files | Merge brought a new rule | Ask the owner before you edit outside scope |
| Test in another unit's file breaks | Change by design | Ask the owner before you edit it |
| Hung run at full CPU | 1 test never ends | Find it by process and last log line |
| Out-of-scope stale test found | Parse check reads everything | Report it; ask for ownership of that file |
scripts/run_tests.gd): a SceneTree script; --filter, --list-unchecked; fails on engine errors; counts skips; exits 1 on 0 tests; calls an optional per-file reset hook.scripts/test_case.gd): counted asserts, skip(), skip_if_headless(), add_node() with auto-free, frames(), seconds(), tap(), scratch_path().res://tests/reset_tests.gd): a static reset(tree) that resets each stateful autoload and points saves and settings at scratch files. Do not prefix it with test_.scripts/parse_check.gd from headless-godot-runs. This skill does not ship a second copy.scripts/repeat_run.sh): N runs of 1 filter, 1 log per run, a fail count.None of the scripts is Python. Run each one with its own tool.
scripts/run_tests.gd: copy it and test_case.gd to res://tests/. Run godot --headless --path <project> -s res://tests/run_tests.gd. It needs Godot 4.5 or newer.scripts/test_case.gd: the base class that test files extend. The runner loads it; do not run it alone.scripts/repeat_run.sh: run sh scripts/repeat_run.sh <project dir> <filter> [runs]. It needs perl and a godot binary on PATH, or the binary path in GODOT.Smoke test for the GDScript files: make an empty project in a temp folder (a project.godot with config_version=5), copy both scripts to res://tests/, add 1 test_*.gd file, and run the runner. Check: it prints "1 passed" and exits 0.
headless-godot-runs: owns the import, the project parse check, tool save isolation and process cleanup. Run its checks before this loop. This skill owns the test semantics.visual-verification: the window gate and real captures for tests that skip headless.safe-refactor-and-review: proof that a refactor keeps behaviour, and review fix waves.fleet-game-dev: the worktree unit flow, landing, and the orchestrator's check of done claims. The finish gate here is the last step of that flow.release-and-store: controller input support and the input map that tests inject into.balance-model-data: the same negative-test proof for checks of design docs against data.godot-perf: frame-cost budgets and stress harnesses beyond a single cost test.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mattmakes/skill-marketplace --plugin game30 skills in this plugin
/art-directionUse when a game concept needs its visual direction set: a style sheet (palette, shape language, lighting, texture), a shot list tied to the target fun, and image-generation prompts for a key art, hero and gameplay-mock placeholder. Trigger on: "art direction", "style sheet", "what should this look like", "shot list", or when `game-brief` needs its art section. Every image prompt carries fixed content-boundary negatives and never names a living artist./balance-model-dataKeep a game's numbers in a scripted balance model (for example Python modules) that checks design targets and exports the JSON the Godot game loads, and change that data without drift. It covers the edit-export-diff loop, FAIL-key baselines, deterministic exports, parity fixtures between the model and GDScript, what-if and lever searches inside the model, and design docs whose tables must match the model. Use it whenever someone wants to change a price, a yield, a pacing curve, a content table or an upgrade row that a script exports; asks why the model and the game disagree, why a parity test fails, or why a chapter runs too long; wants to tune or fit levers before touching game data; or writes a design doc full of numbers, even if nobody says "balance model" or "source of truth".