Skip to content
cccskills
FreePublished on GitHub

ap-invoice-match

Process emailed vendor invoices by extracting details, comparing them with purchase orders and invoice history, and recording duplicates, overcharges, or missing orders. Summarize results in Slack for human review; payment approval and execution remain with people.

OriginalShow the original description

Extraction, PO matching, duplicate detection, and overcharge tolerance for processing incoming vendor invoices from {{invoice_label}} against the POs and ledger in {{ap_ledger}}. Load this before extracting a single invoice so every one is checked to the same standard and only genuine exceptions reach a human, with no invoice ever scheduled for payment by the agent.

Works withSlackGmail
See how to install

Good for

  • Checking incoming invoices against purchase orders
  • Finding duplicate invoices and likely resends
  • Reviewing unit prices and remaining order balances
  • Sharing invoice exceptions with approvers in Slack

Files included (1)

  • SKILL.md5.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

<skill name="ap-invoice-match"> <overview> Process every new vendor invoice landing in `{{invoice_label}}` without missing a duplicate or an overcharge, and without ever moving toward payment. A cron fires every `{{cadence}}` against a fresh session; the session has no memory of the last run, so it reads `{{ap_ledger}}` first, pulls new invoice email, extracts vendor/amount/line items, matches each against the PO tab and every prior invoice for that vendor, records the result, and posts the batch to Slack. Recording and flagging are the agent's job; approving and paying are not — those stay with a person on every invoice, clean or flagged. </overview> <when-to-load> - The `{{cadence}}` cron fires the invoice-processing run. - A human asks the agent to re-check a specific invoice or vendor for duplicates or overcharges. - A human asks why an invoice was flagged or missing a PO. </when-to-load> <workflow>

Step 0 — Orient from the ledger, not from memory

This is a fresh session — there is no prior turn to resume. {{ap_ledger}} is the memory.

  1. Open {{ap_ledger}} and read every existing row: vendor, invoice number, amount, PO reference, and flag, so this run's duplicate check has the full history, not just what one person remembers.
  2. Read the PO tab: open PO number, vendor, authorized total, and the agreed price per line item — this is what invoices get matched against.

Step 1 — Pull new invoice email

Check {{invoice_label}} in Gmail for messages not yet reflected in {{ap_ledger}} (match on Gmail message ID or thread ID recorded in the ledger's last column). For each one, download the invoice attachment (PDF, image, or embedded table).

Step 2 — Extract vendor, amount, and line items

From each attachment, extract:

  • Vendor name and, if present, vendor ID/tax ID.
  • Invoice number and invoice date.
  • Total amount due.
  • Every line item: description, quantity, unit price, line total.
  • The PO number referenced on the invoice, if any.

If the attachment is unreadable (corrupt, wrong format, no amount visible), record it in the ledger as unreadable with the email link and skip matching — don't guess at numbers.

Step 3 — Match against the PO

  1. If the invoice references a PO number, look it up in the PO tab.
  2. No PO found (either no PO number on the invoice, or the number doesn't exist in the tab) → flag missing PO.
  3. PO found → compare every line item's unit price against the PO's agreed price for that item:
    • Within tolerance (default: 2%, or whatever {{ap_ledger}}'s notes specify) → matches, no flag on price.
    • Over tolerance on any line → flag overcharge, noting the line item, PO price, and invoiced price.
  4. Compare the invoice total against the PO's remaining authorized balance (PO total minus amounts already invoiced against it, per the ledger). An invoice that would exceed the PO's authorized total → flag overcharge regardless of per-line pricing.

Step 4 — Check for duplicates

Compare the new invoice against every existing row in {{ap_ledger}} for the same vendor:

  • Same invoice number already recorded → duplicate, exact.
  • Different invoice number but same amount, same or near-identical line items, and a date within 30 days of a prior invoice from the same vendor → duplicate, likely resend — flag it, don't silently merge or drop it.

Step 5 — Record every invoice

Append one row per invoice to {{ap_ledger}}, flagged or clean: vendor, invoice number, date, amount, PO reference (or "missing"), line items (or a link to the attachment), flag (clean / duplicate / overcharge / missing-po / unreadable), and the Gmail message ID so this run and future runs can tell what's already processed.

Step 6 — Post the batch for approval

Post to {{approval_channel}}: every invoice processed this run, grouped clean vs. flagged, each with its ledger row and (for flags) the specific PO line or prior invoice it conflicts with. Ask for approval to proceed to payment through the normal AP process — do not imply the agent has already approved or scheduled anything.

Step 7 — Stop — never touch payment

Your last action is the Slack post. You never schedule a payment, mark an invoice as paid, or write to any payment rail or accounting system beyond {{ap_ledger}}. A clean match is still a person's decision to pay.

</workflow> <guardrails> - **No payment action, ever.** The agent has no connector or instruction that schedules a payment or marks an invoice as paid — not even for a clean, fully matched invoice. That step is always a human's. - **Record, don't discard.** An unreadable, duplicate, or overcharged invoice is still recorded in `{{ap_ledger}}` with its flag — never silently dropped. - **No force-matching.** An invoice with no PO, or a PO match that doesn't clear tolerance, is flagged as-is. Don't invent a PO reference or round an overcharge down to make it look clean. - **One flag reason per exception.** State exactly which line, PO, or prior invoice triggered a duplicate/overcharge/missing-PO flag so the approver doesn't have to re-derive it. - **Scoped, brokered credentials.** Gmail, Sheets, and Slack access are injected into the sandbox at runtime, scoped to this agent's grant. - **Idempotent per run.** Match new invoices against the ledger's Gmail message IDs before processing so the same email is never recorded twice across runs. </guardrails> </skill>

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

access-policy

FreeSummary

Review Slack access requests against Okta role and team information, then prepare narrowly scoped GitHub or AWS IAM permissions. Apply changes only after an eligible person's approval and record the grant, reasoning, approver, and timestamp.

  • Reviewing GitHub repository access requests from Slack
  • Preparing AWS IAM permissions for a specific task
  • Routing sensitive access requests for additional review
kortix-ai/suna20.3KUpdated Oct 18, 2026

account-research

FreeSummary

Research companies and people before outreach or meetings. Combines business profiles, recent news, hiring signals, and key contacts into a sourced brief with talking points and suggested questions, adding relationship history when CRM data is connected.

  • Research a prospective customer before outreach
  • Prepare background information for meeting attendees
  • Compare a competitor's products and positioning
kortix-ai/suna20.3KUpdated Oct 18, 2026

Review daily Google Ads and Meta Ads results for budget pacing, declining performance, and unusual activity. Get prioritized findings with supporting numbers and concrete recommendations for a marketing team to assess and carry out.

  • Checking whether campaign budgets are being spent on schedule
  • Investigating rising acquisition costs or falling ad returns
  • Finding ads and keywords that spend without converting
kortix-ai/suna20.3KUpdated Oct 18, 2026

agent-browser

FreeSummary

Automate website tasks such as navigating pages, filling forms, clicking buttons, taking screenshots, and extracting data. The skill also supports web app testing, with specialized guides for Electron desktop apps, Slack, and cloud browsers.

  • Automate form entry and page navigation
  • Capture screenshots and extract page data
  • Explore web apps for bugs
kortix-ai/suna20.3KUpdated Oct 18, 2026

billing

FreeSummary

Guide changes to Kortix billing code, admin controls, and pricing screens. Explain how plans, trials, enterprise contracts, and access exceptions should work, where pricing is defined, and which audited routes must handle account changes.

  • Update billing logic and its specification together
  • Review how trials and enterprise contracts are handled
  • Find the code that defines prices and allowances
kortix-ai/suna20.3KUpdated Oct 18, 2026

Monitor public news, social platforms, and forums for new brand mentions. Remove previously reported results, classify sentiment, and send a Slack digest with response drafts for negative or notable mentions, leaving public replies to people.

  • Track new brand mentions each day
  • Identify negative or widely seen mentions
  • Prepare response drafts for human review
kortix-ai/suna20.3KUpdated Oct 18, 2026

See all skills by kortix-ai

Report a problem with this skill