Tasks in this group require querying a shared ProcureOps API and producing structured JSON outputs for procurement operations: nomination reviews, receiving/AP exception reviews, AP close files, and change requests. The API is the authoritative source of truth; local memos and packets provide context and anchors but must be cross-checked against live API records.
API Access
Base URL: Provided by the task runner, or start the local environment at http://127.0.0.1:8006.
Expected endpoints (discover dynamically via root path or OpenAPI docs if available):
/programs or /programs/{program_id}
/purchase_orders or /purchase_orders/{po_id}
/receipts or /receipts/{receipt_id}
/ap/invoices or /ap/invoices/{invoice_id}
/ap/payments or /ap/payments?invoice_id={id}
/suppliers or /suppliers/{supplier_id}
/contracts or /contracts/{contract_id}
/budget_snapshots or /budget_snapshots/{snapshot_id}
/items/{sku}
/requisitions or /requisitions/{id}
/approvals or /approval_events
/vendor_risk_events or /vendor_risk_events?supplier_id={id}
SOP: API Exploration
Probe the root URL (GET /) to discover available endpoints or an OpenAPI spec.
If the service is not running, start it per the task environment instructions (e.g., Docker, script, or direct launch).
Query endpoints with filters (e.g., ?program_id=AX17) to narrow records rather than fetching everything.
Cache responses locally to avoid redundant calls during analysis.
Source Precedence Hierarchy
ProcureOps API records — absolute source of truth for all quantities, statuses, prices, and IDs.
Local chargeback register (if present in task payloads) — authoritative for approved/pending chargeback amounts.
Local memos / packets — provide narrative context, PO aliases, and target anchors. Treat as supporting only, not as overrides for API data.
If a memo references IDs not found in the API (e.g., PO-73xx aliases), follow any explicit ID mapping provided in the local packet.
Important: net_release_amount does not subtract pending_chargeback_amount. Pending amounts keep the invoice on hold; approved amounts are netted for release.
Find latest approval event for the source requisition.
approval_ok = latest action is approved or equivalent.
Supplier risk check:
supplier_risk_ok = no severe open risk events.
Sort open_event_ids ascending.
Decision matrix:
If !ceiling_ok → reject_contract_mismatch
If !budget_ok && !approval_ok → hold_for_budget_and_approval
If !budget_ok → hold_for_budget
If !approval_ok → hold_for_approval
If !supplier_risk_ok → hold_for_supplier_risk
Else → release_amendment
6. Nomination Review Rules
For each SKU / supplier line:
Gather POs, receipts, invoices, and risk events from API.
readiness_status:
ready — contract in place, receipt evidence exists, no open risk, no AP hold
at_risk — minor issues (e.g., partial receipt, conditional approval)
not_ready — major blockers
blocker_codes (sorted ascending; use none if no blockers):
missing_contract
supplier_watch
open_supplier_risk
ap_hold
pending_receipt
late_due_date
committee_action:
nominate_now_supplier_ids — all ready lines
conditional_supplier_ids — at_risk lines
hold_supplier_ids — not_ready lines
send_to_committee = yes if any line is not ready
Common Pitfalls
PO-73xx alias trap: Exact PO-73xx or RC-44xx IDs may not exist in the shared API environment. When a local packet provides generated IDs (e.g., po_luma_ax17_7321, rc_luma_ax17_4401), use those for API queries and output. Do not fabricate IDs.
Unit price changes: If a PO was modified (e.g., AX12 from $150 to $165), chargebacks and variances use the current/modified unit price, not the original. Verify against the live PO record.
Duplicate receipt risk: When a memo indicates a Vantix receipt (e.g., RC-3854) may have been received under a Luma receipt (e.g., RC-4401), flag this in followup_actions as hold_luma_duplicate_receipt_for_separate_invoice or ask_receiving_for_vantix_receipt.
Quantity vs. value chargebacks: Chargeback amounts are monetary (USD), not unit counts. Compute as rejected_qty * unit_price unless the local register specifies an exact amount.
Sorting: Many evaluator checks sort lists internally, but you should still emit them sorted ascending. Do not rely on evaluator sorting for pass/fail.
Empty lists vs. null: When a field expects a list and there are no items, emit [] (empty array), not null.
Inspection hold timing: An inspection hold may be mentioned in a memo but not yet reflected in ProcureOps. If the API shows no hold but the memo/local packet says there is one pending, use the local context for decision logic and note the discrepancy in follow-up actions.
Currency rounding: Perform all arithmetic at full precision, then round the final result to 2 decimals. Do not round intermediate values.
Three-way match definition: Match PO quantity → Receipt quantity → Invoice quantity. A variance at any leg is an exception.
Evidence tracking: For receiving batch reviews, record which endpoint record IDs and task payloads were reviewed in the evidence object. This supports auditability.
Read input/payloads/answer_template.json to understand exact output schema.
Read local memo / packet / JSON for context and ID anchors.
Discover and query ProcureOps API endpoints.
Cross-reference API data with local context; resolve alias mappings.
Compute quantities, variances, financials, and decisions.
Populate all required output fields per template.
Sort all ID lists ascending.
Round all currency to 2 decimals, ratios to 4, percentages to 1.
Emit only the JSON object (no markdown, no extra text).
1---2name: self-attempt-02-353description: ProcureOps API Task Group Skill4---5# ProcureOps API Task Group Skill67## Overview89Tasks in this group require querying a shared ProcureOps API and producing structured JSON outputs for procurement operations: nomination reviews, receiving/AP exception reviews, AP close files, and change requests. The API is the **authoritative source of truth**; local memos and packets provide context and anchors but must be cross-checked against live API records.1011## API Access1213- **Base URL**: Provided by the task runner, or start the local environment at `http://127.0.0.1:8006`.14- **Expected endpoints** (discover dynamically via root path or OpenAPI docs if available):15 - `/programs` or `/programs/{program_id}`16 - `/purchase_orders` or `/purchase_orders/{po_id}`17 - `/receipts` or `/receipts/{receipt_id}`18 - `/ap/invoices` or `/ap/invoices/{invoice_id}`19 - `/ap/payments` or `/ap/payments?invoice_id={id}`20 - `/suppliers` or `/suppliers/{supplier_id}`21 - `/contracts` or `/contracts/{contract_id}`22 - `/budget_snapshots` or `/budget_snapshots/{snapshot_id}`23 - `/items/{sku}`24 - `/requisitions` or `/requisitions/{id}`25 - `/approvals` or `/approval_events`26 - `/vendor_risk_events` or `/vendor_risk_events?supplier_id={id}`2728### SOP: API Exploration29301. Probe the root URL (`GET /`) to discover available endpoints or an OpenAPI spec.312. If the service is not running, start it per the task environment instructions (e.g., Docker, script, or direct launch).323. Query endpoints with filters (e.g., `?program_id=AX17`) to narrow records rather than fetching everything.334. Cache responses locally to avoid redundant calls during analysis.3435## Source Precedence Hierarchy36371. **ProcureOps API records** — absolute source of truth for all quantities, statuses, prices, and IDs.382. **Local chargeback register** (if present in task payloads) — authoritative for approved/pending chargeback amounts.393. **Local memos / packets** — provide narrative context, PO aliases, and target anchors. Treat as **supporting only**, not as overrides for API data.404. If a memo references IDs not found in the API (e.g., PO-73xx aliases), follow any explicit ID mapping provided in the local packet.4142## Task Type Identification4344| Task Pattern | Output Template Shape | Key Focus |45|--------------|----------------------|-----------|46| Nomination review | `nomination_lines[]`, `committee_action` | Supplier readiness, blockers, risk events |47| Receiving batch review | `inspection_summary`, `line_reconciliation[]`, `invoice_review`, `decision` | Receipt-to-PO-to-invoice three-way reconciliation |48| AP close | `invoice_decisions[]`, `vendor_balances[]`, `payment_hold_queue`, `payment_release_queue`, `total_close_balance` | Post-inspection payment release/hold decisions |49| Receiving/AP release (packet-based) | `release_decisions[]`, `receiving_exceptions[]`, `summary` | Exception review with chargeback netting |50| Change request | `contract_check`, `program_budget_check`, `approval_check`, `supplier_risk_check`, `required_actions[]` | Contract ceiling, budget headroom, approval status, risk gates |5152Always read `input/prompt.txt` and `input/payloads/answer_template.json` to confirm the exact required output shape for the task at hand.5354## Universal Output Conventions5556- **ID lists**: Always sort ascending (lexicographically for strings).57- **Dates**: Use `YYYY-MM-DD` format.58- **Currency**: USD, rounded to **2 decimal places** (cents).59- **Ratios**: Round to **4 decimal places** (e.g., `0.9867`).60- **Percentages**: Round to **1 decimal place**.61- **Boolean fields**: Use literal JSON booleans (`true`/`false`), not strings.62- **Enums**: Use exact allowed strings from the template; casing matters.63- **Sets / lists with set semantics**: The evaluator may sort values; you should still sort ascending before emitting.64- **task_id**: Emit exactly the value specified in the answer template (e.g., `train_005`).6566## Business Rules by Domain6768### 1. Quantity Reconciliation (Receiving / AP Release)6970For each PO line or receipt:71- `ordered_qty` ← from PO record72- `received_qty` ← sum of accepted quantities from receipt records73- `rejected_qty` ← sum of rejected / inspection-hold quantities74- `billed_qty` ← from AP invoice line75- `short_qty_vs_po` = `ordered_qty - received_qty`76- `unreceived_billed_qty` = `billed_qty - received_qty` (when positive)77- `receipt_completion_ratio` = `received_qty / ordered_qty` (4 decimals)7879**Exception code mapping** (apply zero or more):80- **Underage Quantity** — `received_qty < ordered_qty`81- **Severe Unmatched Quantity** — large discrepancy (context-dependent, often >10% or memo-defined threshold)82- **Inspection Hold** — any units pending quality review83- **AP Quantity Variance** — `billed_qty != received_qty`8485### 2. Invoice Release Decisions8687Per invoice, evaluate:881. Does a receipt exist for the PO? If **no** → `hold_missing_receipt`, reason `no_receipt_on_po`.892. Is there an approved chargeback? If **yes** → `release_net_after_approved_chargeback`, reason `approved_qty_chargeback`.903. Is there a pending quality/chargeback hold? If **yes** → `hold_pending_quality_chargeback`, reason `inspection_hold_pending_chargeback`.914. Is there an AP quantity variance? If **yes** → decide based on magnitude and approval status.9293**Financial calculations**:94- `invoice_total` ← from API invoice record95- `approved_chargeback_amount` ← sum of approved chargebacks from local register or API96- `pending_chargeback_amount` ← sum of pending chargebacks97- `net_release_amount` = `invoice_total - approved_chargeback_amount`9899**Important**: `net_release_amount` does **not** subtract `pending_chargeback_amount`. Pending amounts keep the invoice on hold; approved amounts are netted for release.100101### 3. Chargeback Status Rules102103| Scenario | chargeback_status | resolution_status |104|----------|-------------------|-------------------|105| Chargeback approved | `approved` | `net_release_ready` |106| Quality review pending with chargeback request | `pending_quality_review` | `hold_for_quality_review` |107| No discrepancy, no hold | `not_applicable` | `accepted_no_receiving_exception` |108| No receipt on file | `not_applicable` | `missing_receipt` |109110### 4. AP Close File Rules111112For each invoice in scope:113- `quantity_billed` vs `quantity_received`114- `quantity_variance` = `quantity_billed - quantity_received`115- `quantity_variance_pct` = `(quantity_variance / ordered_qty) * 100` (1 decimal)116- **Reason codes** (alphabetical):117 - `APPROVED_THREE_WAY_MATCH` — all quantities align118 - `NO_RECEIPT` — no receipt exists119 - `QTY_VARIANCE` — billed ≠ received120 - `SCHEDULED_PAYMENT_FOUND` — payment already scheduled121122**Hold / release logic**:123- `HOLD` if any exception exists (no receipt, variance, pending hold).124- `RELEASE` if three-way match is clean or exceptions are approved.125- `release_to_payment` = `true` only for `RELEASE` decisions.126127**Vendor balance**:128- `close_balance` = `opening_balance + invoice_total - scheduled_payments`129- `balance_status`:130 - `OPEN_HELD` — has held invoices131 - `OPEN_APPROVED` — all invoices releasable132 - `FULLY_SCHEDULED` — payments cover all invoices133134### 5. Change Request Rules135136**Contract check**:137- `headroom_before_change` = `ceiling_amount - noncancelled_subtotal`138- `requested_subtotal` = `requested_quantity * unit_price`139- `headroom_after_change` = `headroom_before_change - requested_subtotal`140- `ceiling_ok` = `headroom_after_change >= 0`141142**Program budget check**:143- `remaining_budget` = `budget_cap - committed_amount`144- `requested_total` = `requested_subtotal + requested_tax`145- `budget_after_change` = `remaining_budget - requested_total`146- `budget_ok` = `budget_after_change >= 0`147- `max_quantity_with_current_budget` = `floor(remaining_budget / unit_price)`148149**Approval check**:150- Find latest approval event for the source requisition.151- `approval_ok` = latest action is `approved` or equivalent.152153**Supplier risk check**:154- `supplier_risk_ok` = no `severe` open risk events.155- Sort `open_event_ids` ascending.156157**Decision matrix**:158- If `!ceiling_ok` → `reject_contract_mismatch`159- If `!budget_ok && !approval_ok` → `hold_for_budget_and_approval`160- If `!budget_ok` → `hold_for_budget`161- If `!approval_ok` → `hold_for_approval`162- If `!supplier_risk_ok` → `hold_for_supplier_risk`163- Else → `release_amendment`164165### 6. Nomination Review Rules166167For each SKU / supplier line:168- Gather POs, receipts, invoices, and risk events from API.169- `readiness_status`:170 - `ready` — contract in place, receipt evidence exists, no open risk, no AP hold171 - `at_risk` — minor issues (e.g., partial receipt, conditional approval)172 - `not_ready` — major blockers173- `blocker_codes` (sorted ascending; use `none` if no blockers):174 - `missing_contract`175 - `supplier_watch`176 - `open_supplier_risk`177 - `ap_hold`178 - `pending_receipt`179 - `late_due_date`180- `committee_action`:181 - `nominate_now_supplier_ids` — all `ready` lines182 - `conditional_supplier_ids` — `at_risk` lines183 - `hold_supplier_ids` — `not_ready` lines184 - `send_to_committee` = `yes` if any line is not `ready`185186## Common Pitfalls1871881. **PO-73xx alias trap**: Exact PO-73xx or RC-44xx IDs may not exist in the shared API environment. When a local packet provides generated IDs (e.g., `po_luma_ax17_7321`, `rc_luma_ax17_4401`), use those for API queries and output. Do not fabricate IDs.1891902. **Unit price changes**: If a PO was modified (e.g., AX12 from $150 to $165), chargebacks and variances use the **current/modified unit price**, not the original. Verify against the live PO record.1911923. **Duplicate receipt risk**: When a memo indicates a Vantix receipt (e.g., RC-3854) may have been received under a Luma receipt (e.g., RC-4401), flag this in `followup_actions` as `hold_luma_duplicate_receipt_for_separate_invoice` or `ask_receiving_for_vantix_receipt`.1931944. **Quantity vs. value chargebacks**: Chargeback amounts are monetary (USD), not unit counts. Compute as `rejected_qty * unit_price` unless the local register specifies an exact amount.1951965. **Sorting**: Many evaluator checks sort lists internally, but you should still emit them sorted ascending. Do not rely on evaluator sorting for pass/fail.1971986. **Empty lists vs. null**: When a field expects a list and there are no items, emit `[]` (empty array), not `null`.1992007. **Inspection hold timing**: An inspection hold may be mentioned in a memo but not yet reflected in ProcureOps. If the API shows no hold but the memo/local packet says there is one pending, use the local context for decision logic and note the discrepancy in follow-up actions.2012028. **Currency rounding**: Perform all arithmetic at full precision, then round the **final result** to 2 decimals. Do not round intermediate values.2032049. **Three-way match definition**: Match PO quantity → Receipt quantity → Invoice quantity. A variance at any leg is an exception.20520610. **Evidence tracking**: For receiving batch reviews, record which endpoint record IDs and task payloads were reviewed in the `evidence` object. This supports auditability.207208## Calculation Quick Reference209210```211short_qty_vs_po = ordered_qty - received_qty212unreceived_billed_qty = max(0, billed_qty - received_qty)213receipt_completion_ratio = received_qty / ordered_qty [round to 4 decimals]214quantity_variance = quantity_billed - quantity_received215quantity_variance_pct = (quantity_variance / ordered_qty) * 100 [round to 1 decimal]216net_release_amount = invoice_total - approved_chargeback_amount217close_balance = opening_balance + invoice_total - scheduled_payments218headroom_after_change = ceiling_amount - noncancelled_subtotal - requested_subtotal219budget_after_change = budget_cap - committed_amount - requested_total220max_quantity_with_budget = floor(remaining_budget / unit_price)221```222223## Workflow Checklist2242251. [ ] Read `input/prompt.txt` and identify task type.2262. [ ] Read `input/payloads/answer_template.json` to understand exact output schema.2273. [ ] Read local memo / packet / JSON for context and ID anchors.2284. [ ] Discover and query ProcureOps API endpoints.2295. [ ] Cross-reference API data with local context; resolve alias mappings.2306. [ ] Compute quantities, variances, financials, and decisions.2317. [ ] Populate all required output fields per template.2328. [ ] Sort all ID lists ascending.2339. [ ] Round all currency to 2 decimals, ratios to 4, percentages to 1.23410. [ ] Emit **only** the JSON object (no markdown, no extra text).
Run npx skillmds@latest add prism-shadow/self-attempt-02-35 in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
ProcureOps API Task Group Skill It is listed under Integrations & APIs on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
prism-shadow (@prism-shadow) published this skill. Their other Agent Skills are listed on their SkillMD profile.