AIPM
Theme

AIPM package

Godot Resources

@gamedev-skills/godot-resources@1.0.0

>

Scanned · no issues · Nov 23, 2026

GitHub stars: ★ 10K

LinkedInPost

Install Skill

Pins this version in aipm.package.json and aipm-lock.json.

aipm add @gamedev-skills/godot-resources@1.0.0

Without project tracking

Writes the skill files only. Add --no-init to skip aipm.package.json and the lockfile.

aipm add @gamedev-skills/godot-resources@1.0.0 --no-init

How to use

Install the skill above, then run this in your AI tool:

/godot-resources <your description>

About

Model game data as `Resource` objects saved as `.tres`/`.res`, share them safely, and load them without hitches. Targets **Godot 4.7** (see Version notes).

Source

What gets added to your project

Preview every file this package writes on install before you run the command above.

Summary

>

Skill instructions

Godot Resources (4.x)

Model game data as Resource objects saved as .tres/.res, share them safely, and load them without hitches. Targets Godot 4.7 (see Version notes).

When to use

  • Items, stats, enemy configs, dialogue lines or level metadata as data files; custom Resource subclasses; ResourceLoader/ResourceSaver code.

When not to use: scene structure → godot-nodes-scenes; the player's runtime progress, slots and migration → save-systems; C# → godot-csharp.

Core workflow

  1. Subclass Resource with class_name and typed @export fields (Pattern 1). The class_name is what lets the editor offer it in "New Resource" and as an export type.
  2. Create instances as text .tres files. You can write them directly (Pattern 2) instead of clicking through the FileSystem dock and Inspector; use binary .res only for large generated data.
  3. Reference resources from nodes with @export var data: ItemResource or @export var loot: Array[ItemResource], or load them by path in code.
  4. Load with preload (constant path) or load (variable path); use ResourceLoader.load_threaded_request for large scenes (see the reference).
  5. Duplicate before mutating a shared resource at runtime (Pattern 3); every node that loaded the same path holds the same object.
  6. Check before you finish.
    • After adding or moving .tres/.gd files, run the godot-nodes-scenes skill's scripts/check_godot_project.py <project-dir> to catch broken ext_resource paths, uids and ids. Fix every ERROR.
    • Prove the data loads and copies correctly with a headless test (Pattern 4): godot --headless --path . --import once on a fresh checkout (so class_name types resolve), then godot --headless --path . --script res://tests/test_items.gd, and read the exit code. With no Godot binary (godot, godot4 or $GODOT_BIN), ask the user to run both lines and paste the output.

Patterns

1. A custom data resource

gdscript
# res://items/item.gd
extends Resource
class_name ItemResource

@export var id: StringName = &""
@export var display_name: String = "Item"
@export_multiline var description: String = ""
@export var icon: Texture2D
@export var max_stack: int = 99
@export var value: int = 0

2. The same item as a hand-written .tres

ini
[gd_resource type="Resource" script_class="ItemResource" format=3]

[ext_resource type="Script" path="res://items/item.gd" id="1_item"]

[resource]
script = ExtResource("1_item")
id = &"sword"
display_name = "Sword"
max_stack = 1
value = 50

Leave out the uid= attributes; Godot adds them the next time the file is saved. Fields left out keep the script defaults.

3. Duplicate before mutating shared data

gdscript
func give_unique_copy(template: ItemResource) -> ItemResource:
    # 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

4. Headless check: the file loads as its class and copies are independent

gdscript
# res://tests/test_items.gd
extends SceneTree

func _initialize() -> void:
    var failed := 0
    var sword := load("res://items/sword.tres") as ItemResource
    if sword == null:
        failed += 1
        push_error("sword.tres did not load as ItemResource")
    else:
        var copy: ItemResource = sword.duplicate(true)
        copy.value += 1
        if copy.value == sword.value:
            failed += 1
            push_error("duplicate(true) shares state with the template")
    print("Results: %d failed" % failed)
    quit(1 if failed > 0 else 0)

Gotchas

  • Resources are shared by reference. Every load() of one path returns the same cached object, so mutating it changes every user (and re-saving writes the change into the file). Duplicate for per-instance state, or set resource_local_to_scene = true for a copy per scene instance.
  • 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) stays the same object. Use duplicate_deep(Resource.DEEP_DUPLICATE_ALL) when those must be copied too.
  • class_name is required for editor and typed use. Without it the class is missing from "New Resource" and cannot be an @export type.
  • class_name "not declared" only in headless or CI runs → the global class cache in .godot/ is missing on a fresh checkout. Run godot --headless --path . --import first.
  • res:// is read-only in exported games. Write runtime data to user://. ResourceSaver.save to res:// works only while running from the project folder.
  • Moving a .gd or .tres outside the editor breaks ext_resource paths. Move the .uid sidecar with scripts, then run the checker; a uid that still resolves keeps the link working.
  • Nodes stored in a Resource don't serialize. Resources hold data; reference scenes as PackedScene, not node instances.
  • Cyclic references (A holds B holds A) can fail to save or load cleanly; keep data graphs acyclic or link by id.
  • preload vs load. preload needs a constant path and loads with the script; load takes a runtime path. Check ResourceLoader.exists() first for optional files.
  • .tres files ship as readable text inside the export, so keep secrets out of them.

References

  • Read references/resource-patterns.md when you need threaded loading with progress, resource_local_to_scene, @tool resources, a custom ResourceFormatLoader/Saver for a new file type, uid handling, or a registry layout for many data files.

Related skills

  • godot-gdscript for the @export annotations that define resource fields.
  • godot-nodes-scenes for instancing scenes vs sharing resource data, and the checker.
  • save-systems for persisting runtime progress (separate from static data).
  • godot-gdscript-headless-testing to keep data tests in CI.
  • unity-scriptableobjects for the equivalent Unity pattern.

Version notes

Last verified: 2026-11-11 against Godot 4.7.2-stable (released 2026-08-18).

  • Resource.duplicate_deep() and DEEP_DUPLICATE_ALL exist since 4.5.
  • .uid sidecar files for scripts and shaders exist since 4.4; commit them.
  • The text format writes script_class in the [gd_resource] header; since 4.6 it no longer writes or reads load_steps, so older files that carry it still load.

Sources: Resource @ 4.7.2-stable, resource_format_text.cpp @ 4.7.2-stable, Resources, File paths in Godot projects.

Loading package files…

Share this package

Add an Install with AIPM badge

Add this badge to a GitHub README so readers can open the package page and install the same version.

Install with AIPM
[![Install with AIPM](https://www.aipm-registry.com/install-with-aipm.svg)](https://www.aipm-registry.com/skills/gamedev-skills/godot-resources/1.0.0?utm_source=github&utm_medium=readme&utm_campaign=package_badge)

Publisher

gamedev-skills

This imported publisher has not claimed its AIPM account. A connected account confirms account control, but it does not guarantee that a package is safe.

AI assistant context

What this skill is for

@gamedev-skills/godot-resources@1.0.0 is an AIPM skill package for All tools. Use it when a project needs the reusable AI behavior described as: >

Install
aipm add @gamedev-skills/godot-resources@1.0.0
Use after install
/godot-resources <your description>

Tool targets

Install command by target

Add --no-init to any of these when you want the skill files without aipm.package.json or aipm-lock.json.

cursor

Run this variant when you want to install the package into cursor.

aipm add @gamedev-skills/godot-resources@1.0.0 --target cursor --ci

claude

Run this variant when you want to install the package into claude.

aipm add @gamedev-skills/godot-resources@1.0.0 --target claude --ci

Discussion

Comments (0)

Loading comments…

Keep exploring

gamedev-skills/roblox-characters

>

Published by gamedev-skills

skillScanned · no issues★ 10KImported · UnverifiedAll toolsNov 23, 2026, 1:03 AM6.00 KBApache-2.0

gamedev-skills/roguelike

>

Published by gamedev-skills

skillScanned · no issues★ 10KImported · UnverifiedAll toolsNov 23, 2026, 1:03 AM6.85 KBApache-2.0

gamedev-skills/godot-3d-essentials

>

Published by gamedev-skills

skillScanned · no issues★ 10KImported · UnverifiedAll toolsNov 23, 2026, 1:03 AM7.87 KBApache-2.0

Package FAQ

Install and compatibility

How to install
Run aipm add @gamedev-skills/godot-resources@1.0.0 in a project that has AIPM initialized.
Supported tools
@gamedev-skills/godot-resources@1.0.0 supports All tools.

Before installing

AIPM skills can add files to your project. Review the package name, target, description, license, and publisher before installing. Use a clean branch when trying a new skill.