agentleFS
WhaocaiiWhaocaii/ai-game-skills/skills/inventory-system/SKILL.md

inventory-system

Skill4 starsChanged 2 months agoMITView on GitHub

设计或实现背包的物品身份、容量、增删、使用、交换和持久化。用于背包规则或故障处理,不默认绑定引擎。 Design inventory capacity, item identity, atomic transactions, equipment exchange and persistence.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

背包状态与交易

本模块由 Whaocaii 主导设计与维护,使用 AI 辅助编写。当前版本为 0.1.0 工作草稿。按用户的目标与现有项目约束执行;仅使用实际可用的工具。

输入

  • 物品类型、实例属性、堆叠键、容量规则
  • 使用与交易流程、存档格式以及联网与否

工作过程

  1. 分开定义物品模板和具体实例,明确哪些属性参与堆叠;带不同耐久或绑定状态的物品不能默认合并。
  2. 把拾取、拆分、使用和交换写成状态变更:前置条件、扣除项、增加项、失败结果。
  3. 一次交换先验证整个变更是否可行,再一次提交;失败不留下已扣未加的半完成状态。
  4. 给重复调用、满容量、数量为零、溢出和未知物品定义行为。联网项目按现有服务端权威规则处理。
  5. 存档记录版本与迁移规则;测试旧档载入后物品数量和实例身份是否保留。

交付

  • 物品与状态模型、操作契约
  • 正常与异常流程样例;实现任务附集成点

检查

  • 失败操作不改变库存
  • 成功操作满足数量与价值转移规则

使用案例

满背包时购买可堆叠药品,部分能放入、部分放不下。明确部分成交还是整单失败,并实现一致行为。

验收时按上面的检查项判断结果;只读完本文件不代表完成了任务。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.