[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79NZ2BPFN64RH9T7VVRYM3P":3,"skill-same:01M79NZ2BPFN64RH9T7VVRYM3P":51},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M79NZ2BPFN64RH9T7VVRYM3P","godot-resources",null,"Design data-driven Godot 4.7 games with custom Resource classes: define typed data with class_name + @export, save\u002Fload .tres\u002F.res files, instance and duplicate resources, and load on demand with ResourceLoader (incl. threaded loading). Use when modeling items\u002Fstats\u002Fconfigs as data in a Godot project, creating .tres resources, or working with custom Resource subclasses and ResourceLoader\u002FResourceSaver.","JunMystery\u002FAgent-Guidance","JunMystery","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F161468934?v=4","01M79MTMV8F0BY8NK1A92RA8A0","Jun","01M79MTMWCFBKPHN5B25E6V20B",0,"MIT","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fgodot-resources\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: godot-resources\ndescription: >\n  Design data-driven Godot 4.7 games with custom Resource classes: define typed\n  data with class_name + @export, save\u002Fload .tres\u002F.res files, instance and duplicate\n  resources, and load on demand with ResourceLoader (incl. threaded loading). Use\n  when modeling items\u002Fstats\u002Fconfigs as data in a Godot project, creating .tres\n  resources, or working with custom Resource subclasses and ResourceLoader\u002FResourceSaver.\n---\n\n# Godot Resources (4.x)\n\nModel game data as reusable, Inspector-editable `Resource` objects instead of hard-coded\nvalues, and load\u002Fsave them as `.tres`\u002F`.res`. Targets **Godot 4.7**.\n\n## When to use\n\n- Use when representing items, stats, enemy configs, dialogue lines, or level metadata as\n  data; authoring `.tres` files in the Inspector; or loading\u002Fsaving custom resources.\n\n**When *not* to use:** nodes\u002Fscene structure → `godot-nodes-scenes`; saving the player's\n*runtime progress* (engine-agnostic save format\u002Fslots) → `save-systems`; the C# variant of\nthis pattern → `godot-csharp`.\n\n## Core workflow\n\n1. **Subclass `Resource`** with `class_name` and `@export` fields. It now appears in the\n   \"New Resource\" dialog and as an `@export` type, editable in the Inspector.\n2. **Create instances as `.tres`** files in the FileSystem dock (text, diff-friendly) or\n   `.res` (binary, smaller\u002Ffaster). Edit their fields in the Inspector — no code needed.\n3. **Reference resources from nodes** via `@export var data: ItemResource`, or arrays\n   `@export var loot: Array[ItemResource]`.\n4. **Load at runtime** with `preload` (constant path) or `load`\u002F`ResourceLoader.load`\n   (variable path). Use threaded loading for large assets.\n5. **Duplicate before mutating** a shared resource at runtime, or every node using it\n   changes too (resources are shared references).\n6. **Save generated\u002Fedited resources** with `ResourceSaver.save`.\n\n## Patterns\n\n### 1. A custom data resource\n\n```gdscript\n# item.gd\nextends Resource\nclass_name ItemResource\n\n@export var id: StringName = &\"\"\n@export var display_name: String = \"Item\"\n@export_multiline var description: String = \"\"\n@export var icon: Texture2D\n@export var max_stack: int = 99\n@export var value: int = 0\n```\n\nCreate `sword.tres` from this class in the FileSystem dock and fill it in the Inspector.\n\n### 2. Consume resources from a node\n\n```gdscript\nextends Node\n@export var starting_items: Array[ItemResource] = []   # drag .tres files in the Inspector\n\nfunc _ready() -> void:\n    for item in starting_items:\n        print(\"Have: %s (x%d max)\" % [item.display_name, item.max_stack])\n```\n\n### 3. Duplicate before mutating shared data\n\n```gdscript\nfunc give_unique_copy(template: ItemResource) -> ItemResource:\n    # true = deep: copies nested arrays\u002Fdictionaries and *embedded* sub-resources, but\n    # sub-resources saved in their own .tres stay shared. Use\n    # template.duplicate_deep(Resource.DEEP_DUPLICATE_ALL) to copy those as well.\n    var copy: ItemResource = template.duplicate(true)\n    copy.value += 5                # mutating the copy won't touch the template .tres\n    return copy\n```\n\n### 4. Save and load a resource at runtime\n\n```gdscript\nfunc save_config(cfg: Resource) -> void:\n    ResourceSaver.save(cfg, \"user:\u002F\u002Fconfig.tres\")   # user:\u002F\u002F = writable app data dir\n\nfunc load_config() -> Resource:\n    if ResourceLoader.exists(\"user:\u002F\u002Fconfig.tres\"):\n        return ResourceLoader.load(\"user:\u002F\u002Fconfig.tres\")\n    return null\n```\n\n## Pitfalls\n\n- **Resources are shared by reference.** A single `.tres` assigned to many nodes is the\n  *same* object — mutating it changes all of them (and re-saving the file). Call\n  `duplicate(true)` for per-instance state.\n- **A deep copy still changes the original's sub-resource** → `duplicate(true)` only copies\n  sub-resources embedded in the file; one saved as its own `.tres` (e.g. a shared\n  `stats.tres` inside `goblin.tres`) is still the same object. Use\n  `duplicate_deep(Resource.DEEP_DUPLICATE_ALL)` when those must be copied too.\n- **`class_name` required to instance from the editor.** Without it the class won't appear\n  in the \"New Resource\" dialog or as an `@export` type.\n- **`res:\u002F\u002F` is read-only in exported games.** Write runtime data to `user:\u002F\u002F`, never\n  `res:\u002F\u002F`. `ResourceSaver.save` to `res:\u002F\u002F` only works in the editor.\n- **Storing nodes in a Resource doesn't serialize them.** Resources hold data, not live\n  scene nodes. Reference scenes via `PackedScene`, not node instances.\n- **Cyclic resource references** (A holds B holds A) can fail to save\u002Fload cleanly — keep\n  data graphs acyclic or use IDs\u002Flookups.\n- **`preload` vs `load`.** `preload` needs a constant path and loads with the script;\n  `load` accepts a variable path at runtime. Use `ResourceLoader.exists()` before `load`\n  to avoid errors on missing files.\n- **Don't put secrets in `.tres`** — they ship in plain text inside the export.\n\n## References\n\n- For threaded\u002Fbackground loading (`load_threaded_request`), `@tool` resources with custom\n  setup, custom `ResourceFormatLoader`\u002F`Saver`, resource-local-to-scene, and resource UIDs,\n  read `references\u002Fresource-patterns.md`.\n\n## Related skills\n\n- `godot-gdscript` — `@export` annotations used to define resource fields.\n- `godot-nodes-scenes` — instancing scenes vs. sharing resource data.\n- `save-systems` — persisting runtime progress (separate from static data).\n- `unity-scriptableobjects` — the equivalent data-asset pattern in Unity.\n","# Godot Resources (4.x)\n\nModel game data as reusable, Inspector-editable `Resource` objects instead of hard-coded\nvalues, and load\u002Fsave them as `.tres`\u002F`.res`. Targets **Godot 4.7**.\n\n## When to use\n\n- Use when representing items, stats, enemy configs, dialogue lines, or level metadata as\n  data; authoring `.tres` files in the Inspector; or loading\u002Fsaving custom resources.\n\n**When *not* to use:** nodes\u002Fscene structure → `godot-nodes-scenes`; saving the player's\n*runtime progress* (engine-agnostic save format\u002Fslots) → `save-systems`; the C# variant of\nthis pattern → `godot-csharp`.\n\n## Core workflow\n\n1. **Subclass `Resource`** with `class_name` and `@export` fields. It now appears in the\n   \"New Resource\" dialog and as an `@export` type, editable in the Inspector.\n2. **Create instances as `.tres`** files in the FileSystem dock (text, diff-friendly) or\n   `.res` (binary, smaller\u002Ffaster). Edit their fields in the Inspector — no code needed.\n3. **Reference resources from nodes** via `@export var data: ItemResource`, or arrays\n   `@export var loot: Array[ItemResource]`.\n4. **Load at runtime** with `preload` (constant path) or `load`\u002F`ResourceLoader.load`\n   (variable path). Use threaded loading for large assets.\n5. **Duplicate before mutating** a shared resource at runtime, or every node using it\n   changes too (resources are shared references).\n6. **Save generated\u002Fedited resources** with `ResourceSaver.save`.\n\n## Patterns\n\n### 1. A custom data resource\n\n```gdscript\n# item.gd\nextends Resource\nclass_name ItemResource\n\n@export var id: StringName = &\"\"\n@export var display_name: String = \"Item\"\n@export_multiline var description: String = \"\"\n@export var icon: Texture2D\n@export var max_stack: int = 99\n@export var value: int = 0\n```\n\nCreate `sword.tres` from this class in the FileSystem dock and fill it in the Inspector.\n\n### 2. Consume resources from a node\n\n```gdscript\nextends Node\n@export var starting_items: Array[ItemResource] = []   # drag .tres files in the Inspector\n\nfunc _ready() -> void:\n    for item in starting_items:\n        print(\"Have: %s (x%d max)\" % [item.display_name, item.max_stack])\n```\n\n### 3. Duplicate before mutating shared data\n\n```gdscript\nfunc give_unique_copy(template: ItemResource) -> ItemResource:\n    # true = deep: copies nested arrays\u002Fdictionaries and *embedded* sub-resources, but\n    # sub-resources saved in their own .tres stay shared. Use\n    # template.duplicate_deep(Resource.DEEP_DUPLICATE_ALL) to copy those as well.\n    var copy: ItemResource = template.duplicate(true)\n    copy.value += 5                # mutating the copy won't touch the template .tres\n    return copy\n```\n\n### 4. Save and load a resource at runtime\n\n```gdscript\nfunc save_config(cfg: Resource) -> void:\n    ResourceSaver.save(cfg, \"user:\u002F\u002Fconfig.tres\")   # user:\u002F\u002F = writable app data dir\n\nfunc load_config() -> Resource:\n    if ResourceLoader.exists(\"user:\u002F\u002Fconfig.tres\"):\n        return ResourceLoader.load(\"user:\u002F\u002Fconfig.tres\")\n    return null\n```\n\n## Pitfalls\n\n- **Resources are shared by reference.** A single `.tres` assigned to many nodes is the\n  *same* object — mutating it changes all of them (and re-saving the file). Call\n  `duplicate(true)` for per-instance state.\n- **A deep copy still changes the original's sub-resource** → `duplicate(true)` only copies\n  sub-resources embedded in the file; one saved as its own `.tres` (e.g. a shared\n  `stats.tres` inside `goblin.tres`) is still the same object. Use\n  `duplicate_deep(Resource.DEEP_DUPLICATE_ALL)` when those must be copied too.\n- **`class_name` required to instance from the editor.** Without it the class won't appear\n  in the \"New Resource\" dialog or as an `@export` type.\n- **`res:\u002F\u002F` is read-only in exported games.** Write runtime data to `user:\u002F\u002F`, never\n  `res:\u002F\u002F`. `ResourceSaver.save` to `res:\u002F\u002F` only works in the editor.\n- **Storing nodes in a Resource doesn't serialize them.** Resources hold data, not live\n  scene nodes. Reference scenes via `PackedScene`, not node instances.\n- **Cyclic resource references** (A holds B holds A) can fail to save\u002Fload cleanly — keep\n  data graphs acyclic or use IDs\u002Flookups.\n- **`preload` vs `load`.** `preload` needs a constant path and loads with the script;\n  `load` accepts a variable path at runtime. Use `ResourceLoader.exists()` before `load`\n  to avoid errors on missing files.\n- **Don't put secrets in `.tres`** — they ship in plain text inside the export.\n\n## References\n\n- For threaded\u002Fbackground loading (`load_threaded_request`), `@tool` resources with custom\n  setup, custom `ResourceFormatLoader`\u002F`Saver`, resource-local-to-scene, and resource UIDs,\n  read `references\u002Fresource-patterns.md`.\n\n## Related skills\n\n- `godot-gdscript` — `@export` annotations used to define resource fields.\n- `godot-nodes-scenes` — instancing scenes vs. sharing resource data.\n- `save-systems` — persisting runtime progress (separate from static data).\n- `unity-scriptableobjects` — the equivalent data-asset pattern in Unity.\n",{"name":5,"description":7},"main","5d0a87185c0e172c3901e2a6e5916b6d544b8b94","skills\u002Fgodot-resources","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance","https:\u002F\u002Fgithub.com\u002FJunMystery","AI is the typist, I am the architect. Building efficient, secure, and user-centric products through disciplined AI prompt engineering.","2026-11-13 17:41:25",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add JunMystery\u002FAgent-Guidance --skill godot-resources",{"tool":37,"command":38},"bunx","bunx skills add JunMystery\u002FAgent-Guidance --skill godot-resources",{"tool":40,"command":41},"pnpm","pnpm dlx skills add JunMystery\u002FAgent-Guidance --skill godot-resources","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fgodot-resources\u002FSKILL.md",true,[45],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"references\u002Fresource-patterns.md","REFERENCE","参考文档",3803,"https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fgodot-resources\u002Freferences\u002Fresource-patterns.md",[52,58,64,70,76,82],{"skillNo":53,"name":54,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M79QR1E309VJ6CTQKB32AWWA","zero-trust-architecture-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fzero-trust-architecture-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M79QQV7GHYR02DYGN41S23WN","xss-filter-evasion-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxss-filter-evasion-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M79QQNSN7YB8XB61FFSCS3WH","xs-leaks-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxs-leaks-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M79QQHZZJKFDY9132G5A65C2","xpath-injection-prevention-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxpath-injection-prevention-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M79QQB9ZSD3DJG8658EHQXR1","xml-security-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxml-security-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M79QQ60WKV7PFMXWT9CW8PM6","xml-external-entity-prevention-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxml-external-entity-prevention-cheat-sheet\u002FSKILL.md",[],[]]