build-game-inventory

Implements game inventory, equipment, and loot systems with atomic item transfers.

5.7k|685|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/MengTo/Skills --skill build-game-inventory
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: build-game-inventory
Source: https://github.com/MengTo/Skills/tree/main/agent-skills/game-development/build-game-inventory
Command: npx skills add https://github.com/MengTo/Skills --skill build-game-inventory

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Game inventory systems frequently lose or duplicate items during pickups, swaps, and saves because transfers are not atomic and item data is scattered across UI and runtime code. This Skill provides a structured playbook for building inventory, equipment, and persistence systems that conserve item identity across every operation.

Core Features & Use Cases

  • Typed Item Contract: Defines stable IDs, item definitions, stack limits, equipment compatibility, rarity, and migration versions as a single serializable source of truth.
  • Atomic Transfer Transactions: Implements pickup, equip, unequip, swap, drag-and-drop, consume, and sell as validate-compute-commit transactions that never remove an item before confirming a legal destination.
  • Accessible Inventory UI: Covers slot compatibility, tooltips, quantity display, failure feedback, and keyboard/touch alternatives to drag-only interactions.
  • Use Case: A player drags a sword onto an occupied equipment slot with a full inventory; the Skill's transaction model computes the full swap state, commits it atomically, and persists only after validation, so neither item is lost or duplicated.

Quick Start

Use the build-game-inventory skill to design an inventory and equipment system with atomic swaps, stack rules, and save migration for my game.

Frequently Asked Questions about build-game-inventory

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a game inventory system without losing items?

Model every transfer as an atomic transaction: validate source ownership and destination legality, compute the entire next state, then commit once or reject without changes. Never remove an item before confirming a legal destination, and persist only after the committed state is valid.

How to implement equipment swap and drag-and-drop in games?

Treat equip, unequip, swap, and drag-and-drop as the same transaction pattern that preserves item identity and prevents duplicate effect registration. Expose slot compatibility and failure feedback in the UI, and support keyboard and touch alternatives to drag-only input.

Should game items store stats in the UI or in definitions?

Item stats belong in typed definitions referenced by stable IDs, not duplicated in runtime UI. The UI should reference definitions by ID for tooltips, quantities, and presentation data, keeping one serializable source of truth.

How do I handle save migration for inventory data?

Include a migration version field in your item schema separate from the definitions themselves. Test save/load, schema migration, and reset/new game flows to confirm total owned item identity is conserved except for explicit consumption or reward rules.

What inventory edge cases cause item duplication bugs?

Common causes are mid-action swaps, repeated dispatch, duplicate pickups, and removing an item before confirming its destination. Regression tests should cover full inventories, invalid destinations, equip swaps, and repeated dispatch to verify item conservation.