diff --git a/.agents/skills/dn-inbox-review/SKILL.md b/.agents/skills/dn-inbox-review/SKILL.md new file mode 100644 index 0000000..dbaec85 --- /dev/null +++ b/.agents/skills/dn-inbox-review/SKILL.md @@ -0,0 +1,53 @@ +--- +name: dn-inbox-review +description: Review Foreman's latest delivery-note inbox run. Spot-check what he prepared against the photos, move answered site questions on to Ready to post, apply site-confirmed receipt corrections, and write a short report. Never books. +--- + +# Delivery-note inbox review (after Foreman) + +Foreman (MiniMax) works the inbox first: skill `foreman/skills/dn-inbox/SKILL.md`. His reports are in `foreman/runs/dn-inbox/.md`. You are the second, smaller check before the site manager pulls the trigger. Use the MegaDash MCP tools (`megadash-direct`, or the MEGADASH connector). Never write to PocketBase directly. + +## 1. Read Foreman's latest report +- Open the newest file in `foreman/runs/dn-inbox/`. If it is older than this morning or says the run failed, say so at the top of your report and work the board directly (steps 2–4 still apply). +- Use its "For the reviewer" table as your checklist. + +## 2. Spot-check what he prepared (Ready to post) +For every document Foreman moved to Ready to post (and anything else on `inbox_board` in `ready_to_post`): +1. `get_delivery_candidate`, then open the photo (`read_document`, `kind:"page"`). Look at it yourself, and zoom into the handwritten Quantity Delivered column. +2. For every saved allocation (`reconciliation_preview.allocations[]`), check: + - The quantity matches the photo, in the PO's unit (6 m lengths, kg → t, kits). + - The PO line is the right one. + - NIL lines are closed. +3. Check the money: `netTotal` against the slip's printed excl-VAT total, where it prints one. The difference must be explained by noted price differences (PO rate vs slip price). Check against `get_purchase_order_detail` that nothing goes over the PO. +4. Wrong → fix the line, re-run `process_delivery_candidate` and `prepare_delivery` with the right plan. Can't tell → `request_site_decision`. Write down what you changed and why. + - Low-confidence rows in Foreman's table get a full check, line by line. + - High-confidence rows: check at least the handwritten column and the total. + +## 3. Waiting for site: answered questions +For each document whose site question has been answered (`get_delivery_candidate` → `checks` entry `site_decision` with `passed:true` and `detail.answer`): +- Apply the answer. Link the PO they named (`resolve_delivery_entities`), fix quantities or units, upload the PO if they said it's coming and it's now in the system, or set aside if they said so. +- If they approved an extra quantity over the PO, `prepare_delivery` with `acceptExcess:true` and a reason quoting their answer. +- Then `prepare_delivery`, so it lands in Ready to post. Check it as in step 2. +- An answer that confirms a **posted** receipt is wrong (e.g. Global Precast 61833: 65 pipes × 2.5 m = 162.5 m, not 65 m) → `reassign_receipt` with the expected current quantity and the site's answer as the reason. +- An answer you can't act on, or a vague one → ask a follow-up `request_site_decision`. +- Questions still open: leave them, and count them in your report. + +## 4. Foreman's other findings +- "Posted receipts that look wrong": verify against the photo and PO. Fix with `reassign_receipt` only when the photo or a site answer proves it. Otherwise ask the site. +- Supplier duplicates: `merge_suppliers` only when the names, registration or VAT numbers show it's the same company. Otherwise list it for David. +- Flags for deletion: check the reason holds, and leave them for David. + +## Rules +- **Never book**: no `post_delivery`, `post_delivery_line`, `correct_delivery_receipt`. The site manager presses Confirm delivery. +- Never accept an excess without a site answer that approves it. +- Never delete. Use `request_deletion` with a reason. +- Every write: a new UUID v4 `operationId` and a reason. + +## Your report +Write it to `foreman/runs/dn-inbox-review/.md` and also give it as your final message: +- Line 1: `REVIEW: OK` (nothing needs David) or `REVIEW: ATTENTION ()`. +- **Ready for the site manager**: per site, document, supplier, PO, total excl VAT, "checked". This is the list they confirm from. +- **What I changed**: tool, document, reason. +- **Where Foreman was wrong**: so his skill can be improved, with the exact mistake. +- **Waiting for site**: count per site and the oldest question's age. +- **Needs David**: anything that is a decision for him, e.g. a deletion, a supplier merge, a price dispute.