godot-repl

Runs throwaway GDScript snippets headless against the Godot engine and returns printed output.

Updated Apr 22, 2026
One-click install
npx skills add https://github.com/rpmcdougall/claude-skills --skill godot-repl-rpmcdougall
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: godot-repl
Source: https://github.com/rpmcdougall/claude-skills/tree/main/skills/godot-repl
Command: npx skills add https://github.com/rpmcdougall/claude-skills --skill godot-repl-rpmcdougall

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Verifying a small piece of GDScript behavior normally requires writing a full test or launching the editor, which is overkill for quick one-off checks like "what does this function return". This Skill runs a disposable snippet against the engine and reports the result without polluting the test suite. ## Core Features & Use Cases - Headless Snippet Execution: Generates a timestamped tests/scratch_<epoch>.gd file extending SceneTree, runs it with the Godot binary in headless mode, and captures stdout plus the exit code. - Automatic Cleanup: Deletes the scratch file unconditionally after the run so lint hazards and accidental commits never occur. - Platform Detection: Locates the correct Godot binary for the current platform, matching the behavior of the engine-tests skill. - Use Case: Ask "what does types.gd return for an empty dice pool?" and get the printed result and exit code back, with no test file left behind. ## Quick Start Ask the assistant to sanity-check a GDScript function by running a quick snippet against the engine, for example "check what GameEngine.new().get_phases() returns".

Frequently Asked Questions about godot-repl

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a quick GDScript snippet without writing a test?▼

Use this Skill to generate a temporary scratch script extending SceneTree, run it headless with the Godot binary, and read the printed output and exit code. The scratch file is deleted automatically after the run.

How to execute Godot scripts headless from the command line?▼

Invoke the Godot binary with --headless, --path pointing at the project, and -s followed by the script path. The script must extend SceneTree and call quit() when finished so the process exits cleanly.

Does this work with any Godot project or only turnipsim?▼

The workflow is generic Godot headless execution, but the documented paths and preloads target the turnipsim project structure. Other projects would need adjusted paths and module preloads.

When should I write a real test instead of a scratch snippet?▼

Write a proper test when the snippet exceeds roughly 30 lines, when you check the same behavior repeatedly, or when the logic needs regression coverage. Scratch runs are for one-off verification only.

Why does my scratch snippet fail when instantiating Nodes?▼

The project follows a pure-RefCounted contract, so snippets that instantiate Nodes are a design smell and may fail headless. Restructure the check around RefCounted classes or reconsider what is being tested.