Index of every page on this site: llms.txt
All skills
jame581 avatar

/resource-pattern

@426e8ab
by Jan Mesarčjame581/godotprompter979 stars
63
Run it yourself

Use when creating data containers in Godot — custom Resources for configuration, items, stats, and editor integration

Use this Skill: https://skilld.dev/gh/jame581/godotprompter/resource-pattern

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencessaving-resources.md

≈471 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Saving Custom Resources

Reference for skills/resource-pattern/SKILL.md — ResourceSaver.save() for persistent state. GDScript + C#.

← Back to SKILL.md


9. Saving Custom Resources

Use ResourceSaver to write Resources to disk at runtime (procedurally generated content, unlocked items, etc.).

GDScript

func save_resource(res: Resource, path: String) -> bool:
    var err := ResourceSaver.save(res, path)
    if err != OK:
        push_error("Failed to save resource to '%s' — error %d" % [path, err])
        return false
    return true


# .tres — human-readable text, good for debugging and version control
save_resource(my_item, "user://generated/custom_sword.tres")

# .res — binary, smaller and faster to load, use in production builds
save_resource(my_item, "user://generated/custom_sword.res")

C#

public bool SaveResource(Resource res, string path)
{
    var err = ResourceSaver.Save(res, path);
    if (err != Error.Ok)
    {
        GD.PushError($"Failed to save resource to '{path}' — error {err}");
        return false;
    }
    return true;
}

// .tres — human-readable, for debugging and version control
SaveResource(myItem, "user://generated/custom_sword.tres");

// .res — binary, faster to load, use in production
SaveResource(myItem, "user://generated/custom_sword.res");

Format guidance:

Format Pros Cons Use When
.tres Human-readable, diffable, debuggable Larger file, slower to parse Development, version control, user-editable files
.res Compact binary, faster to load Not human-readable Production builds, shipped game data

Security: Never load .tres or .res files from untrusted sources (user uploads, downloaded mods). They can execute embedded GDScript. Use JSON for user-controlled data.


Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts7d3 checks · Risk SAFE
  • Gen Agent Trust Hub7d

    This skill provides standard design patterns for Godot engine development using the Resource class for data storage and configuration. It includes clear documentation on best practices and specifically warns users about the security risks associated with loading resource files from untrusted sources.

  • Socket7d

    No alerts

  • Snyk7d

    Risk: LOW · No issues

Signed by skilld at 426e8ab. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 6 days ago.

Activeupdated last month

README badge

README badge for jame581/godotprompter/resource-pattern