--- name: supply-chain-inventory-review description: Use when reviewing inventory reservation, release, deduction, or stock ledger changes in a Java supply chain system. ---
# Supply Chain Inventory Review
Use this skill when a change touches inventory reservation, inventory release, stock deduction, stock ledger, purchase receipt, shipment, or order fulfillment logic.
## Workflow
1. Read the related Controller, Service, Mapper, DTO, database scripts, and tests. 2. Identify the business scenario: order reservation, payment confirmation, timeout release, shipment deduction, purchase receipt, or adjustment. 3. Check whether idempotency, transaction boundaries, concurrency control, and stock ledger records are defined. 4. List risks before suggesting code changes. 5. Require tests for success, duplicate requests, insufficient stock, concurrent requests, and rollback. 6. Review the final diff against the risk list.
## Rules
- Do not introduce a new lock mechanism unless the existing project pattern cannot satisfy the scenario. - Do not change stock quantity without a matching stock ledger record. - Do not treat idempotency as only a frontend concern. - Any change to stock quantity must explain transaction and rollback behavior.
这里的 description 很关键。它不是给人看的简介,而是帮助 AI 判断什么时候应该加载这个 skill。写得太窄,可能触发不了;写得太宽,又会到处乱触发。
--- name: supply-chain-inventory-review description: Use when reviewing Java supply chain changes that modify inventory reservation, release, deduction, receipt, adjustment, or stock ledger records. ---
# Supply Chain Inventory Review
## When to use
Use this skill when a change touches inventory quantity, stock ledger, reservation records, purchase receipt, shipment deduction, or inventory adjustment.
## Steps
1. Identify the business action: reserve, release, deduct, receive, adjust, or reverse. 2. Find the existing inventory tables, ledger tables, Mapper/XML, Service, and tests. 3. Check idempotency: request key, order number, message key, or business unique index. 4. Check concurrency: optimistic lock, conditional update, row lock, Redis lock, or message serialization. 5. Check transaction boundary: which records must commit or roll back together. 6. Check ledger consistency: every quantity change must have a matching ledger reason. 7. Check tests: success, insufficient stock, duplicate request, concurrent request, rollback, and invalid state. 8. Review diff and report any unrelated refactor.
## Output
Return: - business scenario summary - affected files and tables - risk list - required tests - review conclusion
这两年 AI 编程工具变化很快,从最早的补全、问答,到现在可以进入项目、读文件、改代码、跑命令的 coding agent,开发方式已经明显不一样了。Claude Code 属于这一类工具:它不是单纯的聊天窗口,而是更靠近终端里的协作开发助手。
我觉得普通开发者第一次用 Claude Code,最容易踩的坑不是“不会安装”,而是上来就把它当成万能实习生:丢一句“帮我优化项目”,然后等它自己理解所有背景。这样做偶尔能有惊喜,但很难稳定。更好的方式,是把它放进一个清楚的工作流里:先让它认识项目,再让它计划,再让它小步修改,最后看 diff 和验证结果。