build-game-inventory

Installation
SKILL.md

Build Game Inventory

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.

Installs
605
Repository
mengto/skills
GitHub Stars
5.8K
First Seen
Jul 24, 2026
build-game-inventory — mengto/skills