Northwind ERP Skill
Quick Start
- Read the task prompt and identify which Northwind workflow it follows
(expedite, allocation, replenishment, scorecard, or procurement control).
- Read the input payloads (memo JSON, answer template, etc.).
- Open references/api_reference.md for endpoint
details if you need field names or parameter shapes.
- Open references/business_rules.md for the
rule set applicable to the identified workflow.
- Import scripts/northwind_api.py into your Python
solver for deterministic HTTP, math, and classification helpers.
Python Helper Script
scripts/northwind_api.py is the core reusable
module. It exposes:
- HTTP:
get_json, fetch_index, fetch_one, index_by
- Inventory:
effective_available, usable_for_transfer, inventory_lookup,
warehouse_effective_availabilities
- Products:
product_weight, order_total_weight
- Customers:
classify_customer
- Orders:
classify_inventory_status, shortage_skus, inactive_skus,
low_stock_skus
- Shipping:
get_shipping_quote, shipping_quote_for_order
- Purchase Orders:
timely_pos, timely_po_quantity
- Incidents:
filter_incidents_by_date, incident_duration_days,
group_incidents_by_supplier
- BOMs:
bom_component_totals
- Decisions:
expedite_decision, EXPEDITE_DECISION_TABLE,
allocation_primary_reason, is_allocation_blocked
- Rounding:
usd, pct1, dur
Use the module by copying it into the solving workspace or running Python with
it on sys.path. Do not re-implement these functions from scratch.
API Base URL
The task runner provides the API base URL as <TASK_ENV_BASE_URL> in the prompt
or as the TASK_ENV_BASE_URL environment variable. Pass it explicitly to every
function that accepts base_url=.
Workflow Reference
Open references/business_rules.md for the
full rule set. The key workflows covered:
Expedite Queue
Given a list of order IDs, for each order:
- Fetch the order, its customer, products for each line SKU, and inventory at the order's warehouse.
- Classify inventory status (ready/shortage/etc.) and customer exception.
- Look up the (status, exception) pair in the decision table to get final_decision and next_action.
- Collect shortage_skus, inactive_skus, low_stock_skus.
- Get a shipping quote using the order's warehouse, destination_zip, total weight, and shipping_speed.
- Build summary: decision_counts, blocked/manual_review/backorder lists, total shipping cost.
Kit Replenishment
Given one or more BOM IDs with build quantities at a target warehouse:
- Fetch BOMs, products, inventory (all warehouses), purchase orders.
- Compute total_required per SKU from BOM component quantities.
- Compute target_effective_available at the build warehouse.
- Identify the gap and cover it via timely POs, inter-warehouse transfers, then purchase requisitions.
- Exclude overstock and PO-covered components. Build transfer and purchase lists sorted per the answer template.
Allocation Desk
Given a wave ID:
- Fetch all orders in that wave (filter by
wave field), plus customers, products, inventory, and POs.
- For each line: check customer block status, product active status, then effective inventory.
- Decide ship/transfer/backorder/manual_review per line.
- Build transfer requests, blocked order list, order rollup, and summary counts.
Supplier Incident Scorecard
Given a date window and recommendation policy:
- Fetch all incidents, filter to window.
- Group by supplier, compute counts, costs, durations, severity/status tallies.
- Apply recommendation code logic (ESCALATE_SUPPLIER → PROCESS_REVIEW → WATCHLIST → MONITOR).
- Identify top escalation suppliers, highest cost, highest share.
Procurement Quality Review
Given target supplier IDs and an analysis window:
- Fetch incidents in window, filter to target suppliers.
- Compute per-supplier metrics and apply freeze/buyer_review/monitor_only decision logic.
- Collect held PO IDs from open/confirmed POs for freeze and buyer_review suppliers.
- Compute summary counts.
Answer Templates
Every task provides an answer_template.json in input/payloads/. Parse it
cautiously: the template defines the required JSON shape, field types, enums,
and sort orders, but the solver must fill all fields with live ERP values. Do
not copy template field descriptions or example values into the answer.
Return only the complete JSON object matching the template. No narrative text
outside the JSON.
Key Principles
- Effective available only. Never use
on_hand directly for decisions.
effective_available = on_hand - reserved - quarantined.
- Customer exception dominates inventory. A blocked or fraud-watch customer
overrides stock availability. A review_required customer pushes to manual review.
- Sorted lists. All SKU lists, ID lists, and record arrays must be sorted as
specified by the answer template (typically ascending by string key).
- Currency precision. All USD values rounded to 2 decimal places.
- Use the live API only. Do not read environment files, cached data, or
embedded payload values for decisions that should come from the ERP.
- One API call pattern. Fetch full indexes once (
/products, /orders,
/customers, /inventory, /suppliers, /purchase_orders, /incidents,
/boms) and filter in memory. Avoid per-ID loops that would call
/orders/{id} for each order.
1---2name: northwind-erp-43description: Deterministic helpers, API reference, and business rules for solving Northwind Components ERP tasks (expedite, allocation, replenishment, supplier quality, procurement control). Use this skill when the task input references a Northwind Components ERP API, a shared ERP environment, the Northwind Parcel shipping API, or task descriptions mentioning Northwind manufacturing/supply-chain workflows such as expedite queues, allocation waves, BOM-based kit replenishment, supplier incident scorecards, or procurement quality reviews.4metadata:5 source: https://skillmd.com/skills/prism-shadow/northwind-erp-46---78# Northwind ERP Skill910## Quick Start11121. Read the task prompt and identify which Northwind workflow it follows13 (expedite, allocation, replenishment, scorecard, or procurement control).142. Read the input payloads (memo JSON, answer template, etc.).153. Open [references/api_reference.md](references/api_reference.md) for endpoint16 details if you need field names or parameter shapes.174. Open [references/business_rules.md](references/business_rules.md) for the18 rule set applicable to the identified workflow.195. Import [scripts/northwind_api.py](scripts/northwind_api.py) into your Python20 solver for deterministic HTTP, math, and classification helpers.2122## Python Helper Script2324**[scripts/northwind_api.py](scripts/northwind_api.py)** is the core reusable25module. It exposes:2627- **HTTP**: `get_json`, `fetch_index`, `fetch_one`, `index_by`28- **Inventory**: `effective_available`, `usable_for_transfer`, `inventory_lookup`,29 `warehouse_effective_availabilities`30- **Products**: `product_weight`, `order_total_weight`31- **Customers**: `classify_customer`32- **Orders**: `classify_inventory_status`, `shortage_skus`, `inactive_skus`,33 `low_stock_skus`34- **Shipping**: `get_shipping_quote`, `shipping_quote_for_order`35- **Purchase Orders**: `timely_pos`, `timely_po_quantity`36- **Incidents**: `filter_incidents_by_date`, `incident_duration_days`,37 `group_incidents_by_supplier`38- **BOMs**: `bom_component_totals`39- **Decisions**: `expedite_decision`, `EXPEDITE_DECISION_TABLE`,40 `allocation_primary_reason`, `is_allocation_blocked`41- **Rounding**: `usd`, `pct1`, `dur`4243Use the module by copying it into the solving workspace or running Python with44it on `sys.path`. Do not re-implement these functions from scratch.4546### API Base URL4748The task runner provides the API base URL as `<TASK_ENV_BASE_URL>` in the prompt49or as the `TASK_ENV_BASE_URL` environment variable. Pass it explicitly to every50function that accepts `base_url=`.5152## Workflow Reference5354Open **[references/business_rules.md](references/business_rules.md)** for the55full rule set. The key workflows covered:5657### Expedite Queue5859Given a list of order IDs, for each order:60- Fetch the order, its customer, products for each line SKU, and inventory at the order's warehouse.61- Classify inventory status (ready/shortage/etc.) and customer exception.62- Look up the (status, exception) pair in the decision table to get final_decision and next_action.63- Collect shortage_skus, inactive_skus, low_stock_skus.64- Get a shipping quote using the order's warehouse, destination_zip, total weight, and shipping_speed.65- Build summary: decision_counts, blocked/manual_review/backorder lists, total shipping cost.6667### Kit Replenishment6869Given one or more BOM IDs with build quantities at a target warehouse:70- Fetch BOMs, products, inventory (all warehouses), purchase orders.71- Compute total_required per SKU from BOM component quantities.72- Compute target_effective_available at the build warehouse.73- Identify the gap and cover it via timely POs, inter-warehouse transfers, then purchase requisitions.74- Exclude overstock and PO-covered components. Build transfer and purchase lists sorted per the answer template.7576### Allocation Desk7778Given a wave ID:79- Fetch all orders in that wave (filter by `wave` field), plus customers, products, inventory, and POs.80- For each line: check customer block status, product active status, then effective inventory.81- Decide ship/transfer/backorder/manual_review per line.82- Build transfer requests, blocked order list, order rollup, and summary counts.8384### Supplier Incident Scorecard8586Given a date window and recommendation policy:87- Fetch all incidents, filter to window.88- Group by supplier, compute counts, costs, durations, severity/status tallies.89- Apply recommendation code logic (ESCALATE_SUPPLIER → PROCESS_REVIEW → WATCHLIST → MONITOR).90- Identify top escalation suppliers, highest cost, highest share.9192### Procurement Quality Review9394Given target supplier IDs and an analysis window:95- Fetch incidents in window, filter to target suppliers.96- Compute per-supplier metrics and apply freeze/buyer_review/monitor_only decision logic.97- Collect held PO IDs from open/confirmed POs for freeze and buyer_review suppliers.98- Compute summary counts.99100## Answer Templates101102Every task provides an `answer_template.json` in `input/payloads/`. Parse it103cautiously: the template defines the required JSON shape, field types, enums,104and sort orders, but the solver must fill all fields with live ERP values. Do105not copy template field descriptions or example values into the answer.106107Return only the complete JSON object matching the template. No narrative text108outside the JSON.109110## Key Principles111112- **Effective available only.** Never use `on_hand` directly for decisions.113 `effective_available = on_hand - reserved - quarantined`.114- **Customer exception dominates inventory.** A blocked or fraud-watch customer115 overrides stock availability. A review_required customer pushes to manual review.116- **Sorted lists.** All SKU lists, ID lists, and record arrays must be sorted as117 specified by the answer template (typically ascending by string key).118- **Currency precision.** All USD values rounded to 2 decimal places.119- **Use the live API only.** Do not read environment files, cached data, or120 embedded payload values for decisions that should come from the ERP.121- **One API call pattern.** Fetch full indexes once (`/products`, `/orders`,122 `/customers`, `/inventory`, `/suppliers`, `/purchase_orders`, `/incidents`,123 `/boms`) and filter in memory. Avoid per-ID loops that would call124 `/orders/{id}` for each order.