/game:headless-godot-runsfrom Game Design and Build
Run Godot 4 tools, probes, bots and checks headless so that they compile, end by themselves, report errors honestly and never touch the player's save. It covers `godot -s` SceneTree tool scripts (no class names, autoloads by node path, a quit watchdog), the import and parse check after a merge or a new worktree, a throwaway check project when the real one cannot load, save and settings isolation for tool runs, a dev task runner, time limits, log scans and process cleanup. Use it whenever someone writes or runs a `godot --headless` or `godot -s` script, or asks why a tool says "Identifier not found", "Could not find type", "Nonexistent function 'new'" or "no resource loaders", why a headless run hangs or gives silent wrong numbers, why tests fail after a merge, or how to keep bots and tests off the real save, even if nobody says "headless".
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 headless Godot tool fails in quiet ways. A godot -s script compiles before the autoloads exist, so 1 class name in it can stop a script from compiling, and the run still exits 0 with wrong numbers. A stale import cache, a hang after a script error or a shared save file gives the same kind of quiet fault. The method is a short set of rules for the tool script, plus a run wrapper that adds a hard time limit, a log file and a scan for error lines. It works because each rule closes 1 failure that the engine does not turn into an exit code.
class_name or new art reaches a checkout.user:// folder.frame_post_draw never fires headless and the headless renderer is a dummy. Use visual-verification or godot-perf.godot-testing.fleet-game-dev.scripts/tool_template.gd. Write the entry as extends SceneTree. Name no class_name script and no autoload in it, and keep game objects in untyped variables.
Check: the file has no game class name and no autoload name outside a string.
Why: a -s script compiles before the autoloads exist, so a name that needs them fails._initialize(). Defer it to the first frame. If the game reads a save path at start-up, set the scratch save slot before the run (see "Tool save isolation").
Check: the work starts from a process_frame callback or later.root.get_node("<Name>") and call(). Load game scripts with load("res://...") at run time, not with preload() or a class name. Use enum numbers, not SomeClass.State.VALUE.
Check: grep the tool for preload( and for each autoload name followed by ..
Why: a tool that names a game enum can stop the game script itself from compiling.-s loader instances a stage Node script after start-up, and the stage uses the game normally because it compiles after the autoloads.
Check: the loader holds no game names; only the stage does.TOOL_TIMEOUT and a nonzero code.
Why: a script error stops the normal quit(), and the run hangs.test_*.gd in the test folder. Run them with -s <absolute path>.
Check: the test runner does not list the tool.
Why: a test runner runs every test_*.gd file. A tool outside the project needs no .uid.
If a tool must be under res://, copy it in for the run and remove it after.scripts/parse_check.gd) when the tool is under res://.
Check: the log has no SCRIPT ERROR line.
Why: --check-only has no autoloads, reports false "Identifier not found" errors, and can exit 0 on a real parse error.scripts/godot-run.sh <seconds> <log> godot --headless .... It writes the log, stops the run at the alarm, and fails on error lines.
Check: the exit code is 0 and the log holds the summary line you set in GODOT_RUN_REQUIRE. A sweep or calibration marks a run invalid on any SCRIPT ERROR.
Why: a tool that failed to compile still exits 0 and prints plausible but empty results.class_name, a merge, a branch switch or new art (see the next section). Then rerun the tool.Input.parse_input_event() and a real event, not a direct method call. Await 1 or 2 frames after you move an object before a staged call reads its position. In a SceneTree script, connect node_added on self. Guard calls that need a real display server with a feature check.
Check: the game reacts to the event in the log, the same as for a player.Array[PackedStringArray] does not convert inner literals. Use plain nested Arrays and an Array loop variable.const cannot hold a function call. Use a var or a static function.:= cannot infer one, for example a value from an untyped dictionary.PackedStringArray has no map(). Use a loop.
Check: the parse check passes and the tool prints non-empty values.The .godot folder holds the import cache and the global class list. A new worktree has none, and a merge can leave it stale. Then scripts fail with "Identifier not declared", "Could not find type" or "Nonexistent function 'new' in base 'GDScript'", and some runs hang at low CPU.
.godot folder exists. In a new worktree, run godot --headless --path <project> --import under a time limit before any test. Check its exit code.class_name, and new image or audio file..gd, .tscn and .tres under res:// and prints checked=N failed=M.godot --headless -s <script> or with --check-only. Remember that check-only lacks autoloads, so read its autoload errors as noise.SCRIPT ERROR line. The autoload itself failed to parse..uid and .import files after the import. Commit those of your own scripts and assets with the change that caused them. Leave the files of other work alone, because each branch makes different uids.git status after an import. Restore tracked files that the import changed and that your change does not own, for example an audio bus layout. Commit or save your own edits in that file first, because git checkout <file> reverts them too..uid blocks a merge, compare it with the incoming copy. Remove the local one and merge again. If 2 branches added the same .uid with different content, keep the side that owns the script..godot folder first. Then stop only your own process.Use this fallback when you must check your own scripts or resources, but the real project cannot load because a file that other work owns is missing or broken. Do not edit that file.
mktemp -d.project.godot there, or rsync the project folder into it.-s check script that loads each of your resources and scenes. The parse check script works here.Autoloads that read a save or settings file do it at start-up, before any -s script runs. A tool, test or capture that starts the real game can therefore write the player's save, or read another run's settings.
-s before a lone --), test mode, and a start from a worktree path all count as tool runs. Tool runs use tool save and settings paths.<GAME>_TOOL_SAVE=<name>.
Why: the environment exists before any autoload starts. A safe name (lower-case letters, digits and -) gives user://tool-save-<name>.json. An unsafe name falls back to 1 shared tool path.HOME to keep it off the real save.quit(), --quit-after <frames>, or a hard alarm. On macOS there is no timeout command (exit 127), so use perl -e 'alarm N; exec @ARGV' godot ... or gtimeout. scripts/godot-run.sh does this.echo $? after godot ... | tail gives
the code of tail. Use a log file or set -o pipefail.SCRIPT ERROR, Parse Error, FAIL, the summary line and "leaked at exit". Treat an empty result or a missing summary line as a failure.--fixed-fps 60 and --delta-smoothing disable as engine flags before --. The engine consumes --fixed-fps, so the tool cannot read it from its user arguments. Prove the rate from ticks per frame.nice -n 10. Do not lower it for timing runs.&. Use a tracked background task with an end marker, or run it in the foreground.scripts/godot-procs.sh <worktree path>. Match the binary and the path, not the text of your own command. Stop only your own processes. Report the others. Never start or stop the player's game.A project with many headless commands needs 1 list of them, so that each one runs the same way for every person and agent.
justfile or a Makefile with 1 recipe per command: import, parse check, tests, each platform build, the dist package, the visual gate, bot runs and asset generators. Make the default recipe list the others.clean, as a dry run.play recipe with a stop signal: start it, wait a few seconds, and stop it.| Symptom | Cause | Fix |
|---|---|---|
| Bots play the whole game but a scripted event never happens; every result is wrong for a day | 1 class name in the tool script stopped a script from compiling; the run still exited 0 | Load scripts with load() at run time; mark a run invalid on any SCRIPT ERROR line |
"Identifier not found: " in a -s script | Autoloads are not compile-time names in a SceneTree script | root.get_node("<Name>") and call() |
| A game script stops compiling after a tool change | The tool named a game enum (SomeClass.State.X) | Use the enum numbers in the tool |
| A tool hangs until the alarm | A script error stopped quit() | A watchdog timer inside the tool, and a hard alarm outside it |
| A run hangs 25 minutes at about 1 % CPU | No .godot import cache in a new worktree | Stop your own process, import, rerun with narrow filters |
| About 50 to 70 tests fail on unknown classes after a merge | Stale class cache | Run the import, then the tests |
"Could not find type" after a branch switch or a new class_name | The class is not registered yet | Run the import |
| "no resource loaders" for new audio or images | Scripts loaded before the new files imported | Run the import a second time |
| A batch gives empty logs after a merge | The import did not run before the batch | Import inside the batch script |
| Textures load at the old size after an art change | Stale import cache | Run the import |
--check-only says "Identifier not found" on a correct script | Check-only has no autoloads | Use the project parse check or the related tests |
--check-only exits 0 on a broken script | Check-only does not set the exit code | Use the parse check, which exits 1 |
| A test script's tests silently do not run | The script failed to compile: := could not infer a type | Run the script alone; add an explicit type |
| The parse check misses a tool | The tool lives outside res:// | Run the moved tool once on its own |
| An autoload is null in a test | The autoload failed to parse | Read the first SCRIPT ERROR line |
| A headless capture hangs | frame_post_draw never fires headless | Run captures in a real window |
| Headless frame timings look odd | The headless renderer is a dummy | Measure performance in a window |
| A display-server call fails headless | The headless server lacks it | Guard it with a feature check |
| A fake input does nothing | The tool called a handler directly | Input.parse_input_event() with a real event |
| A staged call reads an old position | The object moved in the same frame | Await 1 or 2 frames |
set_process(false) has no effect | It ran before add_child() | Call it after add_child() |
| A parse error on a correct-looking line | A local name shadows a parameter or a signal (finished), or an override does not match the parent signature | Rename the local or the helper |
| A typed loop over a const of arrays gives empty values | A typed constant does not convert inner literals | Plain nested Arrays and an Array loop variable |
| "not a constant expression" | A function call in a const | Use a var or a static function |
| A change to a packed array is lost | A packed array in a dictionary is a value copy | Write it back or return it |
| A shader reads null | A uniform is not set in every build | Set every uniform |
| A tween test misses the first callback | The first step runs 1 frame late | Expect it 1 frame late, or set the first step in code |
| An animated child jumps back | Its container resets the offset | Put it inside a plain holder node |
| A colour test fails on a texture pixel | The atlas reads in linear space | Test a pixel that works in linear and sRGB |
| The project file loses lines after a generator tool | ProjectSettings.save() drops default-valued lines | Diff the project file and restore lost lines |
| An import changed a file you do not own | The import rewrites some resources | Restore that file; save your own edits in it first |
A merge stops on an untracked .uid | 2 branches made different uids for 1 script | Compare, keep the owner's copy, merge again |
A commit holds other work's .uid files | git add of a whole folder | Add only your own .uid files |
New test files fail on get_tree() | The test base class exposes another helper | Use the test base's helpers |
| A capture wrote the player's save | It started the game without -s | Treat script mode, test mode and worktree paths as tool runs |
| A tool run read the player's settings | Autoloads read settings before the -s script ran | Set the slot from an environment variable |
| A saved setting leaked into a test | The helper set the path after _ready loaded settings | Set the path first, or reload defaults |
| Tests pass alone and fail in parallel | 2 runs shared 1 tool save or fixed file names | A slot per run; per-process scratch folders |
| A shared tool save from a newer version set a read-only flag | Runs shared 1 tool save | A scratch save per runner and per test |
| A capture used another run's reduced-motion setting | The capture queue started Godot without a slot | Pass the requester's slot to the queue |
| Event ticks shifted by many frames in a tool | Shared settings turned on reduced motion and hit-stop | Pin timing settings in the tool's own settings file |
| The user data folder grows by tens of GB | Thousands of tool saves | Clean tool saves by name; never near the player's save |
| Save tests fail in a sandbox | The sandbox blocks user:// writes and nice | Run them where writes work; list it as a known failure class |
| A guard test runs its setup twice | before_each() called by hand | Put setup in 1 helper |
| Exit 127 on macOS | No timeout command | The perl alarm, gtimeout, or --quit-after |
| A call waits for hours | The slot wait sat inside or around the alarm | Put the alarm on the Godot command only |
| The parent stopped but Godot still runs | The alarm wrapped the wrapper, not Godot | Find and stop the child |
| The exit code says pass but the run failed | $? came from tail in a pipe | A log file or pipefail |
| No log after a loop | A relative log path inside cd | Absolute log paths |
| A test filter ran 0 tests and looked green | A comma list in 1 filter | 1 filter per call; check the count |
| A run header says the fixed rate is off | The engine consumes --fixed-fps | Prove the rate from ticks per frame |
| A process list shows your own command | pgrep -f matched the shell line or the grep | Match the binary name and the worktree path |
A run started with & held a slot after the call ended | The run was not tracked | A tracked background task or the foreground |
| A batch still ran after the shell stopped it | The child survived the stop | Check for leftover processes before a new run |
| A zsh loop passed 1 word instead of several flags | zsh does not split variables | An array, $=VAR, or a shell function |
The play recipe never ends in a test | A play run has no end | Start it, wait, stop it |
| Hung windows from old runs load the machine | Runs did not end by themselves | A frame limit or an alarm on every run; a process check before done |
load(), a quit watchdog, a done line. scripts/tool_template.gd is a start..gd, .tscn and .tres; prints checked=N failed=M; exits 1 on a failure. scripts/parse_check.gd is a start.scripts/godot-run.sh is a start.scripts/godot-procs.sh is a start.The bundled scripts are POSIX sh and GDScript, not Python, so do not check them with python3. Check them as follows:
sh -n scripts/godot-run.sh and bash -n scripts/godot-run.sh, then a trivial run: sh scripts/godot-run.sh 5 /tmp/run-smoke.log true exits 0.sh -n scripts/godot-procs.sh, then sh scripts/godot-procs.sh /tmp lists 0 or more lines..gd file, make a tiny project in a temporary folder (a project.godot with config_version=5). Run godot --headless --path <folder> -s <absolute path to the file>. parse_check.gd prints PARSE_CHECK checked=0 failed=0. tool_template.gd prints TOOL_DONE code=1, because the tiny project has no Config autoload.SCRIPT ERROR, Parse Error, "Identifier not found").justfile or Makefile) plus a preflight script..uid files.godot-testing: the headless test loop, flake isolation and the finish gate. This skill makes the runs safe; that one makes the tests good.fleet-game-dev: the slot runner that caps parallel runs, the mkdir locks, and the rules for landing .uid files and merges.bot-balance-loop: bot fights and measure probes, the main users of SceneTree tools and the determinism flags.visual-verification: window captures and visual gates, which cannot run headless.godot-perf: frame timings in a real window, and the shader warm-up list that a parse check can guard.feature-seams-and-saves: save versions and save integrity in the shipped game.release-and-store: export and demo build recipes for the task runner.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"./bot-balance-loopTune bosses, encounters and game rules with scripted bots that play the real Godot game headless, then compare the measured tables against written target bands. The loop writes the bands first, builds a fight tool with several bot steerings (coached, tight, wide, wait, ram), runs fixed seeds with repeatable flags, builds a table of first-try wins, mean tries, resource left and fight length, names each odd result BOT or GAME, and changes 1 lever at a time. It also covers model start states, rule probes, a shared pipeline, wall triage by snapshot replay, a full-playthrough bot, coach text from winning fights and telegraph-to-hit tests. Use it whenever someone wants to balance or retune a boss, check a kill rate or a difficulty band, find out why players or bots stall at an encounter, measure a rule change with encounter bots or a full-playthrough bot, or run a bot playthrough of the whole game, even if nobody says "bot table" or "target band"./core-loopUse when designing or diagramming a game's core loop — applies Stone Librande's "flowchart first" to draw the moment-to-moment, session and long-term loops, each as player action → system response → feedback → next decision, as Mermaid flowcharts, with every feedback edge labeled by the kind of fun it serves (LeBlanc's eight kinds), and checks that the inner loops (not the long-term loop) produce every target kind. Trigger on: "core loop", "gameplay loop", "draw the loop", "moment-to-moment", "session loop", "long-term loop", "retention loop", or the loop step of the game-design pipeline. Runs headless: never asks, infers and states assumptions./design-diagramsUse when a game design needs the right diagram, not more prose: an engine loop, a whole-game storyboard, a time-and-space map, a faction relationship chart, an axes-first matrix, or a module map. Trigger on: "what diagram should I use", "map out the loop", "chart the factions", "storyboard the game", or when `core-loop` or `game-brief` needs a diagram picked and drawn. Picks the diagram from Librande's vocabulary, applies the "wrong metaphor" check, and emits a Mermaid or JSON/SVG recipe./feature-seams-and-savesAdd new content, variants and whole modes to a Godot game through data seams and off-by-default flags, and keep player saves and settings safe across versions. It covers a new playable variant (vehicle, class, character) or encounter batch on a shared base class, an optional row key whose default keeps old rows exact, a prototype branch plus a flagged landing for a big mode, mode fields on content rows, atomic signed saves with backups, save-version migration tested with a real old save, graphics presets with a first-launch Auto pick, and setup tools that give the same project file on a second run. Use it whenever someone wants to add a character, enemy, boss, level type, game mode or data field, bump the save format, rename a settings key, harden saves against corruption or edits, or asks "will old saves still load?" or "how do I add this without breaking the base game?", even if nobody says "seam" or "migration".