name: add-inventory description: Use this skill when the objective involves adding items, pickup, dropping, inventory display, or item usage. version: 1.0
Skill: Add Inventory System
When to apply
- Any task mentioning inventory, items, pickup, backpack, use item, etc.
Instructions
- Extend Zod schemas in src/game/types.ts: ItemSchema and add inventory: z.array(ItemSchema) to GameState.
- Add items to rooms (e.g. items: string[] or full Item objects).
- Add Inquirer choices: "Look around", "Take [item]", "Inventory", etc.
- On "Take": move item from room to player inventory, validate with Zod.
- Persist inventory in any future save/load.
- Write tests for pickup, duplicate prevention, inventory listing.
- Use chalk to highlight items.
Common pitfalls to avoid
- Forgetting to validate with Zod.parse on state changes.
- Not updating room state when item is taken.