Northwind Components ERP Task Skill
API Access Habits
- Base URL: Use the remote ERP URL from
environment_access.md(e.g.http://34.46.77.124:8007). Do not default tolocalhostor127.0.0.1unless the access file explicitly says so. - Read-only GET endpoints:
/products,/products/<sku>,/customers,/customers/<customer_id>,/warehouses,/inventory,/purchase_orders,/orders,/orders/<order_id>,/shipping/quote,/incidents,/suppliers,/boms,/boms/<bom_id>. - Query parameters:
/inventory?warehouse_id=&sku=/purchase_orders?supplier_id=&sku=&status=(status values:open,confirmed)/orders?wave=&required_date=&customer_id=/shipping/quote?warehouse_id=&destination_zip=&weight_lb=&speed=/incidents?start=&end=&supplier_id=&sku=&incident_type=&status=
- Shipping quote response uses the key
total_cost(nottotal_cost_usd). Round it to 2 decimals when populatingtotal_cost_usdin output.
Inventory & Stock Conventions
- Effective available at a warehouse =
on_hand - reserved - quarantined. Never treat reserved or quarantined stock as freely available. - Effective available can be negative when
quarantined > on_hand. Report the raw computed integer unless the template explicitly asks formax(0, …). If the template says “integer units”, the raw value is usually expected. - Product master has
active(boolean),safety_stock,overstock_threshold,unit_cost,weight_lb,supplier_id. - Inactive SKUs (
active == false) are a first-class exception that typically forcesmanual_revieworescalate_product_masterdepending on the task type.
Sorting & Rounding Rules
- Currency: always round to exactly 2 decimal places (
round(value, 2)). - Percentages: round to 1 decimal place when the template says so.
- Durations / averages: round to 2 decimal places when required.
- List ordering: follow the template literally. Common sorts:
order_idascendingskuascendingsupplier_idascending- For transfers:
skuascending, thenquantitydescending, thenfrom_warehouse_idascending. - For scorecards / supplier rows:
supplier_idascending. - For escalations:
incident_countdescending, thentotal_resolution_costdescending, thensupplier_idascending.
- Dedup before sorting:
affected_skus,sample_incident_ids, and similar lists must be deduplicated before sorting.
Controlled Vocabulary & Field Mapping
Customers → Exceptions
Map account_status and risk_flag to the exact enum values in the template:
account_status == "blocked"→account_blockedaccount_status == "review_required"→review_required(oraccount_review_requiredwhen the template uses that enum value)risk_flag == "fraud_watch"→fraud_watchrisk_flag == "credit_watch"→credit_watch- No flags →
none
Expedite / Dispatch Decisions
inventory_statusorder of precedence:- Any inactive SKU →
inactive_skuorinactive_and_shortageif there is also a shortage. - Any shortage (
effective < line qty) →shortage. - Any low-stock SKU (
effective >= qtybuteffective < safety_stock) →low_stock. - Otherwise →
ready.
- Any inactive SKU →
final_decision/next_actionmust be chosen from the allowed enums. Customer exceptions and inventory status interact; the exact precedence is task-specific, so prefer the most restrictive condition that applies to the line or order.- Shipping quotes must be requested for every order in the memo, even if the decision is hold or backorder. Weight = sum of
quantity * weight_lbacross all lines.
Allocation Desk (Mixed-Warehouse Transfer)
- Blocked orders: orders stopped at account or customer-risk level. The list should contain order IDs where the customer is
blocked,fraud_watch,credit_watch, orreview_required(the exact set depends on the task; include all non-nonecustomer-risk statuses unless the memo narrows it). - Every line in a blocked order should still appear in
line_actionswithaction = manual_reviewand the appropriateprimary_reason. - Transfer logic:
shipif requested-warehouse effective available ≥ line quantity.transferif requested warehouse cannot fill the line, but a single other warehouse has enough effective available to cover the uncovered quantity without using protected stock.backorderif no single warehouse can cover the uncovered quantity.- For a transfer line,
ship_quantity= usable requested-warehouse quantity (max(0, req_eff)),transfer_quantity= line qty − ship_quantity, andtransfer_fromis the source warehouse. requested_effective_availableshould be the raw computed integer (can be negative).
Kit Replenishment (WH_WEST pattern)
- Compute
total_requiredper SKU by summingquantity_per_kit * build_quantityacross all target BOMs. target_effective_available= current effective stock at the planning site.gap = max(0, total_required − target_effective_available).- Timely POs: sum quantities of
openorconfirmedpurchase orders for the same warehouse and SKU whose ETA is on or before the build date (use the earliest build date that needs the SKU as the cutoff). Store PO IDs incoverage_po_ids. - Overstock check: if
target_effective_available > overstock_threshold, the component is typically excluded (target_overstock). - If no gap and not overstock →
no_action_stocked/stocked_no_gap. - If timely POs cover the gap →
timely_po_covered/timely_po_covers_gap. - Otherwise, evaluate inter-warehouse transfers from other warehouses. Transferable quantity at a source =
max(0, source_eff − safety_stock)or simplymax(0, source_eff)depending on the task memo; use the source with the largest feasible quantity first. - Remaining gap after transfers becomes
purchase_requisition_qty. excluded_componentsshould list every SKU whoseexclusion_reason != none.
Supplier Scorecards
- Filter incidents by
open_dateinside the analysis window (inclusive). - Duration:
- Closed incidents: calendar days from
open_datetoclose_date. - Open incidents: calendar days from
open_datetoanalysis_date.
- Closed incidents: calendar days from
- Percentage =
supplier_incident_count / total_filtered_incidents * 100, rounded to 1 decimal. - Recommendation policy precedence is strict: evaluate codes in the order given (e.g.
ESCALATE_SUPPLIER→PROCESS_REVIEW→WATCHLIST→MONITOR). Stop at the first match. highest_cost_supplier_id= maxtotal_resolution_cost(tie-break bysupplier_idascending).highest_share_supplier_id= maxincident_percentage(tie-break by cost, thensupplier_id).
Quality-Hold / Procurement Review
- Count incidents in the requested window per supplier.
- Count
recent_rma_count(incident_type ==RMA),severe_or_critical_count(severityinhighorcritical), andopen_incident_count(status == open). affected_skus= sorted unique SKU list from that supplier’s incidents.sample_incident_ids= sorted incident IDs, capped at 5.held_po_idsper supplier = sortedopenorconfirmedpurchase order IDs for that supplier.- Global
held_po_ids= union of all per-supplier held PO IDs (usually only for suppliers whose decision is notmonitor_only).
Common Pitfalls
- Do not process orders that are in the wave but not in the task memo. The memo defines the exact population.
- Do not invent endpoints (e.g.
/shipping,/calculate_shipping). Only use the endpoints listed inenvironment_access.md. - Do not forget to include
quarantinedwhen computing effective available. - Do not assume
total_cost_usdexists in the shipping-quote response; the field istotal_cost. - Watch for negative effective available values when
quarantined > on_hand; report the raw integer unless the template explicitly caps it. - Rounding must be exact: 2 decimals for currency, 1 decimal for percentages where specified.
- Sorting is part of correctness; always sort lists before embedding them in the answer.
- Enum values are case-sensitive and must match the template exactly.