--- 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