# godot-resource-data-patterns

A Godot skill that steers your agent toward Resource and RefCounted patterns for item databases, character stats and reusable data.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 497 installs · ★ 893
- Author: thedivergentai
- License: LGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/thedivergentai/Game-Dev-Agentic-Skills/tree/HEAD/skills/godot-resource-data-patterns/SKILL.md
- Updated: 2026-10-16
- HTML: https://affpapa.org/en/nevibecode/skills/godot-resource-data-patterns

## What it does

The skill lays out data-oriented design in Godot: what belongs in a `Resource`, what fits `RefCounted`, and what should stay a plain variable. It ships a decision table plus scripts for named scenarios — `resource_local_to_scene.gd`, `nested_resource_serialization.gd`, `resource_flyweight_caching.gd`, `resource_based_inventory.gd`, `resource_save_system.gd` and more. The agent opens the matching file when your task lines up with a scenario.

The loudest warning is about shared `.tres` files. Change HP or mana on an instance without `duplicate(true)` or `resource_local_to_scene` and the edit reaches the asset on disk, so every user of that resource gets hit. Per-instance state therefore needs duplication or local-to-scene. Node references inside a Resource are another dead end — they cannot be serialized, so store `NodePath` or `UID` instead.

Past roughly 10,000 rows, individual `.tres` files lose to JSON or a binary format. Typed arrays like `Array[ResourceClass]` are treated as required, and heavy math in resource getters or setters is treated as a mistake. Install runs through `npx skills add`, and the file lands at `~/.claude/skills/godot-resource-data-patterns/SKILL.md`.

## Requirements
- Works with: Godot

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-resource-data-patterns -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/godot-resource-data-patterns/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/godot-resource-data-patterns/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-resource-data-patterns -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/godot-resource-data-patterns/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-resource-data-patterns -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/godot-resource-data-patterns/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install thedivergentai/Game-Dev-Agentic-Skills godot-resource-data-patterns
```

2. **Manually: put the files in place**
- File: `.github/skills/godot-resource-data-patterns/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-resource-data-patterns -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/thedivergentai/Game-Dev-Agentic-Skills --path skills/godot-resource-data-patterns
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/godot-resource-data-patterns/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-resource-data-patterns -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/thedivergentai/Game-Dev-Agentic-Skills/tree/HEAD/skills/godot-resource-data-patterns/SKILL.md

## When to use it
- build an item database from Resource classes with typed arrays
- give each character its own mutable stats without touching the shared `.tres`
- serialize a nested Item → Weapon → StatusEffect tree
- share one enemy config across many entities through a cache
- check the `Error` returned when saving resources

## Example prompts
- make ItemData a Resource with @export and a typed array
- each character needs its own HP, leave the shared .tres alone
- save the nested resource tree with ResourceSaver and check the Error

## Similar
- [cli-anything-godot](https://affpapa.org/en/nevibecode/skills/cli-anything-godot.md) — skill · 548 installs
- [godot-gdscript](https://affpapa.org/en/nevibecode/skills/godot-gdscript.md) — skill · 6500 installs
- [godot-physics](https://affpapa.org/en/nevibecode/skills/godot-physics.md) — skill · 6300 installs
- [godot-best-practices](https://affpapa.org/en/nevibecode/skills/godot-best-practices.md) — skill · 2100 installs
- [godot-prompter](https://affpapa.org/en/nevibecode/plugins/godot-prompter.md) — plugin · ★ 867
- [godot-mcp-enhanced](https://affpapa.org/en/nevibecode/mcp/godot-mcp-enhanced.md) — MCP server · ★ 103

From the same set: [thedivergentai/game-dev-agentic-skills](https://affpapa.org/en/nevibecode/by/thedivergentai/game-dev-agentic-skills.md) — 51 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
