AP Duplicate Payment Preflight
Overview
Use this skill to turn an accounts payable export into a reviewable duplicate-payment exception report. The goal is to stop risky payments before release while preserving enough evidence for AP staff to decide whether each exception is a true duplicate, a credit/rebill, or an intentional recurring charge.
Use And Do Not Use
Use for:
- AP payment-run review before ACH, wire, card, or check release.
- Bill, invoice, vendor, or payment exports from QuickBooks, NetSuite, Xero, Sage, Bill.com, Ramp, Coupa, SAP, Oracle, or an internal AP workflow.
- Finding invoice-number variants such as
INV-1007, INV1007, 1007, and OCR spacing differences.
- Catching vendor alias duplicates, duplicate vendor masters, paid-versus-pending resubmissions, and same-amount close-date collisions.
- Producing an exception pack that AP can review before approving payment.
Do not use for:
- Automatically cancelling, approving, or modifying payments in a live accounting system.
- Tax, audit, or legal conclusions. This skill produces operational review evidence.
- Fraud accusations. Label findings as duplicate-payment risk unless the user provides confirmed investigation results.
- Bank reconciliation across private bank feeds unless the user provides local exports and asks for local analysis.
Required Inputs
Ask only for missing inputs that materially affect the decision:
- CSV or JSON export path, or a pasted sample if file access is unavailable.
- Column mapping if headers are non-obvious. Preferred fields:
vendor_name, vendor_id, invoice_number, invoice_date, payment_date, amount, currency, status, po_number.
- Payment-run state: pending, approved, paid, or mixed.
- Review policy: same-vendor exact match, date window, vendor alias tolerance, recurring payment allowlist, and whether credits/rebills are expected.
- Output preference: Markdown report, CSV exception list, or both.
If the user only has a screenshot or a short sample, produce a sample-limited review and do not give a release decision for the full payment run.
Workflow
1. Preserve The AP Review Boundary
Before classifying a duplicate, capture:
- Vendor name and vendor ID when present.
- Invoice number in raw and normalized forms.
- Amount, currency, invoice date, payment date, and status.
- Purchase order or memo if present.
- Whether a row is already paid, pending, approved, voided, credited, or reversed.
Read references/duplicate-payment-rules.md before classifying vendor aliases, recurring charges, credits, rebates, or tax/utility invoices.
2. Run The Local Preflight
Use the bundled script with explicit paths:
python3 ap-duplicate-payment-preflight/scripts/ap_duplicate_payment_preflight.py \
--payments /absolute/path/ap_export.csv \
--date-window-days 14
The script accepts CSV or JSON. JSON may be a list of payment objects or an object containing payments, invoices, bills, or rows.
3. Classify Exceptions
Use one primary action:
hold_payment: same vendor or vendor alias, same normalized invoice number, same amount and currency, or a paid-versus-pending collision.
ap_review: near match with same amount and close dates, missing invoice number, vendor alias, or same PO.
allow_with_note: recurring, credit/rebill, tax, utility, rent, or subscription pattern that still needs the reviewer note recorded.
no_exception: no meaningful duplicate signal.
Use one primary risk:
high: exact invoice/amount match, paid-versus-pending collision, or vendor alias with same invoice and amount.
medium: same amount within the review window with similar vendor or invoice, missing invoice number, or same PO with different invoice number.
low: weak same-amount signal, common vendor, recurring context, or insufficient metadata.
Never recommend release when high-risk exceptions remain unresolved.
4. Produce The Exception Report
Return:
## Payment Run Decision
[Hold payment run / Release after AP review / No material duplicate risk found]
## Duplicate Exceptions
| Risk | Action | Rows | Vendor | Invoice | Amount | Evidence | Reviewer next step |
|---|---|---|---|---|---:|---|---|
## Controls Checked
[Exact invoice match, normalized invoice match, vendor alias, same amount/date window, paid-versus-pending collision, PO collision]
## Safe Release Steps
[Rows to hold, rows to confirm, rows allowed with reviewer note, export/archive instruction]
## Open Questions
[Only items that affect payment release safety]
Use templates/exception-report.md when the user asks for a reusable AP review artifact.
5. Apply Guardrails Before Advising Payment Release
Do not advise release until:
- High-risk exceptions have a reviewer disposition.
- Paid and pending rows have been separated.
- Credits, reversals, voids, and rebills are not misread as duplicate payments.
- Vendor alias evidence is labeled as probable, not certain.
- The user has a way to hold or remove exception rows before payment release.
Examples And Acceptance Checks
Positive example: "Use $ap-duplicate-payment-preflight on this QuickBooks bills export before we approve ACH." The skill should run the script, catch normalized invoice duplicates, paid-versus-pending collisions, and produce hold/review rows.
Positive alias example: "Our vendor master has Acme Services LLC and Acme Services as separate vendors." The skill should compare normalized vendor names and IDs, then mark same invoice/amount pairs for AP review.
Negative example: "Pay all invoices that look okay." Do not approve payments or operate a live AP system; produce a review report only.
Boundary example: "I pasted five rows from a screenshot." Produce sample-limited observations and ask for the export before making a payment-run decision.
Validation
Smoke-test the bundled fixture:
python3 ap-duplicate-payment-preflight/scripts/ap_duplicate_payment_preflight.py \
--payments ap-duplicate-payment-preflight/scripts/fixtures/ap_payments.csv \
--date-window-days 14
Expected result: a Markdown report with Payment Run Decision, at least one hold_payment, at least one ap_review, paid_vs_pending_collision, and row numbers for reviewer follow-up.
1---2name: ap-duplicate-payment-preflight3description: Inspect accounts payable invoice, bill, or payment-run exports for exact and near duplicate payments before release. Use when finance, operations, or founders need to catch duplicate supplier invoices, vendor aliases, resubmitted bills, invoice-number variants, and paid-versus-pending collisions without connecting to an ERP or exposing credentials.4---56# AP Duplicate Payment Preflight78## Overview910Use this skill to turn an accounts payable export into a reviewable duplicate-payment exception report. The goal is to stop risky payments before release while preserving enough evidence for AP staff to decide whether each exception is a true duplicate, a credit/rebill, or an intentional recurring charge.1112## Use And Do Not Use1314Use for:1516- AP payment-run review before ACH, wire, card, or check release.17- Bill, invoice, vendor, or payment exports from QuickBooks, NetSuite, Xero, Sage, Bill.com, Ramp, Coupa, SAP, Oracle, or an internal AP workflow.18- Finding invoice-number variants such as `INV-1007`, `INV1007`, `1007`, and OCR spacing differences.19- Catching vendor alias duplicates, duplicate vendor masters, paid-versus-pending resubmissions, and same-amount close-date collisions.20- Producing an exception pack that AP can review before approving payment.2122Do not use for:2324- Automatically cancelling, approving, or modifying payments in a live accounting system.25- Tax, audit, or legal conclusions. This skill produces operational review evidence.26- Fraud accusations. Label findings as duplicate-payment risk unless the user provides confirmed investigation results.27- Bank reconciliation across private bank feeds unless the user provides local exports and asks for local analysis.2829## Required Inputs3031Ask only for missing inputs that materially affect the decision:3233- CSV or JSON export path, or a pasted sample if file access is unavailable.34- Column mapping if headers are non-obvious. Preferred fields: `vendor_name`, `vendor_id`, `invoice_number`, `invoice_date`, `payment_date`, `amount`, `currency`, `status`, `po_number`.35- Payment-run state: pending, approved, paid, or mixed.36- Review policy: same-vendor exact match, date window, vendor alias tolerance, recurring payment allowlist, and whether credits/rebills are expected.37- Output preference: Markdown report, CSV exception list, or both.3839If the user only has a screenshot or a short sample, produce a sample-limited review and do not give a release decision for the full payment run.4041## Workflow4243### 1. Preserve The AP Review Boundary4445Before classifying a duplicate, capture:4647- Vendor name and vendor ID when present.48- Invoice number in raw and normalized forms.49- Amount, currency, invoice date, payment date, and status.50- Purchase order or memo if present.51- Whether a row is already paid, pending, approved, voided, credited, or reversed.5253Read `references/duplicate-payment-rules.md` before classifying vendor aliases, recurring charges, credits, rebates, or tax/utility invoices.5455### 2. Run The Local Preflight5657Use the bundled script with explicit paths:5859```bash60python3 ap-duplicate-payment-preflight/scripts/ap_duplicate_payment_preflight.py \61 --payments /absolute/path/ap_export.csv \62 --date-window-days 1463```6465The script accepts CSV or JSON. JSON may be a list of payment objects or an object containing `payments`, `invoices`, `bills`, or `rows`.6667### 3. Classify Exceptions6869Use one primary action:7071- `hold_payment`: same vendor or vendor alias, same normalized invoice number, same amount and currency, or a paid-versus-pending collision.72- `ap_review`: near match with same amount and close dates, missing invoice number, vendor alias, or same PO.73- `allow_with_note`: recurring, credit/rebill, tax, utility, rent, or subscription pattern that still needs the reviewer note recorded.74- `no_exception`: no meaningful duplicate signal.7576Use one primary risk:7778- `high`: exact invoice/amount match, paid-versus-pending collision, or vendor alias with same invoice and amount.79- `medium`: same amount within the review window with similar vendor or invoice, missing invoice number, or same PO with different invoice number.80- `low`: weak same-amount signal, common vendor, recurring context, or insufficient metadata.8182Never recommend release when high-risk exceptions remain unresolved.8384### 4. Produce The Exception Report8586Return:8788```markdown89## Payment Run Decision90[Hold payment run / Release after AP review / No material duplicate risk found]9192## Duplicate Exceptions93| Risk | Action | Rows | Vendor | Invoice | Amount | Evidence | Reviewer next step |94|---|---|---|---|---|---:|---|---|9596## Controls Checked97[Exact invoice match, normalized invoice match, vendor alias, same amount/date window, paid-versus-pending collision, PO collision]9899## Safe Release Steps100[Rows to hold, rows to confirm, rows allowed with reviewer note, export/archive instruction]101102## Open Questions103[Only items that affect payment release safety]104```105106Use `templates/exception-report.md` when the user asks for a reusable AP review artifact.107108### 5. Apply Guardrails Before Advising Payment Release109110Do not advise release until:111112- High-risk exceptions have a reviewer disposition.113- Paid and pending rows have been separated.114- Credits, reversals, voids, and rebills are not misread as duplicate payments.115- Vendor alias evidence is labeled as probable, not certain.116- The user has a way to hold or remove exception rows before payment release.117118## Examples And Acceptance Checks119120Positive example: "Use $ap-duplicate-payment-preflight on this QuickBooks bills export before we approve ACH." The skill should run the script, catch normalized invoice duplicates, paid-versus-pending collisions, and produce hold/review rows.121122Positive alias example: "Our vendor master has Acme Services LLC and Acme Services as separate vendors." The skill should compare normalized vendor names and IDs, then mark same invoice/amount pairs for AP review.123124Negative example: "Pay all invoices that look okay." Do not approve payments or operate a live AP system; produce a review report only.125126Boundary example: "I pasted five rows from a screenshot." Produce sample-limited observations and ask for the export before making a payment-run decision.127128## Validation129130Smoke-test the bundled fixture:131132```bash133python3 ap-duplicate-payment-preflight/scripts/ap_duplicate_payment_preflight.py \134 --payments ap-duplicate-payment-preflight/scripts/fixtures/ap_payments.csv \135 --date-window-days 14136```137138Expected result: a Markdown report with `Payment Run Decision`, at least one `hold_payment`, at least one `ap_review`, `paid_vs_pending_collision`, and row numbers for reviewer follow-up.