From godot-ai-builder
MCP tool operations: run game, read errors, reload filesystem, iterate fixes. Use when testing, debugging, or running the build-test-fix loop. This is the "DevOps" skill for AI game generation. CRITICAL: Always use MCP tools, never raw curl. Always report progress.
npx claudepluginhub hubdev-ai/godot-ai-builderThis skill uses the workspace's default tool permissions.
Use `godot_reload_filesystem`, `godot_run_scene`, `godot_get_errors`, etc.
Provides persistent godot-mcp and AI Bridge workflows for Godot 4.x projects, handling .tscn/.gd/.gdshader/.tres files and live editor tasks like scene inspection, node edits, refresh/run/test loops, runtime diagnostics, hybrid validation.
Provides specialized guidance for Godot Engine projects: .gd, .tscn, .tres file formats, component-based patterns, signals, resources, debugging, validation tools, templates, and CLI workflows.
Assists Godot Engine game development with scene creation, node management, GDScript scripting, project structure. Uses MCP tools to edit scenes, add nodes, run projects, debug.
Share bugs, ideas, or general feedback.
Use godot_reload_filesystem, godot_run_scene, godot_get_errors, etc.
NEVER use raw curl http://localhost:6100/... — that bypasses MCP and means the plugin isn't loaded.
If MCP tools aren't available, stop and tell the user:
"MCP tools not available. Start Claude Code with:
claude --plugin-dir /path/to/godot-ai-builder"
The Godot dock panel is the user's PRIMARY progress monitor. You MUST call godot_log before and after EVERY action — no exceptions. If you don't log, the user sees nothing happening and thinks the build is broken.
After EVERY action, report in TWO places:
godot_log so the Godot editor panel shows activitygodot_log("Reloading Godot filesystem...")
godot_log("Running game... checking for errors...")
godot_log("Found 2 errors. Fixing scripts/player.gd line 34...")
godot_log("✓ Error fixed. Retesting...")
godot_log("Game running. 0 errors. Phase 1 complete.")
Rules:
godot_log BEFORE and AFTER every file write, every test, every error fixgodot_log between every 2-3 other tool callsgodot_update_phase at every phase start (in_progress) and end (completed)godot_log calls per file write minimumThinking... narratives.STALLED: <exact blocker> and stop instead of looping.After writing ANY game files, ALWAYS execute this loop immediately:
1. godot_reload_filesystem → Editor sees new files
2. godot_run_scene → Launch the game
3. (wait a moment)
4. godot_get_errors → Check for problems
5. If errors: fix → go to 1
6. If clean: done!
Call FIRST before any work. Returns:
editor_connected (bool) — is Godot running with plugin?project_name, main_scenefiles.scripts[], files.scenes[], files.assets[]Call after writing ANY file. The editor won't see changes until you do this.
Run the game. Optional scene_path argument for a specific scene.
{"scene_path": "res://scenes/main.tscn"}
Or omit for main scene:
{}
Stop a running game. Call before running again.
Returns:
{
"errors": [{"message": "...", "file": "res://...", "line": 42}],
"warnings": [{"message": "...", "file": "res://...", "line": 10}]
}
Parse a .tscn file to understand its structure:
{"scene_path": "res://scenes/main.tscn"}
Generate placeholder sprites:
{"name": "player", "type": "character", "width": 32, "height": 32, "color": "#3399ff"}
List all project files (works without editor running).
Read from project.godot:
{"key": "application/run/main_scene"}
List curated add-ons from the internal catalog:
{}
Optional filter:
{"category": "polish_camera"}
Install a catalog add-on (PoC baseline: Phantom Camera):
{"addon_id": "phantom_camera"}
Verify required add-on files/signals:
{"addon_id": "phantom_camera"}
Apply curated pack with strict fail-loud behavior:
{"pack_id": "pack_polish", "strict": true}
If this returns rejected: true, treat it as a hard blocker and fix integration before phase completion.
Score a PoC run and enforce iteration policy:
{
"benchmark_id": "poc_prompt_01",
"iteration_count": 2,
"max_iterations": 3,
"hard_gates": {"zero_script_errors": true, "no_critical_warnings": true, "play_loop_complete": true, "controls_clear": true, "no_soft_lock": true, "quality_gates_passed": true},
"anti_tutorial_visual_checks": {"named_art_direction": true, "palette_discipline": true, "silhouette_readability": true, "layering_depth": true, "feedback_clarity": true, "ui_theme_consistency": true, "no_raw_placeholder_feel": true},
"scores": {"core_loop_fun": 4, "controls_game_feel": 4, "progression_variety": 4, "encounter_depth": 3, "visual_polish_cohesion": 4, "ux_onboarding_feedback": 4},
"signature_moments": ["moment_1", "moment_2"]
}
Use verdict output:
go: quality target metneeds_iteration: fix next_actions and rerunno_go: max iterations reached, escalate to userSend a message to the Godot dock panel. This is the user's ONLY way to see your progress in the Godot editor. You MUST call this tool constantly — before and after every file write, every test, every error fix, every decision, every phase transition. Aim for 3-5 calls per file write minimum.
{"message": "Writing scripts/player.gd — WASD movement, mouse aim, shooting..."}
{"message": "✓ scripts/player.gd written — 85 lines"}
{"message": "ERROR in main.gd:15 — GameManager not found"}
{"message": "FIX: Registering GameManager autoload..."}
{"message": "✓ Error fixed. 0 errors remaining."}
Sub-agents should prefix with their name: "[Agent: enemies] Writing enemy.gd..."
godot_get_errors() now returns detailed error messages with file paths, line numbers, and
actual error text via headless Godot validation. Always use these details to fix errors precisely.
Error Fix Protocol:
1. errors = godot_get_errors() // Returns detailed messages with file + line
2. For each error:
a. Read ONLY the specific lines around error.line (not the whole file)
b. The error.message tells you EXACTLY what's wrong
c. Fix the specific issue on that line
d. Do NOT rewrite the whole file unless the error is architectural
3. godot_reload_filesystem()
4. errors = godot_get_errors() // Verify fix
5. Repeat until zero errors
Key principle: Fix errors surgically. Read 5-10 lines around the error, not the whole file. Rewriting a whole file to fix one typo is wasteful and introduces new bugs.
| Error Message | Cause | Fix |
|---|---|---|
Identifier "X" not found in base | Missing autoload, wrong class name, or typo | Check autoload registration in project.godot, verify class_name spelling |
Invalid operands "X" and "Y" | Type mismatch (int vs float, String vs int) | Cast types explicitly: float(x), str(x), int(x) |
Parser Error: Expected "X" | Syntax error — missing colon, bracket, paren | Check line for missing : after if/for/func, unmatched brackets |
Cannot load source code from "X" | File path wrong or file doesn't exist | Verify the .gd file exists at that path, check for typos in path |
Cyclic reference in "X" | Two scripts import each other | Remove circular dependency — use signals or a shared autoload instead |
Could not find type "X" in base "Y" | Using a class that hasn't been loaded or doesn't exist | Add class_name to the target script, or use load() to get the class |
Function "X" not found in base "Y" | Calling a method that doesn't exist on that type | Call godot_get_class_info("Y") to check correct method names |
Too few arguments for "X" | Missing required parameters in method call | Call godot_get_class_info to check correct method signature |
Signal "X" not found | Connecting to a signal that doesn't exist | Check signal name spelling, verify the signal is declared in the class |
Cannot use "X" as a function | Using a property as a function or vice versa | Check if X is a property (access without ()) or method (call with ()) |
Unexpected "Identifier" in class body | Code outside of a function at the class level | Move the code inside a function (_ready(), _process(), etc.) |
The default value is incompatible with type | Default parameter type doesn't match declaration | Fix the type annotation or the default value |
When an autoload or base class has an error, ALL scripts that reference it will also show errors. This is the most common source of "10 scripts all broken" situations.
How to identify: Multiple scripts show the same error about a missing identifier that
matches an autoload name (e.g., GameManager, AudioManager).
Fix protocol:
godot_reload_filesystem() + godot_get_errors()Cause: Script uses preload() for a file that doesn't exist yet.
Fix: Replace preload() with load() in the script.
Cause: Calling a method that doesn't exist on that node type.
Fix: Check the node type. Call godot_get_class_info("Y") to get correct API. Common mistake: calling physics methods on wrong body type.
Cause: Using a variable/function that doesn't exist. Fix: Check spelling, check if it's defined in the right scope, check imports. If X is an autoload, verify it's in project.godot [autoload] section.
Cause: Malformed .tscn file.
Fix: Check load_steps count, parent paths, quote formatting.
Better: Rewrite as programmatic scene (script builds nodes in _ready()).
Cause: $NodeName references a node that doesn't exist in the tree.
Fix: Either the node isn't created yet (use @onready or build in _ready()), or it has a different name. Call godot_get_scene_tree() to verify actual node names.
Cause: Layer/mask mismatch.
Fix: Use set_collision_layer_value() and set_collision_mask_value() to be explicit. Check:
After generating a game, always set the main scene:
Via project.godot (edit the file directly):
[application]
run/main_scene="res://scenes/main.tscn"
Via MCP: The godot_reload_filesystem will pick up the change.
Before running:
extends (CharacterBody2D, Area2D, Node2D, etc.)load() paths point to files that exist"player", "enemies", etc.)godot_reload_filesystem was calledIf godot_get_project_state shows editor_connected: false:
godot_scan_project_files still works (reads filesystem)godot_parse_scene still works (reads .tscn files)godot_generate_asset still works (creates SVG/PNG files)godot_run_scene, godot_stop_scene, godot_get_errors, godot_reload_filesystem will failTell the user: "Please open the Godot editor and enable the AI Game Builder plugin, then try again."