Skill Press

No. 233 · build-game-inventory

Build Game Inventory

A field guide from Meng To

Meng To

When to use it

Build or repair game inventory, loot, equipment, tooltips, drag-and-drop, persistence, and progression systems. Use for item schemas, pickup flows, stack rules, equipment slots, atomic swaps, save migration, and no-loss regression testing.

Rank
No. 233 of 971
Installs
Not listed yet
Runs in
Codex, Claude, Cursor
Length
189 words · 1 min
Files
2
License
MIT

Get this skill

Download the skill folder (.zip, 2 KB) ↓ · SKILL.md only ↓

Publisher setup

Use the publisher’s setup guide for the tools and files used by this edition.

Open the publisher’s setup guide ↗

Contents

  1. Define the item contract
  2. Implement transfers as transactions
  3. Build usable UI
  4. Test loss boundaries

The skill, in full

Use one typed, serializable item source of truth and make every transfer atomic.

Define the item contract

Model stable IDs, item definitions, ownership, stack limits, equipment compatibility, effects, rarity, presentation data, and migration version separately. Runtime UI must reference definitions by ID rather than duplicate stats or descriptions.

Implement transfers as transactions

For pickup, equip, unequip, swap, drag/drop, consume, and sell:

  1. Validate source ownership and destination legality.
  2. Compute the entire next inventory/equipment state.
  3. Commit once or reject without changing either side.
  4. Persist only after the committed state is valid.

Never remove an item before confirming a legal destination. Preserve item identity across a swap and prevent duplicate effect registration.

Build usable UI

Expose slot compatibility, equipped state, quantity, tooltip facts, and failure feedback. Support keyboard and touch alternatives to drag-only interactions. Keep focus behavior, dialogs, and tooltips accessible.

Test loss boundaries

Cover invalid destinations, full inventory, duplicate pickup, equip swap, mid-action swap, save/load, schema migration, reset/new game, tooltip updates, and repeated dispatch. Validate that total owned item identity is conserved except for explicit consumption or reward rules.

More in Game Development

All Game Development skills →

More from Meng To

From MengTo/Skills at 3ec2dc0, MIT. Install counts from skills.sh.