| name | godot-builder |
| description | Expert-level toolkit for modular Godot 4.x CLI automation and headless build orchestration. Use this skill when you need to: (1) Build complex scene trees or UI layouts programmatically, (2) Automate expert 3D asset pipelines (glTF -> Collision), (3) Optimize procedural geometry headlessly (CSG -> Static Mesh), or (4) Engineer production-grade CI/CD pipelines with engine module stripping and delta patching. |
Godot Builder Skill
The godot-builder skill provides an expert-grade foundation for programmatic game development and headless automation using the Godot 4.6.1-stable CLI.
Expert Automation Mindset
- Headless Isolation via XDG: When running multiple concurrent Godot instances, always override
XDG_DATA_HOME and XDG_CONFIG_HOME to prevent cache corruption between instances.
- Cache Invalidation (Force Import): Programmatically delete the
.godot/imported/ directory to force the engine to re-evaluate modified global import settings.
- Explicit Ownership: Scene nodes MUST have their
owner property set to the scene root, or they will be discarded during serialization.
- Latency-Sensitive Multi-threading: GPU interactions (textures, image data) must stay on the main thread to avoid pipeline stalls and deadlocks.
Hardened Anti-Patterns (NEVER List)
- NEVER save runtime-generated UIDs headlessly;
ResourceSaver.save() does NOT serialize UIDs in headless mode. Invoke godot -e --headless --import as a post-process.
- NEVER use
Resource.duplicate(true) in Godot 4.4+; use duplicate_deep(Resource.DEEP_DUPLICATE_ALL) to prevent procedural state-bleed.
- NEVER hardcode
.tscn or .tres extensions; always load via uid:// or without extensions to avoid failures in exported binary builds.
- NEVER execute GPU-bound calls on secondary threads. Use
RenderingServer.call_on_render_thread().
- NEVER enable the Shader Baker for Dedicated Server builds; the headless backend ignores it.
- NEVER call
ResourceUID.set_id() without calling has_id() first; it causes a fatal CLI crash.
- NEVER skip
RenderingServer.canvas_item_reset_physics_interpolation() when programmatically moving low-level CanvasItems on their first frame; failure causes visual desync between rendering and physics systems.
Expert Automation Workflows
Workflow #1: The Hardened 3D Asset Pipeline
Purpose: Automates the ingestion of raw 3D assets into production-ready scenes with accurate physics collisions.
- Sequence:
gltf_processor.py -> collision_generator.py -> save_scene.py.
- Expert Defense: Sets explicit
owner for every node. Forces a final headless import to fix the missing UID serialization.
Workflow #2: Procedural Level Optimization & 4.4+ Scaling
Purpose: Generates optimized procedural level chunks without shared resource state corruption between instances.
- Sequence:
csg_optimizer.py -> duplicate_deep(ALL) -> navmesh_baker.py.
- Expert Defense: Uses
duplicate_deep to isolate materials/resources. Bakes CSG to static geometry before triggering NavMesh pathfinding.
Workflow #3: Production CI/CD & Force-Import Validation
Purpose: Validates cross-platform builds and ensures global project settings (VRAM compression) are strictly applied.
- Sequence:
rm -rf .godot/imported -> test_runner.py -> profile_generator.py -> ci_exporter.py.
- Expert Defense: Forces full re-import to validate asset compression. Isolates CI runs via XDG variables. Injects secure keystore paths from environment variables.
Automation & CI/CD Pipelines (Godot 4.6)
Professional Godot building requires a "Zero-Touch" philosophy for assets and binary exports.
1. Programmatic Asset Re-import
- NEVER manually select 500 textures to change their compression.
- Use
ConfigFile to mutate .import files and EditorFileSystem.reimport_files() to trigger a batch update on the main thread safely.
2. Orphan Asset Detection (Slop Scan)
- NEVER trust
res:// is clean. Over time, deleted scenes leave behind orphaned textures and sounds that bloat the final build.
- Use
ResourceLoader.get_dependencies() to recursively trace exactly which assets are linked to your "Main Scene" and flag anything else as slop.
3. Headless CI/CD Context
- Use
--headless --script for versioning tasks (mutating export_presets.cfg) before running the final --export-release.
- Tip: Always call
quit() at the end of a headless script, or your CI runner will hang indefinitely.
Full Modular Skill Index (25 Scripts)
Project & Process Management
- launch_editor.py: Opens the Godot visual editor for the project.
- run_project.py: Launches the game project in debug or release mode.
- get_debug_output.py: Captures and redirects engine logs to the terminal.
- stop_project.py: Safely terminates a running Godot instance via its PID.
- get_godot_version.py: Retrieves the specific engine version and build info.
- list_projects.py: Recursively scans directories to identify Godot project roots.
- get_project_info.py: Parses
project.godot to retrieve metadata (display, features).
- ci_exporter.py: Orchestrates multi-platform release exports headlessly.
- ci_export_prepper.gd: Headless versioning script for
export_presets.cfg.
- profile_generator.py: Generates feature profiles for module-stripping optimization.
Scene & Dynamic Building
- create_scene.py: Programmatically creates new
.tscn resource files.
- add_node.py: Instantiates and appends nodes to an existing scene tree.
- load_sprite.py: Dynamically assigns and configures textures for Sprite2D nodes.
- save_scene.py: Safely packs and persists the current node tree to disk.
- gltf_processor.py: Headlessly converts raw
.glb/.gltf assets into Godot Scenes.
- csg_optimizer.py: Bakes procedural CSG boolean operations into static meshes.
- tilemap_generator.py: Procedurally builds TileMapLayer grids from JSON data.
- ui_assembler.py: Constructs complex GUI layouts from standardized JSON structures.
- navmesh_baker.py: Executes asynchronous headless NavMesh pathfinding baking.
- collision_generator.py: Generates
ConcavePolygonShape3D physics from mesh data.
- orphan_asset_scanner.gd: Recursive dependency tracer for identifying unused resources.
Automation & Utilities
- get_uid.py: Retrieves the
uid:// identifier for a specific resource path.
- update_project_uids.py: Re-scans and synchronizes all project resource UIDs.
- config_compiler.py: Compiles JSON/CSV data into optimized
.cfg config files.
- import_automator.py: Programmatically configures import settings for directory batches.
- asset_reimport_utility.gd: Expert batch re-importer for enforcing project-wide settings.
- test_runner.py: Executes headless unit and integration tests (GUT/doctest).
- export_mesh_library.py: Converts 3D scenes into
.meshlib resources for GridMaps.