Agent skill

Godot Gdscript Headless Testing

by gamedev-skills in gamedev-skills/awesome-gamedev-agent-skills

Run GDScript test suites from the command line with godot --headless, using a SceneTree/MainLoop runner script that exits non-zero on failure so CI can gate merges.

Apache-2.0Auto-check passedGame Development

Install Godot Gdscript Headless Testing

skills CLI
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-gdscript-headless-testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install gamedev-skills/awesome-gamedev-agent-skills godot-gdscript-headless-testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/gamedev-skills/awesome-gamedev-agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/godot/godot-gdscript-headless-testing .claude/skills/godot-gdscript-headless-testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
godot-gdscript-headless-testing
GitHub stars
1.4k
Token cost
~2.3k tokens
SKILL.md length
1,021 words
Files
1
Skills in repo
53
Repo updated
First seen
Licence
Apache-2.0

At a glance

Run GDScript test suites from the command line with godot --headless, using a SceneTree/MainLoop runner script that exits non-zero on failure so CI can gate merges.

  • Works in 3 steps: Minimal SceneTree test runner with a… → Testing something that needs a frame, a… → CI step (GitHub Actions) that gates on…
  • A Godot project needs unit tests without opening the editor
  • SKILL.md covers When to use, Workflow, Patterns and Pitfalls, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Godot Gdscript Headless Testing is an agent skill from gamedev-skills/awesome-gamedev-agent-skills. Run GDScript test suites from the command line with godot --headless, using a SceneTree/MainLoop runner script that exits non-zero on failure so CI can gate merges. Use when a Godot project needs unit tests without opening the editor, when wiring a CI job (GitHub Actions or similar) that must fail the build on a failing .gd test, or when a godot --headless invocation hangs, opens a window, or exits 0 despite failed assertions.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Game Development, covering Game development. It works with Godot and GitHub Actions. The repository describes itself as: 74 game-dev skills for AI coding agents — Godot, Unity, Unreal, Phaser, PixiJS, three.js, Bevy, pygame, LÖVE, Roblox. Portable SKILL.md Agent Skills (the format Anthropic… The licence is Apache-2.0.

When your agent uses it

  • A Godot project needs unit tests without opening the editor
  • Wiring a CI job (GitHub Actions
  • Similar) that must fail the build on a failing .gd test
  • A godot --headless invocation hangs

Example prompts

  • “/godot-gdscript-headless-testing”

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Minimal SceneTree test runner with a real exit code
  2. Testing something that needs a frame, a timer, or a signal
  3. CI step (GitHub Actions) that gates on the exit code

What it can do on your machine

Read from SKILL.md and the folder at commit d4b0e35. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are gdscript and yaml).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Godot Gdscript Headless Testing loads about 2.3k tokens when it runs. Until then it costs about 117 tokens; SKILL.md has 1,021 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~117
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from gamedev-skills/awesome-gamedev-agent-skills at commit d4b0e35, republished under its Apache-2.0 licence (© gamedev-skills). 1,021 words, ~2,289 tokens.

Download SKILL.mdSave it as .claude/skills/godot-gdscript-headless-testing/SKILL.md (or your agent's skills folder).
name
godot-gdscript-headless-testing
description
Run GDScript test suites from the command line with `godot --headless`, using a SceneTree/MainLoop runner script that exits non-zero on failure so CI can gate merges. Use when a Godot project needs unit tests without opening the editor, when wiring a CI job (GitHub Actions or similar) that must fail the build on a failing `.gd` test, or when a `godot --headless` invocation hangs, opens a window, or exits 0 despite failed assertions.

Godot GDScript headless testing (4.x)

Run GDScript tests from the command line, without the editor GUI, and get a real process exit code CI can act on. Targets Godot 4.7 headless CLI.

When to use

  • Use when a Godot project has no testing addon installed and needs a fast way to verify GDScript logic (pure functions, resource loading, autoload state) from a terminal or CI pipeline.
  • Use when wiring a CI job that must fail the build when a .gd test fails.
  • Use when debugging why a godot --headless invocation hangs, opens a window, or exits 0 despite failing assertions.

When not to use: GDScript syntax or language features themselves → godot-gdscript; export/build pipeline and platform templates → godot-export (its own --headless use case, producing a binary, not running tests).

Workflow

  1. Confirm the binary resolves headless. Godot 4.x ships --headless built in (no export template needed); run godot --headless --version and confirm it prints a version string, not a GUI window.
  2. On a fresh checkout, import before running tests. .godot/ is normally not committed, so a clean checkout has no import cache: class_name types fail to resolve (Identifier "X" not declared in the current scope) and imported assets fail to load (No loader found for resource: res://...). Run godot --headless --path <project_dir> --import once first, in CI and locally.
  3. Write the runner as a SceneTree script, not a Node scene. A SceneTree script's _initialize() runs once before any frame — enough for pure-logic tests and no .tscn required to launch.
  4. Track pass/fail counts yourself and call quit(<code>) explicitly. Do not use bare assert() to fail a test. Godot does not turn the process exit code non-zero on push_error() by itself — the runner must count failures and call quit(1). Worse, a failed assert() inside _initialize() (official/debug build) prints SCRIPT ERROR: Assertion failed and stops execution before quit() runs, so the process never exits and CI hangs until its own timeout. Use an assert_eq()-style helper that records the failure and keeps going.
  5. Invoke with godot --headless --path <project_dir> --script res://<runner>.gd and read the process exit code, not just stdout, from the shell or CI step. --script accepts both a res://-relative path and an absolute filesystem path (e.g. a runner outside the project folder); either works.
  6. Redirect stdout and stderr to files when scripting the invocation from a wrapper shell (PowerShell, some CI runners). push_error() output goes to stderr and can be dropped or reordered when only stdout is captured live.
  7. Add a step timeout in CI. Even with the assert() pitfall avoided, an await that never resolves (Pattern #2) hangs the runner forever; a timeout-minutes on the CI step is a backstop CI-side, not a substitute for backing every await with a timeout node.

Patterns

1. Minimal SceneTree test runner with a real exit code
gdscript
# res://test_runner.gd — run with:
#   godot --headless --path . --script res://test_runner.gd
extends SceneTree

var passed := 0
var failed := 0

func _initialize() -> void:
    test_add()
    print("Results: %d passed, %d failed" % [passed, failed])
    quit(1 if failed > 0 else 0)   # non-zero exit fails the CI step

func assert_eq(actual, expected, label: String) -> void:
    if actual == expected:
        passed += 1
    else:
        failed += 1
        push_error("FAIL %s: expected %s, got %s" % [label, expected, actual])

func test_add() -> void:
    assert_eq(2 + 2, 4, "test_add")

Verified against Godot 4.7.2: godot --headless --path . --script res://test_runner.gd prints Results: N passed, M failed to stdout, routes push_error lines to stderr, and returns process exit code 0 when failed == 0, 1 otherwise.

2. Testing something that needs a frame, a timer, or a signal
gdscript
extends SceneTree

var passed := 0
var failed := 0

func _initialize() -> void:
    await run_tests()
    print("Results: %d passed, %d failed" % [passed, failed])
    quit(1 if failed > 0 else 0)   # track and report failures here too

func assert_eq(actual, expected, label: String) -> void:
    if actual == expected:
        passed += 1
    else:
        failed += 1
        push_error("FAIL %s: expected %s, got %s" % [label, expected, actual])

func run_tests() -> void:
    # `root` is not inside the tree yet during _initialize(): a Timer started now
    # errors ("not inside the tree") and its `timeout` never fires. Wait one frame.
    await process_frame
    var timer_node := Timer.new()
    timer_node.one_shot = true   # default Timer restarts after timeout
    root.add_child(timer_node)
    timer_node.start(0.1)
    await timer_node.timeout
    # assertions here can rely on the node having been in the tree for a frame
    assert_eq(timer_node.is_stopped(), true, "timer_fires_once")
    timer_node.queue_free()

_initialize() may await, which is what makes this pattern work for anything that needs a node to actually enter the tree, a timer to fire, or a signal to emit — none of which happen before the engine has processed at least one frame. Use the same passed/failed counter and assert_eq() helper as Pattern #1; a version of this pattern that always calls quit(0) can never fail a build.

Show full SKILL.md (441 more words)Show less
3. CI step (GitHub Actions) that gates on the exit code
yaml
- name: Import project (populates .godot/ on a fresh checkout)
  run: godot --headless --path . --import
- name: Run GDScript tests
  timeout-minutes: 5
  run: godot --headless --path . --script res://test_runner.gd

The import step is required on a clean checkout — without it, class_name types and imported resources fail to resolve. No extra flag is needed for the test step itself: the runner already fails the job on a non-zero exit code from run:; the discipline lives in the runner script's quit() call, not in the CI configuration. timeout-minutes is a backstop against a hung await (see Pitfalls), not a substitute for backing every await with a timeout node.

Pitfalls

  • Script "does nothing" or opens the editor window → missing --headless, or the script path is wrong. --script accepts a res://-relative path resolved against --path <project_dir>, and also an absolute filesystem path — both work.
  • Identifier "X" not declared in the current scope, or a resource fails to load, only on a fresh checkout → .godot/ (the import cache) is normally not committed, so class_name types and imported assets aren't resolved yet. Run godot --headless --path <project_dir> --import once before the test step.
  • A failed assert() hangs instead of failing the test → in an official/debug build, a failed assert() inside _initialize() prints SCRIPT ERROR: Assertion failed and stops that function before it reaches quit() — the process never exits and CI waits until its own timeout. Use an assert_eq() counter (Pattern #1) instead of bare assert() in test runners.
  • Exit code stays 0 despite failed assertions → the runner never called quit(1), or (Pattern #2) it always calls quit(0) regardless of failures. Track failures yourself and call quit() explicitly with a code that reflects them; do not rely on assert() or push_error() alone to change the exit code.
  • _initialize() runs before nodes, timers, or signals exist → logic that needs a frame to have processed must await a signal or a timer before asserting; see Pattern #2. root itself is not inside the tree yet, so a Timer added and started there errors and its timeout never fires (the runner hangs) — await process_frame first.
  • Output looks empty or out of order from a wrapper shell → some shells (PowerShell in particular) can reorder or drop a native process's live stdout/stderr. Redirect both streams to files and read the files after the process exits, instead of trusting the live console.
  • Runner never terminates → a SceneTree script keeps running until something calls quit(). A test that awaits a signal that never fires hangs the job forever — always back an await with a timeout node as a fallback, and set timeout-minutes on the CI step as a backstop.
  • godot-gdscript — the language syntax and node lifecycle this pattern's runner script itself uses.
  • godot-export — headless CLI export/build, a different --headless use case.

© gamedev-skills, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/godot/godot-gdscript-headless-testing of gamedev-skills/awesome-gamedev-agent-skills.

Open the folder on GitHubat commit d4b0e35

Compare with similar skills

Godot Gdscript Headless Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Godot Gdscript Headless Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Godot Gdscript Headless Testing this skillgamedev-skills/awesome-gamedev-agent-skills1.4k—~2.3kAutomated safety check: PassApache-2.0
Export Pipelinejame581/GodotPrompter799—~3.5kAutomated safety check: PassMIT
Scenario Godot Pipeline Automationscenario-labs/skills931—~5.5kAutomated safety check: PassMIT
Godot Export Buildsthedivergentai/GD-Agentic-Skills816—~3kAutomated safety check: PassLGPL-3.0
Godot Gdscript Patterns925236118/AlphaAgent10310 repos~5kAutomated safety check: PassMIT
2D Map and Scene Generator0x0funky/agent-sprite-forge4.4k—~2.9kAutomated safety check: PassMIT

Similar skills

  • Export Pipeline

    jame581/GodotPrompter

    A skill your agent uses when exporting and distributing Godot games — export presets, platform settings, CI/CD with GitHub Actions

    799 GitHub stars~3.5k tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • A skill your agent uses when Godot 4.7 work must run without a mouse or at scale: batch import of hundreds of GLB props or an AI image-to-3D art drop, naming rules, import presets and post-import…

    931 GitHub stars~5.5k tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • Godot Export Builds

    thedivergentai/GD-Agentic-Skills

    Expert patterns for multi-platform exports including export templates (Windows/Linux/macOS/Android/iOS/Web), command-line exports (headless mode), platform-specific settings (codesign, notarization…

    816 GitHub stars~3k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check passed
  • Godot Gdscript Patterns

    925236118/AlphaAgent

    Master Godot 4 GDScript patterns including signals, scenes, state machines, and optimization.

    103 GitHub starsUsed in 10 repos~5k tokens
    Game DevelopmentAuto-check passed
  • 2D Map and Scene Generator

    0x0funky/agent-sprite-forge

    Plans and builds 2D game maps and scenes, from tilemaps and parallax backgrounds to HD-2D plates, with collision checks, a playable HTML preview and Tiled, Godot or LDtk export.

    4.4k GitHub stars~2.9k tokensUpdated 3 days ago
    Game DevelopmentAuto-check passed
  • Godot UI Integration

    zimo-xiao-zheng/godot-ui-integration

    Build or revise Godot UI from an approved design, separated art, or a visual reference when scene structure, gameplay binding, and runtime visual verification all matter.

    277 GitHub stars~1.5k tokensUpdated 1 mo ago
    Game DevelopmentAuto-check passed

More from gamedev-skills/awesome-gamedev-agent-skills

All 53 skills in this repo
  • Create Game Assets

    gamedev-skills/awesome-gamedev-agent-skills

    Plan, generate, source, normalize, and validate cohesive visual game assets.

    1.4k GitHub stars~2k tokensUpdated 12 days ago
    Auto-check passed
  • Roblox UI

    gamedev-skills/awesome-gamedev-agent-skills

    Build production Roblox interfaces with ScreenGui/PlayerGui lifecycle, responsive UDim2 layouts, safe insets, reusable editable Instances, cross-device input and selection, restrained motion…

    1.4k GitHub stars~2.9k tokensUpdated 12 days ago
    Auto-check passed
  • AI Behavior Trees Utility AI

    gamedev-skills/awesome-gamedev-agent-skills

    Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators) and a Utility AI system (response curves — linear, exponential…

    1.4k GitHub stars~2k tokensUpdated 12 days ago
    Auto-check passed
  • Bevy Ecs

    gamedev-skills/awesome-gamedev-agent-skills

    Structure a Bevy app around its Entity Component System: build the App with plugins, define Component/Resource types, write systems with Query/Res/Commands, filter and order systems, and use the…

    1.4k GitHub stars~2k tokensUpdated 12 days ago
    Auto-check passed
  • Card Game

    gamedev-skills/awesome-gamedev-agent-skills

    Build a card game: card data, deck/hand/discard zones, draw/shuffle/reshuffle, a turn structure, costs, and effect resolution.

    1.4k GitHub stars~1.6k tokensUpdated 12 days ago
    Auto-check passed
  • Fps Shooter

    gamedev-skills/awesome-gamedev-agent-skills

    Build a first-person shooter: move+mouse-look controller, hitscan or projectile shooting, weapons, health, and enemy AI.

    1.4k GitHub stars~1.5k tokensUpdated 12 days ago
    Auto-check passed

Questions about Godot Gdscript Headless Testing

What does Godot Gdscript Headless Testing do?

Run GDScript test suites from the command line with godot --headless, using a SceneTree/MainLoop runner script that exits non-zero on failure so CI can gate merges. Godot Gdscript Headless Testing is an agent skill from gamedev-skills/awesome-gamedev-agent-skills. Run GDScript test suites from the command line with godot --headless, using a SceneTree/MainLoop runner script that exits non-zero on failure so CI can gate merges.

When should I use Godot Gdscript Headless Testing?

Godot Gdscript Headless Testing fits situations like: A Godot project needs unit tests without opening the editor; wiring a CI job (GitHub Actions; similar) that must fail the build on a failing .gd test; A godot --headless invocation hangs.

How do I install Godot Gdscript Headless Testing in Claude Code?

Run `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-gdscript-headless-testing -a claude-code`. Or copy the skill folder (skills/godot/godot-gdscript-headless-testing in gamedev-skills/awesome-gamedev-agent-skills) into .claude/skills/godot-gdscript-headless-testing in your project. Claude Code loads it when a task matches its description.

How do I install Godot Gdscript Headless Testing in Codex?

Run `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-gdscript-headless-testing -a codex`. Or copy the skill folder (skills/godot/godot-gdscript-headless-testing in gamedev-skills/awesome-gamedev-agent-skills) into .agents/skills/godot-gdscript-headless-testing in your project. Codex loads it when a task matches its description.

Can I use Godot Gdscript Headless Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-gdscript-headless-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/godot-gdscript-headless-testing, .gemini/skills/godot-gdscript-headless-testing, .github/skills/godot-gdscript-headless-testing and .opencode/skills/godot-gdscript-headless-testing in your project.

What does Godot Gdscript Headless Testing need to run?

SKILL.md names no scripts, command-line tools or credentials: Godot Gdscript Headless Testing is instructions for the agent only.

Does Godot Gdscript Headless Testing access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Godot Gdscript Headless Testing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Godot Gdscript Headless Testing use?

Godot Gdscript Headless Testing is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Godot Gdscript Headless Testing use?

About 2.3k tokens (SKILL.md is roughly 9.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Godot Gdscript Headless Testing?

Skills that share tags, products or a category with Godot Gdscript Headless Testing: Export Pipeline (jame581/GodotPrompter, 799 stars), Scenario Godot Pipeline Automation (scenario-labs/skills, 931 stars), Godot Export Builds (thedivergentai/GD-Agentic-Skills, 816 stars) and Godot Gdscript Patterns (925236118/AlphaAgent, 103 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Godot Gdscript Headless Testing?

gamedev-skills (a GitHub organization) maintains it in gamedev-skills/awesome-gamedev-agent-skills, which has 1,370 GitHub stars. The repository holds 53 skills in this directory. The repository was last updated on September 27, 2026.

Source: gamedev-skills/awesome-gamedev-agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.