Token导航 LogoToken导航

Agent Skill · 开发

godot-resource-data-patterns(Godot 资源数据模式)

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。它适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实;涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。

godot-resource-data-patterns 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 10,089。

总安装 2,399周安装 102GitHub Stars 138下载 840核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:godot-resource-data-patterns(Godot 资源数据模式)
来源仓库:https://github.com/thedivergentai/gd-agentic-skills
仓库路径:skills/godot-resource-data-patterns
安装命令:
npx skills add https://github.com/thedivergentai/gd-agentic-skills --skill godot-resource-data-patterns
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/thedivergentai/gd-agentic-skills --skill godot-resource-data-patterns

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。适合清洗字段、汇总数据、发现异常或生成统计口径说明。通过 npx skills add 命令从指定 GitHub 仓库安装并使用。使用时需确认数据来源与字段含义,避免将样本当作全量事实。

godot-resource-data-patterns 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/godot-resource-data-patterns

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/thedivergentai/gd-agentic-skills --skill godot…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

godot-resource-data-patterns 怎么安装?

在终端执行 npx skills add https://github.com/thedivergentai/gd-agentic-skills --skill godot-resource-…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

godot-resource-data-patterns 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

godot-resource-data-patterns 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

godot-resource-data-patterns 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

godot-resource-data-patterns 用的人多吗?

公开数据是累计安装 2,399 次,近一周安装 102 次,下载 840 次,GitHub 138 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

godot-resource-data-patterns 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
godot-resource-data-patterns

Godot 资源数据模式 · 本页

2,399138只读未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Resource & Data Patterns

Resource-based design, typed arrays, and serialization define reusable, inspector-friendly data structures.

Available Scripts

custom_data_resource.gd

Pattern for defining serialized data containers (Items, Spells, Stats) for the Inspector.

resource_flyweight_caching.gd

Expert example of the Flyweight pattern for memory-efficient resource sharing.

resource_local_to_scene.gd

Handling "Local to Scene" resources and duplicate() to prevent cross-contamination.

character_stats_resource.gd

Reactive data containers that emit signals when internal properties are modified.

resource_save_system.gd

Pattern for serializing complex game state directly into .tres files on disk.

resource_based_inventory.gd

Managing item collections and inventory logic using serialized Resource arrays.

flyweight_enemy_config.gd

Using shared Resources to configure many entities efficiently (HP, Skins, Speed).

dynamic_resource_generation.gd

Creating and modifying Resource instances programmatically at runtime (Loot, Procedural).

resource_preloading_strategy.gd

Preventing frame drops by caching resources in a dictionary before gameplay starts.

nested_resource_serialization.gd

Building and saving complex data hierarchies using nested Resource properties.

NEVER Do in Resource Design

  • NEVER modify resource instances directly — Without .duplicate(), changing a value (like HP) modifies the .tres file on disk for everyone [26].
  • NEVER use untyped arrays in Resources — @export var items: Array allows logic errors. Always use Array[ResourceClass] for type safety [27].
  • NEVER store Node references in Resources — Objects that only exist in a specific SceneTree (like Players/Projectiles) cannot be serialized. Store NodePath or UID [30].
  • 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 [31].
  • 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 [15].
  • NEVER share a Resource between entities if they need unique state — Use resource_local_to_scene = true in the Inspector for components [26].
  • 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.

TypeUse CaseSerializableCan Save to DiskInspector Support
ResourceData that needs saving/loading✅✅✅
RefCountedTemporary runtime data❌❌❌
NodeScene hierarchy entities✅ (scene files)✅✅

When to Use Resources

Use Resources For:

  • Item definitions (weapons, consumables, equipment)
  • Character stats/progression systems
  • Skill/ability data
  • Configuration files
  • Dialogue databases
  • Enemy/NPC templates

Use RefCounted For:

  • Temporary calculations
  • Runtime-only state machines
  • Utility classes without data persistence

Implementation Patterns

Pattern 1: Custom Resource Class

# item_data.gd
extends Resource
class_name ItemData

@export var item_name: String = ""
@export var description: String = ""
@export_enum("Weapon", "Consumable", "Armor") var item_type: int = 0
@export var icon: Texture2D
@export var value: int = 0
@export var stackable: bool = false
@export var max_stack: int = 1

func use() -> void:
    match item_type:
        0:  # Weapon
            print("Equipped weapon: ", item_name)
        1:  # Consumable
            print("Consumed: ", item_name)
        2:  # Armor
            print("Equipped armor: ", item_name)

Create Resource Instances:

  1. In Inspector: Right-click → New Resource → ItemData
  2. Fill in properties, Save as res://items/health_potion.tres

Pattern 2: Character Stats Resource

# character_stats.gd
extends Resource
class_name CharacterStats

@export var max_health: int = 100
@export var max_mana: int = 50
@export var strength: int = 10
@export var defense: int = 5
@export var speed: float = 100.0

var current_health: int = max_health:
    set(value):
        current_health = clampi(value, 0, max_health)

var current_mana: int = max_mana:
    set(value):
        current_mana = clampi(value, 0, max_mana)

func take_damage(amount: int) -> int:
    var actual_damage := maxi(amount - defense, 0)
    current_health -= actual_damage
    return actual_damage

func heal(amount: int) -> void:
    current_health += amount

func duplicate_stats() -> CharacterStats:
    var stats := CharacterStats.new()
    stats.max_health = max_health
    stats.max_mana = max_mana
    stats.strength = strength
    stats.defense = defense
    stats.speed = speed
    stats.current_health = current_health
    stats.current_mana = current_mana
    return stats

Usage:

# player.gd
extends CharacterBody2D

@export var stats: CharacterStats

func _ready() -> void:
    if stats:
        # Create runtime copy to avoid modifying the original resource
        stats = stats.duplicate_stats()

Pattern 3: Database Pattern (Array of Resources)

# item_database.gd
extends Resource
class_name ItemDatabase

@export var items: Array[ItemData] = []

func get_item_by_name(item_name: String) -> ItemData:
    for item in items:
        if item.item_name == item_name:
            return item
    return null

func get_items_by_type(item_type: int) -> Array[ItemData]:
    var filtered: Array[ItemData] = []
    for item in items:
        if item.item_type == item_type:
            filtered.append(item)
    return filtered

Create Database:

  1. Create ItemDatabase resource
  2. Expand items array in Inspector
  3. Add ItemData resources to array
  4. Save as res://data/item_database.tres

Usage:

# Global autoload
const ITEM_DB := preload("res://data/item_database.tres")

func get_item(name: String) -> ItemData:
    return ITEM_DB.get_item_by_name(name)

Pattern 4: Runtime-Only Data (RefCounted)

For data that doesn't need persistence:

# damage_calculation.gd
extends RefCounted
class_name DamageCalculation

var base_damage: int
var critical_hit: bool
var damage_type: String

func calculate_final_damage(target_defense: int) -> int:
    var final_damage := base_damage - target_defense
    if critical_hit:
        final_damage *= 2
    return maxi(final_damage, 1)

Usage:

var calc := DamageCalculation.new()
calc.base_damage = 50
calc.critical_hit = randf() > 0.8
calc.damage_type = "physical"
var damage := calc.calculate_final_damage(enemy.defense)

Advanced Patterns

Pattern 5: Nested Resources

# weapon_data.gd
extends ItemData
class_name WeaponData

@export var damage: int = 10
@export var attack_speed: float = 1.0
@export var special_effects: Array[StatusEffect] = []

# status_effect.gd
extends Resource
class_name StatusEffect

@export var effect_name: String
@export var duration: float
@export var damage_per_second: int

Pattern 6: Resource Scripts with Signals

# inventory.gd
extends Resource
class_name Inventory

signal item_added(item: ItemData)
signal item_removed(item: ItemData)

var items: Array[ItemData] = []

func add_item(item: ItemData) -> void:
    items.append(item)
    item_added.emit(item)

func remove_item(item: ItemData) -> void:
    items.erase(item)
    item_removed.emit(item)

Pattern 7: Resource Loading at Runtime

# Load resource dynamically
var item: ItemData = load("res://items/sword.tres")

# Preload for better performance (compile-time)
const SWORD := preload("res://items/sword.tres")

# Load all resources in a directory
func load_all_items() -> Array[ItemData]:
    var items: Array[ItemData] = []
    var dir := DirAccess.open("res://items/")
    if dir:
        dir.list_dir_begin()
        var file_name := dir.get_next()
        while file_name != "":
            if file_name.ends_with(".tres"):
                var item: ItemData = load("res://items/" + file_name)
                items.append(item)
            file_name = dir.get_next()
    return items

Best Practices

1. Always Duplicate Resources in Runtime

# ✅ Good - create instance copy
@export var stats: CharacterStats
func _ready():
    stats = stats.duplicate()  # Or custom duplicate method

# ❌ Bad - modifies the original resource file
@export var stats: CharacterStats
func _ready():
    stats.current_health -= 10  # This changes the .tres file!

2. Use @export for Inspector Editing

# ✅ Makes properties editable in Inspector
@export var max_health: int = 100
@export var icon: Texture2D
@export_range(0, 100) var drop_chance: int = 50

3. Organize Resources by Category

res://data/
    items/
        weapons/
            sword.tres
            bow.tres
        consumables/
            health_potion.tres
    characters/
        player_stats.tres
        enemy_goblin.tres
    databases/
        item_database.tres

4. Type Your Arrays

# ✅ Good - typed array
@export var items: Array[ItemData] = []

# ❌ Bad - untyped array
@export var items: Array = []

Saving/Loading Resources

# Save resource to disk
func save_inventory(inventory: Inventory, path: String) -> void:
    ResourceSaver.save(inventory, path)

# Load resource from disk
func load_inventory(path: String) -> Inventory:
    if ResourceLoader.exists(path):
        return ResourceLoader.load(path)
    return null

Reference

Related

平台分布

Codex

35.92%
按下载量换算302

Claude

31.49%
按下载量换算265

Cursor

19.18%
按下载量换算161

Gemini CLI

9.73%
按下载量换算82

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills