Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

godot-nodes-scenes — Claude Code skill: what it does, how to install

Teaches the agent to build a Godot 4.7 project from nodes and scenes: reusable .tscn files, runtime instancing, autoload singletons, and node lookups that survive renames.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-nodes-scenes -a claude-code
Open on GitHub

What godot-nodes-scenes does

The skill tells the agent how to build a Godot 4.7 game out of nodes and scenes instead of a tall inheritance chain. Small scenes such as Player, Bullet or Enemy get a script on the root plus @export fields, and the bigger scenes are assembled from them. A runtime instance comes from preload → instantiate() → add_child(), with position and state set along the way.

Two files ship with it: references/tree-and-instancing.md on scene inheritance, owner and groups, and scripts/check_godot_project.py. That script walks the project and flags broken or wrong-case res:// paths, undeclared ExtResource and SubResource ids, bad parent= values and a missing main scene. Run python scripts/check_godot_project.py <project-dir>; add --json for machine-readable output. It wants Python 3.10+ and no Godot install.

The target is Godot 4.7, so the instantiate() and change_scene_to_file() advice does not carry over to a Godot 3 codebase — check the engine version before the agent starts editing. The checker is also no substitute for opening the project: an error that only shows up when a scene runs will slip past it.

What it helps with

  • split a feature into its own scene instead of growing one node script
  • spawn bullets or enemies with instantiate() and set their state right after
  • drop a brittle $Path for a %Name lookup that survives renaming
  • keep score and audio in an autoload every scene can reach
  • catch broken res:// paths before the editor is opened

Example prompts for the agent

  • Make a `Bullet.tscn` with an `@export` speed and spawn it from the player via `instantiate()`
  • I want score and audio in a `GameState` autoload — show me where to register it and how a scene connects to it
  • `get_node("UI/Label")` returns `null`; walk through it with the `godot-nodes-scenes` skill

How to install godot-nodes-scenes

1Skills CLI (Vercel)

npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-nodes-scenes -a claude-code

2Manually: put the files in place

~/.claude/skills/godot-nodes-scenes/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/godot-nodes-scenes/

From the same set40

The whole set →
game-feel gamedev-skills Teaches the agent to add feedback to game actions: camera shake, hit-stop, eased tweens, squash and stretch, knockback. For mechanics that work but feel weightless. Claude Code CX Codex Cursor +1 9,400installs game-ui-ux gamedev-skills Engine-neutral game UI architecture skill for responsive layouts, screen stacks, gamepad focus, and event-driven HUD updates. Claude Code CX Codex Cursor +1 9,200installs level-design gamedev-skills Plans playable game levels from blockout through playtesting, covering routes, pacing, gates and encounters. Use it when working on whiteboxes, critical paths or room flow. Claude Code CX Codex Cursor +1 7,500installs camera-systems gamedev-skills Engine-neutral patterns for 2D and 3D game cameras: smooth follow, deadzones, look-ahead, bounds clamping, and third-person collision. Claude Code CX Codex Cursor +1 7,100installs audio-design gamedev-skills A skill that treats game audio as a mixer graph: buses, gain in decibels, sidechain ducking, adaptive music and beat-synced events. Samples use Godot 4.7, Unity gets notes. Claude Code CX Codex Cursor +1 7,100installs performance-optimization gamedev-skills A skill that turns “the game runs slow” into a measured bottleneck and a specific fix: profile first, then pool objects, batch draw calls, cut allocations. Claude Code CX Codex Cursor +1 7,100installs game-ai gamedev-skills Designs NPC decision-making, behavior trees, steering forces, and A* pathfinding. Useful when building game enemy logic across engines. Claude Code CX Codex Cursor +1 7,100installs input-systems gamedev-skills Engine-neutral input system: map keys to named actions, rebinding with conflict detection, keyboard, gamepad and touch support, analog deadzones, input buffering and coyote time. Claude Code CX Codex Cursor +1 6,800installs

Similar

game-automation rehan-remade Launches games, captures GPU-rendered windows, and simulates mouse and keyboard input. Helps an agent verify mods directly inside a running game on Windows and WSL. Claude Code CX Codex Cursor +1 1,500installs reverse-engineering rehan-remade Lets the agent read a game from the inside: decompiled code, dumped asset formats, live memory. Useful when a mod needs an exact function address or the layout of a file. Claude Code CX Codex Cursor +1 1,500installs mod-any-game rehan-remade PC game modding skill that takes an idea from engine reconnaissance and save backups to asset pipelines and in-game testing. Claude Code CX Codex Cursor +1 1,500installs orbit-card heygen-com Adds a 10-second 1920×1080 HyperFrames motion block where a single feature card orbits a dot sphere using exported Blender camera paths. Claude Code CX Codex Cursor +1 9,800installs sdf earthtojake This skill authors and validates SDFormat files for models and worlds, then helps prepare them for simulator handoff. Claude Code CX Codex Cursor +1 10,500installs urdf earthtojake This skill helps create, validate, and debug URDF robot descriptions. Use it when working with links, joints, geometry, meshes, or inertial data. Claude Code CX Codex Cursor +1 10,400installs hatch-pet official openai Creates and packages animated pets and spritesheets for Codex. Use it to turn a character concept, reference image, or brand cues into a pet. Claude Code CX Codex Cursor +1 3,300installs gcode earthtojake Slices STL, 3MF, and OBJ models into printer-ready G-code through OrcaSlicer. Use it when you need a print file without connecting to the printer. Claude Code CX Codex Cursor +1 9,500installs

Questions about godot-nodes-scenes

How do I install godot-nodes-scenes in Claude Code?

Run npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-nodes-scenes -a claude-code. The skill lands at ~/.claude/skills/godot-nodes-scenes/SKILL.md.

What does godot-nodes-scenes do?

It gives the agent rules for the Godot node tree: composing scenes instead of deep inheritance, instancing a PackedScene, safe node access, autoloads, and freeing nodes with queue_free().

What do I need to run the project checker?

Python 3.10+ is enough; Godot does not have to be installed to run scripts/check_godot_project.py. It still does not replace opening the project in the editor.

Source text

SKILL.md · Apache-2.0
---
name: godot-nodes-scenes
description: >
  Structure a Godot 4.7 project with the scene tree and node composition: build
  reusable scenes, instance PackedScenes at runtime, navigate the tree safely,
  and register autoload singletons. Use when designing .tscn scenes, deciding how
  to split nodes, spawning instances with instantiate(), wiring autoloads, or
  fixing "node not found"/freed-node errors in a Godot project.
---

# Godot Nodes & Scenes (4.x)

Compose games from nodes and scenes, instance them at runtime, and access the tree
without crashing on freed or missing nodes. Targets **Godot 4.7**.

## When to use

- Use when structuring `.tscn` scenes, choosing how to break a feature into nodes,
  instancing a `PackedScene` (bullets, enemies, UI), or setting up autoload singletons.
- Use when debugging `get_node()` / `$Path` returning `null`, or "Attempt to call on a
  previously freed instance".

**When _not_ to use:** GDScript language/syntax → `godot-gdscript`; signal-based
decoupling → `godot-signals-groups`; physics bodies/collisions → `godot-physics`.

## Core workflow

1. **Model with composition.** A scene is a tree of nodes saved as `.tscn`. Build small,
   single-purpose scenes (Player, Bullet, Enemy) and compose larger scenes from them.
   Favor adding child nodes over deep inheritance.
2. **Make a scene reusable** by giving its root a script and exposing `@export` config.
   Save it; it becomes a `PackedScene` you can instance many times.
3. **Instance at runtime** with `preload`/`load` → `scene.instantiate()` →
   `add_child(instance)`. Set position/state _after_ adding (or before, both work).
4. **Access nodes safely.** Use `@onready var x = $Path` for fixed children; use unique
   names (`%Name`) for nodes deep in the tree; never assume a node still exists.
5. **Use autoloads for global state/services** (game state, audio, scene switching) —
   registered in Project Settings > Globals (Autoload), accessible by name everywhere.
6. **Free nodes with `queue_free()`** and guard later access with `is_instance_valid()`.
7. **Check references before you finish.** After creating, moving or renaming scenes,
   resources or scripts, run `python scripts/check_godot_project.py <project-dir>` (no
   Godot install needed; `--json` for machine-readable output). Fix every `ERROR` (missing
   or wrong-case `res://` paths, undeclared `ExtResource`/`SubResource` ids, bad `parent=`
   paths, missing main scene or autoload) and re-run until it exits 0. Warnings such as a
   stale `path=` that Godot still finds by uid are safe but worth fixing. Run the script
   path relative to this skill directory, or resolve the installed skill path first. It
   needs Python 3.10+ and nothing else, and it does not replace opening the project in Godot.

## Patterns

### 1. Instance a scene at runtime

```gdscript
extends Node2D

const BULLET := preload("res://bullet.tscn")   # preload: loaded at compile time

func shoot(at: Vector2, dir: Vector2) -> void:
    var bullet := BULLET.instantiate()         # create an instance of the scene
    bullet.global_position = at
    bullet.direction = dir                      # set exported/public state
    add_child(bullet)                           # now it's in the tree and runs
```

### 2. Safe node access: $, get_node_or_null, and unique names

```gdscript
@onready var label: Label = $UI/Label            # $ is sugar for get_node("UI/Label")
@onready var health_bar: ProgressBar = %HealthBar # % = scene-unique name (rename-proof)

func update() -> void:
    var optional := get_node_or_null("Maybe/Missing")  # returns null instead of erroring
    if optional:
        optional.queue_free()
```

### 3. An autoload singleton (global game state)

```gdscript
# game_state.gd — add in Project Settings > Globals > Autoload as "GameState".
extends Node

var score := 0
signal score_changed(value: int)

func add_score(points: int) -> void:
    score += points
    score_changed.emit(score)         # any scene can: GameState.score_changed.connect(...)
```

### 4. Change the running scene

```gdscript
func go_to_level_2() -> void:
    # Swaps the current scene for another. Frees the old scene tree.
    get_tree().change_scene_to_file("res://levels/level_2.tscn")
    # Or, with a preloaded PackedScene:
    # get_tree().change_scene_to_packed(LEVEL_2)
```

## Pitfalls

- **`$Path` / `get_node()` return `null` or error** when the path is wrong or the node
  isn't in the tree yet. Use `@onready`, verify the path matches the scene, or use
  `get_node_or_null()` for optional nodes.
- **Renaming a node breaks `$Path`.** Use **unique names** (`%Name`, set via right-click
  > Access as Unique Name) so deep references survive renames and reparenting.
- **`free()` mid-frame can crash** other code still using the node. Prefer
  `queue_free()` (deletes at end of frame) and check `is_instance_valid(node)`.
- **Setting child state before `add_child()`** is fine, but `_ready()` on the child only
  runs _after_ it enters the tree — don't expect its `@onready` vars before that.
- **Autoload order matters**: autoloads are added before the main scene, in list order.
  An autoload can't depend on the main scene existing yet.
- **`instance()` was renamed** to `instantiate()` in Godot 4. `preload` runs at parse
  time (path must be constant); `load` runs at runtime (path can be a variable).
- **`change_scene_to_file()` is deferred, and the old scene leaves the tree at once.** The
  outgoing scene is removed from the tree immediately (its `get_tree()` now returns `null`,
  and `get_tree().current_scene` is `null`), then at the end of the frame it is freed and the
  new scene is added. Code after the call must not touch `get_tree()` from the old scene. To
  act on the new scene, do it from the new scene's `_ready()`, or from an autoload with
  `await get_tree().scene_changed` (Godot 4.5+). `change_scene_to_node(node)` (4.6+) swaps
  in a node you have already instanced and configured.

## References

- For scene inheritance, `owner`/ownership when saving scenes from code, groups vs
  unique names, and node-path edge cases, read `references/tree-and-instancing.md`.
- `scripts/check_godot_project.py` — read-only reference checker for a Godot 4.x project;
  `--help` lists every check and the exit codes.

## Related skills

- `godot-gdscript` — language, lifecycle, and `@onready`.
- `godot-signals-groups` — decouple instanced scenes from their spawner.
- `godot-resources` — share data between instances without duplicating it.
- `save-systems` — persist scene/game state across runs.

© gamedev-skills · Apache-2.0 · gamedev-skills/awesome-gamedev-agent-skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor