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

/save-load

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

Use when building or replacing a save/load system — ConfigFile, JSON, Resource serialization, and save game architecture

Use this Skill: https://skilld.dev/gh/jame581/godotprompter/save-load

Nothing lands on disk. Nothing to clean up.

Fork this Skill

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

referencesversion-migration.md

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

Version Migration

Reference for skills/save-load/SKILL.md — incremental migration from older save versions on load.

← Back to SKILL.md


6. Version Migration

Always store a version integer in every save file. Apply migrations incrementally so any old save can be brought forward to the current format regardless of how many versions it has missed.

func _migrate(data: Dictionary) -> Dictionary:
	var version: int = data.get("version", 0)

	if version < 1:
		# v0 → v1: inventory did not exist, add empty array
		data["player"]["inventory"] = []
		version = 1

	if version < 2:
		# v1 → v2: skills system added, seed from empty array
		data["player"]["skills"] = []
		version = 2

	# v2 → v3: add stamina stat with default value
	if version < 3:
		data["player"]["stamina"] = 100
		version = 3

	data["version"] = CURRENT_VERSION
	return data
using Godot;
using Godot.Collections;

public partial class SaveMigrator : Node
{
    private const int CurrentVersion = 3;

    public Dictionary Migrate(Dictionary data)
    {
        int version = data.ContainsKey("version") ? (int)data["version"] : 0;

        if (version < 1)
        {
            // v0 → v1: inventory did not exist, add empty array
            if (!data.ContainsKey("player"))
                data["player"] = new Dictionary();
            ((Dictionary)data["player"])["inventory"] = new Array();
            version = 1;
        }

        if (version < 2)
        {
            // v1 → v2: skills system added, seed from empty array
            if (!data.ContainsKey("player"))
                data["player"] = new Dictionary();
            ((Dictionary)data["player"])["skills"] = new Array();
            version = 2;
        }

        if (version < 3)
        {
            // v2 → v3: add stamina stat with default value
            if (!data.ContainsKey("player"))
                data["player"] = new Dictionary();
            ((Dictionary)data["player"])["stamina"] = 100;
            version = 3;
        }

        data["version"] = CurrentVersion;
        return data;
    }
}

Key rules:

  • Each migration block is additive — it only adds or transforms, never removes data
  • Use data.get("key", default) defensively within migration blocks
  • The version field must be written back before returning

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.

1 warning7d3 checks · Risk MEDIUM
  • Gen Agent Trust Hub7d

    This skill provides templates for Godot save/load systems. It includes a security warning regarding the risks of loading Godot Resource files (.tres/.res). However, the recommended JSON implementation contains a vulnerability where it loads and instantiates resource paths directly from the user-writable save data, which could allow a malicious save file to execute arbitrary internal resources or scripts.

  • 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 week

README badge

README badge for jame581/godotprompter/save-load