authoring-godot-prompt…
Use when writing or editing a SKILL.md, a skill's references/*.md, or an agent definition in this repo — required frontmatter,…
Use when building inventory systems — Resource-based items, slot management, stacking, and UI binding
Claude Code
$ npx -y skills add jame581/GodotPrompter --skill inventory-system --agent claude-code
Codex
$ npx skills add jame581/GodotPrompter --skill inventory-system -a codex -y
Cursor
$ npx skills add jame581/GodotPrompter --skill inventory-system -a cursor -y
Gemini CLI
$ npx skills add jame581/GodotPrompter --skill inventory-system -a gemini-cli -y
GitHub Copilot
$ npx skills add jame581/GodotPrompter --skill inventory-system -a github-copilot -y
OpenCode
$ npx skills add jame581/GodotPrompter --skill inventory-system -a opencode -y
Windsurf
$ npx skills add jame581/GodotPrompter --skill inventory-system -a windsurf -y
name: inventory-system description: Use when building inventory systems — Resource-based items, slot management, stacking, and UI binding
All examples target Godot 4.3+ with no deprecated APIs. This skill carries the decisions; the implementations live in `references/` (GDScript first, then C#) — load the one you need.
> **Related skills:** **resource-pattern** for custom Resource data containers, **save-load** for inventory serialization, **event-bus** for inventory change notifications, **hud-system** for inventory UI display, **popochiu** for adventure-game inventory.
---
┌─────────────────────────────────────────────────────────┐
│ UI Layer │
│ InventoryUI (Control) │
│ └─ GridContainer │
│ └─ SlotUI × N (Button) │
│ └─ TextureRect (icon) + Label (qty) │
│ │
│ Connects to: inventory_changed signal │
│ Drag-and-drop via _get_drag_data / _drop_data │
└───────────────────────┬─────────────────────────────────┘
│ reads / mutates
┌───────────────────────▼─────────────────────────────────┐
│ Inventory (Node) │
│ slots: Array[InventorySlot] │
│ add_item(item, qty) → leftover: int │
│ remove_item(item, qty) │
│ has_item(item, qty) → bool │
│ get_item_count(item) → int │
│ │
│ signals: inventory_changed │
│ item_added(item, quantity) │
│ item_removed(item, quantity) │
└───────────────────────┬─────────────────────────────────┘
│ references
┌───────────────────────▼─────────────────────────────────┐
│ Data Layer (Resources) │
│ ItemData (Resource) │
│ id, name, description, icon, max_stack_size, │
│ item_type enum │
│ │
│ InventorySlot (inner class / Resource) │
│ item: ItemData, quantity: int │
└─────────────────────────────────────────────────────────┘---
Three choices shape every inventory. Make them explicitly and state which you picked — the rest is mechanical.
| Decision | Take | Why | |---|---|---| | Item identity: `Resource` vs. Dictionary / JSON | **`Resource` in `.tres`** | `@export` slots accept typed items, the Inspector edits them, and shared instances compare by reference | | Slot container: `Resource` vs. `RefCounted` | **`RefCounted`** | Slots are runtime state, not authored assets. A `Resource` invites saving slots to disk and reloading stale item copies | | `add_item` return: `bool` vs. leftover count | **leftover `int`** | Partial adds are the common case (stack caps, full bag). A `bool` forces the caller to re-query what actually fit |
If your game needs something else — a weight-based bag with no slots, a grid inventory with shaped items, an infinite stack list — say so before building. The fixed slot array this skill describes is the wrong skeleton for all three.
| Member | Returns | Contract | |---|---|---| | `add_item(item, quantity)` | `int` | Leftover that did not fit; `0` means everything was added | | `remove_item(item, quantity)` | — | Removes up to `quantity`; silent when fewer are held | | `has_item(item, quantity)` | `bool` | Convenience over `get_item_count` | | `get_item_count(item)` | `int` | Summed across every slot | | `inventory_changed` | signal | Fired once per mutating operation — drives all UI | | `item_added(item, quantity)` | signal | Carries the amount actually added | | `item_removed(item, quantity)` | signal | Carries the amount actually removed |
> Full `ItemData`, `Inventory`, and `InventorySlot` implementations in GDScript and C#: [references/core-classes.md](references/core-classes.md)
---
Add equipment slots (`HEAD`, `CHEST`, `WEAPON`, etc.) with an `Equipment` node beside the `Inventory`, holding a slot map keyed by a `SlotType` enum. Stat aggregation sums a `stats` Dictionary (a property you add to `ItemData`) across equipped items; signal `equipment_changed` when slots change.
> See [references/equipment.md](references/equipment.md) for the full GDScript and C# `Equipment` class with `SlotType` enum, equip / unequip API, and stat aggregation.
---
Slot-grid UI: a `GridContainer` of `Button` slot widgets, each
Agentic skills framework for Godot 4.x game development. Gives AI coding agents domain-specific expertise for GDScript and C# projects.
Use when writing or editing a SKILL.md, a skill's references/*.md, or an agent definition in this repo — required frontmatter,…
Use when cutting a GodotPrompter release or bumping its version — the version-bump sequence, tag-triggered workflow, and the…
Use when working with 2D-specific systems — TileMaps, parallax scrolling, 2D lights and shadows, canvas layers, particles 2D,…
Use when working with 3D-specific systems — materials, lighting, shadows, environment, global illumination, fog, LOD, occlusion…
Use when building character abilities — Resource-based abilities with cost/cooldown/cast, buffs/debuffs, stat modifiers, gameplay…
Use when creating Godot editor plugins — EditorPlugin, @tool scripts, custom inspectors, and dock panels
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.