godot-gdscript
Skill54 starsChanged 13 days agoMITView on GitHub
Write correct, statically typed GDScript for Godot 4.7 - script layout, typing (typed arrays and dictionaries), signals and await, setters, @export annotations, @abstract and variadic functions, lambdas, match, static members, error fixes, plus a real-engine compile check of all .gd files. Use when writing, reviewing or fixing any .gd file.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- Supra-skills-mdd7/kit-game-devtheir own version, first seen Nov 29, 2026
- gamedev-skills/awesome-gamedev-agent-skillstheir own version, first seen Nov 11, 2026
- Wade-DevCode/awesome-coding-skills-cntheir own version, first seen Nov 8, 2026
- MindsMaster/godot-claude-code-skillstheir own version, first seen Oct 25, 2026
- gosomea/dsh-godot-aitheir own version, first seen Oct 8, 2026
- fetasty/godot-skillstheir own version, first seen May 16, 2026
Used with
Projects with it also use godot-multiplayer, godot-2d-movement and 5 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
gosomeaSkillgodot-multiplayer
设计 Godot 高层多人游戏:authority、RPC、MultiplayerSpawner/Synchronizer、状态复制、延迟与安全边界。
Also in 4 projects that use this
gosomeaSkillgodot-2d-movement
实现 Godot 4.7 的 CharacterBody2D 移动:速度、重力、跳跃、斜坡、coyote time 与输入反馈。制作 2D 玩家控制时使用。
Also in 3 projects that use this
arjun988Skillgodot-export
Godot-specific Blender export favoring GLTF/GLB with correct scale, materials, animation clips, and collision shapes via MCP.
Also in 3 projects that use this
- +4 more from gosomea
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- gamedev-skills/awesome-gamedev-agent-skills★ 9ksame name
- fetasty/godot-skills★ 29same name
- gosomea/dsh-godot-ai★ 9same name
- Wade-DevCode/awesome-coding-skills-cn★ 7same name
- MindsMaster/godot-claude-code-skills★ 3same name
- Supra-skills-mdd7/kit-game-dev★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- godot-2dSkill
- godot-3d-gameplaySkill
- godot-3d-renderingSkill
- godot-addonsSkill
- godot-animationSkill
- godot-architectureSkill
- godot-audioSkill
- godot-coreSkill
- godot-csharpSkill
- godot-editor-toolingSkill
- godot-export-ciSkill
- godot-game-feelSkill
- godot-inputSkill
- godot-migrationSkill
- godot-mobile-webSkill
- godot-modding-dlcSkill
- godot-narrativeSkill
- godot-navigation-aiSkill
- godot-networkingSkill
- godot-performanceSkill
- godot-physicsSkill
- godot-proceduralSkill
- godot-shaders-vfxSkill
- godot-testing-debugSkill
- godot-uiSkill
- godot-xrSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Use snake_case for files, functions and variables, PascalCase for classes and nodes, CONSTANT_CASE for constants and enum values.
- Very specific: line 37
Prefer await get_tree().create_timer(0.5).timeout and await get_tree().process_frame/physics_frame to busy waits.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GDScript (4.7)
Check after every edit: python scripts/gd_check.py [paths] compiles every .gd file with the real engine and returns {file, line, msg} errors. Autoloads and class_names resolve like they do at runtime. Look up any engine API with ../godot-core/scripts/api_lookup.py before you use it.
Script layout (official style guide order)
@tool / @icon / @abstract → class_name → extends → ## doc comment
signals → enums → constants → static vars → @export vars → vars → @onready vars
_static_init → _init → _enter_tree → _ready → _process/_physics_process → other virtuals
public methods → _private methods → inner classesUse snake_case for files, functions and variables, PascalCase for classes and nodes, CONSTANT_CASE for constants and enum values. Indent with tabs. Prefix private members with _.
Typing rules (always typed: safer, and up to ~2x faster)
var speed := 5.0infers the type. Usevar target: Node3Dwhen there's no initializer. Use: Variantonly on purpose.- Typed containers:
Array[Enemy],Dictionary[StringName, int](4.4+). Typed arrays reject wrong element types at runtime. - Give every function a return type, including
-> void. In 4.7, an override of a typed-return method must return on every path. node as Enemyreturnsnullwhen the cast fails, for objects.istests the type. Useis_instance_valid(x)after anyawaitthat might outlivex.- Enforce typing project-wide with
debug/gdscript/warnings/untyped_declaration = 2(Error). Keepinference_on_variantat its default of Error. int / intis integer division. Writefloat(a) / bwhen you mean a fraction.
Signals and await
- Declare typed signals:
signal health_changed(current: int, maximum: int). Emit withhealth_changed.emit(hp, max_hp). - Connect a Callable:
button.pressed.connect(_on_pressed). Add arguments with.bind(id)and one-shot behavior withconnect(f, CONNECT_ONE_SHOT). Avoid string forms likeconnect("x", self, "y"). - Connections made in code don't need manual cleanup when either object is freed. Disconnect explicitly only when you'll reconnect, or when the source is a long-lived autoload and the target is a lambda capturing a freed node.
await sigsuspends the function. The caller gets control back immediately unless it also awaits. Any function containingawaitis a coroutine, so the caller mustawaitit to get its return value.- Prefer
await get_tree().create_timer(0.5).timeoutandawait get_tree().process_frame/physics_frameto busy waits. - "Call down, signal up": parents call methods on children, children emit signals. Cross-scene events go through an autoload event bus (see
godot-architecture).
Language features you should use
- Properties:
var hp: int = 10:followed by an indentedset(value): hp = clampi(value, 0, max_hp), orset = _set_hp. @exportvariants (check them withapi_lookup.py @export_range):@export_range(0, 100, 1, "or_greater"),@export_enum,@export_flags_3d_physics,@export_file("*.json"),@export_group("Movement"),@export_subgroup,@export_category,@export_storage,@export_custom,@export_tool_button("Bake", "Bake")(4.4+).@onready var label: Label = %ScoreLabeluses a scene-unique name (%). That's safer than long$A/B/Cpaths.@abstract class_name Weaponwith@abstract func fire() -> void(4.5+). Variadic arguments:func log_all(...parts: Array) -> void(4.5+).- Lambdas:
var double := func(x: int) -> int: return x * 2. They capture locals by value. Mutate shared state through an Array or Dictionary, or through a member variable. matchhandles literals,[a, b, ..],{"k": v},var xbindings andwhenguards (4.3+).static var/static func,const PRELOADED := preload("res://x.tscn"),&"string_name",^"Node/Path".- Doc comments:
##above members (shown in the editor's help and by--gdscript-docs).
Pitfalls (with fixes)
| Symptom | Cause, then fix |
Invalid access ... on a base object of type 'null instance' | Wrong node path, or used before _ready. Use @onready/%Unique, and get_node_or_null when a node is optional. |
previously freed | An await or deferred call outlived the node. Check is_instance_valid() or is_inside_tree(). |
| Physics or tree changes during a callback error out | Use call_deferred("add_child", n), set_deferred("disabled", true) or queue_free(). |
Cyclic reference / Could not resolve class | class_name cycles between preloads. Use type hints with load() at runtime, or split the shared type into its own script. |
| A signal callback never fires | Connected in _ready of a node that isn't in the tree yet, signature mismatch, or a typo in the signal name. Typed sig.connect() catches typos at parse time. |
| Exported var resets | Value set in _init gets overwritten by the scene file. Initialize in the declaration or in _ready. |
| Mixed tabs and spaces | Tabs only. Godot rejects mixed indentation. |
Deeper patterns, all compiled by the test suite: references/patterns.md.
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.

