godot-resource-data-patterns

Installation
SKILL.md

NEVER Do in Resource Design

  • NEVER modify resource instances directly — Without .duplicate(), changing a value (like HP) modifies the shared .tres for everyone.
  • NEVER use untyped arrays in Resources@export var items: Array allows logic errors. Always use Array[ResourceClass] for type safety.
  • NEVER store Node references in Resources — Objects that only exist in a specific SceneTree cannot be serialized. Store NodePath or UID.
  • NEVER perform heavy calculations in Resource getters/setters — Resources should be data containers. Offload logic to Nodes or specialized RefCounted classes.
  • NEVER skip ResourceSaver.save() error checks — Saving can fail due to permissions, disk space, or path issues. Always check the return code.
  • NEVER use Resources for high-frequency runtime data — If a value changes 60 times a second (like velocity), a standard variable is faster than a Resource property.
  • NEVER allow circular Resource references — If A.tres references B.tres and B.tres references A.tres, the engine may crash on load.
  • NEVER forget the _init defaults — Resources created via new() or in the Inspector need default values in their constructor to be editable.
  • NEVER share a Resource between entities if they need unique state — Use resource_local_to_scene = true or duplicate() for components.
  • NEVER use .tres for massive datasets — If you have 10,000 items, a JSON or custom binary format might be more efficient than individualized Resource files.

Decision Tree: Resource vs RefCounted vs Node

Installs
296
GitHub Stars
600
First Seen
Feb 10, 2026
godot-resource-data-patterns — thedivergentai/gd-agentic-skills