junmystery/agent-guidance-rust/godot-resources
Claude Code and agent skill by junmystery/agent-guidance-rust
- community
Checking that the SKILL.md file is still in the repository.
Design data-driven Godot 4.7 games with custom Resource classes: define typed data with class_name + @export, save/load .tres/.res files, instance and duplicate resources, and load on demand with ResourceLoader (incl. threaded loading). Use when modeling items/stats/configs as data in a Godot project, creating .tres resources, or working with custom Resource subclasses and ResourceLoader/ResourceSaver.
Install
npx vskill@latest install junmystery/agent-guidance-rust/godot-resourcesSKILL.md
The same SKILL.md was published earlier as gamedev-skills/awesome-gamedev-agent-skills/godot-resources.
Godot Resources (4.x)
Model game data as reusable, Inspector-editable Resource objects instead of hard-coded values, and load/save them as .tres/.res. Targets Godot 4.7.
When to use
- Use when representing items, stats, enemy configs, dialogue lines, or level metadata as
data; authoring .tres files in the Inspector; or loading/saving custom resources.
When *not* to use: nodes/scene structure → godot-nodes-scenes; saving the player's runtime progress (engine-agnostic save format/slots) → save-systems; the C# variant of this pattern → godot-csharp.
Core workflow
- Subclass `Resource` with
class_nameand@exportfields. It now appears in the
"New Resource" dialog and as an @export type, editable in the Inspector.
- Create instances as `.tres` files in the FileSystem dock (text, diff-friendly) or
.res (binary, smaller/faster). Edit their fields in the Inspector — no code needed.
- Reference resources from nodes via
@export var data: ItemResource, or arrays
@export var loot: Array[ItemResource].
- Load at runtime with
preload(constant path) orload/ResourceLoader.load
(variable path). Use threaded loading for large assets.
- Duplicate before mutating a shared resource at runtime, or every node using it
changes too (resources are shared references).
- Save generated/edited resources with
ResourceSaver.save.
Patterns
1. A custom data resource
Create sword.tres from this class in the FileSystem dock and fill it in the Inspector.
2. Consume resources from a node
3. Duplicate before mutating shared data
4. Save and load a resource at runtime
Pitfalls
- Resources are shared by reference. A single
.tresassigned 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
res://. ResourceSaver.save to res:// only works in the editor.
- Storing nodes in a Resource doesn't serialize them. Resources hold data, not live
scene nodes. Reference scenes via PackedScene, not node instances.
- Cyclic resource references (A holds B holds A) can fail to save/load cleanly — keep
data graphs acyclic or use IDs/lookups.
- `preload` vs `load`.
preloadneeds a constant path and loads with the script;
load accepts a variable path at runtime. Use ResourceLoader.exists() before load to avoid errors on missing files.
- Don't put secrets in `.tres` — they ship in plain text inside the export.
References
- For threaded/background loading (
load_threaded_request),@toolresources with custom
setup, custom ResourceFormatLoader/Saver, resource-local-to-scene, and resource UIDs, read references/resource-patterns.md.
Related skills
godot-gdscript—@exportannotations used to define resource fields.godot-nodes-scenes— instancing scenes vs. sharing resource data.save-systems— persisting runtime progress (separate from static data).unity-scriptableobjects— the equivalent data-asset pattern in Unity.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/godot-resources/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/junmystery/agent-guidance-rust/godot-resources)