godot-fundamentals
Skill2 starsChanged 4 months agoMITView on GitHub
Godot 4.x nodes, scenes, resources, Input Map, project setup, and editor workflow. Use when creating or repairing foundational Godot projects, composing scene trees, instantiating PackedScenes, defining custom Resources, configuring input actions, or debugging node lifecycle and project settings.
In this repository14 other files it gives its agents.
- game-balanceSkill
- game-design-vocabularySkill
- gamedev-mathSkill
- game-mechanics-designSkill
- game-systems-designSkill
- godot-2d-gameplaySkill
- godot-3d-gameplaySkill
- godot-desktop-appsSkill
- godot-game-architectureSkill
- godot-mobileSkill
- godot-navigation-aiSkill
- godot-procedural-generationSkill
- godot-programming-patternsSkill
- godot-uiSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. About 0 are common, 11 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 16
Use this skill for:
- Very specific: line 31
Read config/features and existing tooling to determine the exact Godot 4.x version.
- Very specific: line 36
Never edit generated .godot/ import/cache contents.
- Very specific: line 38
If there is no project.godot, ask whether to initialize a project before creating Godot-specific files.
- Distinctive: line 47
Use named Input Map actions rather than physical key constants.
- Distinctive: line 49
Test the edited scene in isolation, then run the project entry scene.
- Very specific: line 56
Use Node2D for a transformable 2D grouping root, Node3D for 3D, Control for layout-driven UI, and plain Node for non-spatial coordination …
- Distinctive: line 59
Add an instance to the tree before assigning a world-space transform that depends on its parent.
- Very specific: line 60
Prefer queue_free() during normal scene-tree callbacks.
- Distinctive: line 82
Use a resource for data that benefits from Inspector editing, reuse, or serialization independent of a live scene node.
- Very specific: line 83
Use an external .tres when several scenes should share the same definition.
- Very specific: line 85
Use preload() for a fixed dependency known when the script is parsed.
- Distinctive: line 86
Use stable identifiers in data that may later be persisted.
- Very specific: line 92
Use _process() for frame-driven presentation that is not physics-dependent.
- Distinctive: line 111
Prefer an exported typed reference when a designer should wire the dependency.
- Very specific: line 112
Use %StableName only when the node is explicitly marked as scene-unique.
- Very specific: line 113
Use a short $Child/Path for private, stable children owned by the same scene.
- Distinctive: line 114
Do not repeatedly search the whole tree in frame callbacks.
- Distinctive: line 115
Do not make a brittle relative path cross reusable-scene boundaries.
- Distinctive: line 119
Use the executable and commands already established by the project.
- Distinctive: line 130
Every new Input Map action exists and each intended device binding works.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Godot Fundamentals
Build on the project's existing Godot conventions instead of imposing a starter-project layout.
Scope
Use this skill for:
- Choosing and arranging
Node,Node2D,Node3D, andControldescendants. - Creating reusable scenes and instantiating
PackedSceneresources. - Defining and assigning built-in or custom
Resourcedata. - Adding typed GDScript to scene nodes and using lifecycle callbacks correctly.
- Configuring named input actions and selecting an input callback.
- Working with the Scene, FileSystem, Inspector, Output, Debugger, and Remote scene tree.
- Diagnosing basic project, import, node-path, transform, and scene-run problems.
Do not use this skill to introduce SOLID refactors, event architectures, commands, or object pools; use the programming-patterns skill. Do not use it to decide global state ownership, manager lifetimes, scene routing, or save boundaries; use the game-architecture skill. Keep genre-specific gameplay and advanced rendering out of scope.
Inspect Before Editing
- Locate
project.godot; do not assume the current directory is the project root. - Read
config/featuresand existing tooling to determine the exact Godot 4.x version. Avoid APIs introduced after that version. - Inspect
[application],[autoload],[input],[display], and relevant[rendering]settings before changing project configuration. - Inspect nearby
.gd,.tscn,.tres, and.resfiles. Match folder layout, naming, indentation, static-typing level, node naming, and signal-connection style. - Map the affected scene tree: root type, parent-child ownership, instantiated subscenes, editable children, exported references, unique-name nodes, and local versus global transforms.
- Find the project's normal run, test, lint, and formatting commands. Run a baseline when practical.
- Never edit generated
.godot/import/cache contents. Change source assets or import settings instead.
If there is no project.godot, ask whether to initialize a project before creating Godot-specific files.
Implementation Workflow
- State the behavior in one observable sentence.
- Select the narrowest built-in node whose behavior matches the requirement.
- Decide whether the unit is a node, a reusable scene, or data in a resource.
- Build the scene hierarchy before writing code that depends on it.
- Expose designer-owned values with typed
@exportproperties; cache stable child references with typed@onreadyproperties. - Use named Input Map actions rather than physical key constants.
- Implement the smallest typed script that completes the behavior.
- Test the edited scene in isolation, then run the project entry scene.
Core Decisions
Nodes and scenes
- Choose by behavior first: a visible texture does not automatically make the root a
Sprite2D, and a clickable object does not automatically need a physics body. - Use
Node2Dfor a transformable 2D grouping root,Node3Dfor 3D,Controlfor layout-driven UI, and plainNodefor non-spatial coordination local to a scene. - Make a scene when a node branch has an independent identity, is reused, or benefits from isolated testing.
- Let the nearest scene owner add and remove runtime children. Avoid attaching ordinary gameplay nodes directly to
SceneTree.root. - Add an instance to the tree before assigning a world-space transform that depends on its parent.
- Prefer
queue_free()during normal scene-tree callbacks. Treat every stored node reference as invalid after its owner is freed.
extends Node2D
@export var pickup_scene: PackedScene
@onready var pickups: Node2D = %Pickups
func spawn_pickup(at: Vector2) -> void:
if pickup_scene == null:
push_error("Assign Pickup Scene before spawning a pickup.")
return
var pickup := pickup_scene.instantiate() as Node2D
if pickup == null:
push_error("The configured pickup scene must have a Node2D root.")
return
pickups.add_child(pickup)
pickup.global_position = atResources
- Use a resource for data that benefits from Inspector editing, reuse, or serialization independent of a live scene node.
- Use an external
.treswhen several scenes should share the same definition. Keep a built-in subresource when the data belongs only to one scene or resource. - Assume resources are shared references. Do not put per-instance mutable state in a shared definition resource.
- Use
preload()for a fixed dependency known when the script is parsed. Useload()or threaded loading only when the path is selected at runtime. - Use stable identifiers in data that may later be persisted; display names and file paths are poor identities.
Input and callbacks
- Poll held actions in
_physics_process()for physics movement. - Handle discrete gameplay events in
_unhandled_input()when UI should get the first chance to consume them. - Use
_process()for frame-driven presentation that is not physics-dependent. - Multiply manual rates by
delta. Do not multiplyCharacterBody2D.velocitybydeltabeforemove_and_slide()because velocity is already expressed per second. - Prefix an intentionally unused callback argument with
_.
extends CharacterBody2D
@export_range(0.0, 1200.0, 1.0) var speed: float = 240.0
func _physics_process(_delta: float) -> void:
var direction := Input.get_vector(
&"move_left", &"move_right", &"move_up", &"move_down"
)
velocity = direction * speed
move_and_slide()Node references
- Prefer an exported typed reference when a designer should wire the dependency.
- Use
%StableNameonly when the node is explicitly marked as scene-unique. - Use a short
$Child/Pathfor private, stable children owned by the same scene. - Do not repeatedly search the whole tree in frame callbacks.
- Do not make a brittle relative path cross reusable-scene boundaries.
Verification
Use the executable and commands already established by the project. When no project command exists, a detected Godot executable can perform a basic import and parse check with a command such as:
godot --headless --editor --path <project-root> --quitThen verify all relevant behavior:
- The editor imports without parser, missing-resource, or invalid-node warnings.
- The affected scene runs with
F6-equivalent behavior and does not rely accidentally on the main scene. - The full project runs from its configured main scene.
- Every new Input Map action exists and each intended device binding works.
- Local and global transforms remain correct after instantiation and reparenting.
- Exported resources and node references are assigned in every scene instance.
- The Output and Debugger panels remain free of new errors.
- The Remote scene tree shows instances under the intended owner and they leave the tree when expected.
- Existing automated tests still pass.
Report the exact checks run and any editor-only checks that could not be automated.
Failure Modes
- Scene works only from the main project: the reusable scene reaches outside its ownership boundary. Export the dependency or provide an explicit setup method.
Node not found: a path, unique-name flag, or scene hierarchy changed. Inspect the actual.tscn; do not guess a replacement path.- Action appears inert: the action is absent or misspelled in the Input Map, UI consumed the event, or the node's process mode is disabled or paused.
- Instances change each other: mutable state was stored in a shared resource. Move runtime state to the instance or duplicate the resource intentionally.
- Wrong position after spawning: local and global coordinates were mixed, or the transform was set before parenting.
- Child access is null: access happened before
_ready(), the child is optional, or the script is attached to a different scene shape. - Physics differs by frame rate: movement used
_process()or applieddeltainconsistently. - Editor shows stale assets: source import settings were bypassed or generated cache files were edited.
References
- Nodes, scenes, and resources
- Typed GDScript and input
- Editor and debugging workflow
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

