Skip to content

77 game-dev skills for AI coding agents — Godot, Unity, Unreal, Phaser, PixiJS, three.js, Bevy, pygame, LÖVE, Roblox. Portable SKILL.md Agent Skills (the format Anthropic launched as Claude Skills), with a router that loads the right skill for your engine and task. Runs in Claude Code, Cursor, Kiro, Codex, Copilot, Gemini CLI and more.

fix(godot): explain what duplicate(true) shares, stop threaded-load polling, commit .uid files

Kiro Crewf7b93e2414c9
diff --git a/skills/godot/godot-resources/SKILL.md b/skills/godot/godot-resources/SKILL.md
index 2024c6f..7ec5d20 100644
--- a/skills/godot/godot-resources/SKILL.md
+++ b/skills/godot/godot-resources/SKILL.md
@@ -70,7 +70,9 @@ func _ready() -> void:
```gdscript
func give_unique_copy(template: ItemResource) -> ItemResource:
- # true = deep copy sub-resources too; false = shallow (shares sub-resources).
+ # true = deep: copies nested arrays/dictionaries and *embedded* sub-resources, but
+ # sub-resources saved in their own .tres stay shared. Use
+ # template.duplicate_deep(Resource.DEEP_DUPLICATE_ALL) to copy those as well.
var copy: ItemResource = template.duplicate(true)
copy.value += 5 # mutating the copy won't touch the template .tres
return copy
@@ -93,6 +95,10 @@ func load_config() -> Resource:
- **Resources are shared by reference.** A single `.tres` assigned to many nodes is the
*same* object — mutating it changes all of them (and re-saving the file). Call
`duplicate(true)` for per-instance state.
+- **A deep copy still changes the original's sub-resource** → `duplicate(true)` only copies
+ sub-resources embedded in the file; one saved as its own `.tres` (e.g. a shared
+ `stats.tres` inside `goblin.tres`) is still the same object. Use
+ `duplicate_deep(Resource.DEEP_DUPLICATE_ALL)` when those must be copied too.
- **`class_name` required to instance from the editor.** Without it the class won't appear
in the "New Resource" dialog or as an `@export` type.
- **`res://` is read-only in exported games.** Write runtime data to `user://`, never
diff --git a/skills/godot/godot-resources/references/resource-patterns.md b/skills/godot/godot-resources/references/resource-patterns.md
index 70a82d2..1be7882 100644
--- a/skills/godot/godot-resources/references/resource-patterns.md
+++ b/skills/godot/godot-resources/references/resource-patterns.md
@@ -25,9 +25,11 @@ func _process(_delta: float) -> void:
ResourceLoader.THREAD_LOAD_IN_PROGRESS:
update_bar(progress[0]) # 0.0–1.0
ResourceLoader.THREAD_LOAD_LOADED:
- var res := ResourceLoader.load_threaded_get(PATH)
+ set_process(false) # after load_threaded_get the status
+ var res := ResourceLoader.load_threaded_get(PATH) # turns INVALID_RESOURCE
_on_loaded(res)
ResourceLoader.THREAD_LOAD_FAILED, ResourceLoader.THREAD_LOAD_INVALID_RESOURCE:
+ set_process(false)
push_error("Load failed")
```
@@ -48,13 +50,16 @@ values). Guard with `Engine.is_editor_hint()` where needed. Combine with `@expor
To load a non-Godot file format as a Resource (e.g. a custom `.deck` text format), register
a `ResourceFormatLoader` (and optionally `ResourceFormatSaver`) and add it with
`ResourceLoader.add_resource_format_loader(loader)`. Override `_get_recognized_extensions`,
-`_handles_type`, and `_load`. This lets `load("res://x.deck")` return your resource type.
+`_handles_type`, `_get_resource_type`, and `_load`. This lets `load("res://x.deck")` return your resource type.
## Resource UIDs
-Godot 4 assigns each imported resource a stable UID (`uid://...`). Scenes can reference by
-UID so moving/renaming files doesn't break links. Get one with `ResourceUID`. Prefer
-letting the editor manage UIDs; avoid hand-editing `.uid` files.
+Godot 4 assigns each resource a stable UID (`uid://...`). Scenes can reference by UID so
+moving/renaming files doesn't break links. Get one with `ResourceUID`. Imported assets keep
+their UID in the `.import` file; since 4.4, scripts and shaders get a sidecar
+`<file>.uid` (e.g. `player.gd.uid`). **Commit `.uid` files** (never add `*.uid` to
+`.gitignore`) and move them together with their file when moving outside the editor.
+Prefer letting the editor manage UIDs; avoid hand-editing `.uid` files.
## Data-driven design tips
@@ -69,7 +74,8 @@ letting the editor manage UIDs; avoid hand-editing `.uid` files.
## Common API
```gdscript
-res.duplicate(deep := false) # copy; deep also copies sub-resources
+res.duplicate(deep := false) # copy; deep copies arrays/dicts + embedded sub-resources
+res.duplicate_deep(Resource.DEEP_DUPLICATE_ALL) # also copies sub-resources saved to files
res.take_over_path("res://x.tres")
res.resource_path # where it loaded from ("" if in-memory)
ResourceLoader.exists(path, type_hint := "")