Skill · Workflow
document-intake-extract-verify
Labels each pasted document (contract, invoice, RFP, resume, report), extracts its fields, checks each value against a verbatim quote and flags risks. Exports JSON or CSV after you approve. Use when asked to run the "Document intake: classify, extract and verify" workflow.
The skill itself. Agents read the name and description first and load the rest only when a task matches.
document-intake-extract-verify/SKILL.md
---
name: document-intake-extract-verify
description: "Labels each pasted document (contract, invoice, RFP, resume, report), extracts its fields, checks each value against a verbatim quote and flags risks. Exports JSON or CSV after you approve. Use when asked to run the \"Document intake: classify, extract and verify\" workflow."
---
# Document intake: classify, extract and verify
Labels each pasted document (contract, invoice, RFP, resume, report), extracts its fields, checks each value against a verbatim quote and flags risks. Exports JSON or CSV after you approve.
## Inputs
Ask for any of these that the user hasn't given:
- `documents` (e.g. "Paste the document text (4,000 characters max per run; for long contracts paste the clauses you care about). Separate documents with a line containing only ---")
- `fields` (e.g. "cost center, project code")
- `priorities` (e.g. "We're the buyer. Flag auto-renewals, any liability cap under 12 months of fees, and invoices without a PO.")
- `output_format` (e.g. "JSON")
## Steps
Run the steps in order. Refer to saved results by name. Don't skip a step that says STOP.
1. **Manual start** — Start: Paste {{documents}} (4,000 characters max), separated by lines containing only ---. Optional: extra {{fields}}, {{priorities}} for the risk review, {{output_format}} (JSON or CSV).
2. **List and label the documents** — Split {{documents}} on lines containing only ---. Per part: doc number, type (contract, invoice, RFP, resume, research report, other), confidence (high, medium, low), evidence, title or first line, word count, and whether it looks cut off. Table, then a last line: 'Batch: single type <type>' or 'Batch: mixed'. Save the result as `inventory`.
3. **Pick the extraction schema** — From {{inventory}}: one shared type uses its route (resumes and research reports: 'Report or resume'); mixed types or any 'other' use 'Mixed batch'. Pick one route: Save the result as `extraction`.
- **Contract**: From each document in {{documents}}: parties (legal names, roles), effective date, term, renewal (automatic?, notice), termination (cause, convenience, notice), fees and payment terms, price-change rights, liability cap and exclusions, indemnities (who covers whom), governing law and venue, confidentiality term, IP ownership, assignment and change of control, exclusivity or non-compete, unusual clauses. Plus: {{fields}}
Table doc | field | value | quote with the shortest verbatim quote per value; missing = 'not found', no quote. Don't infer or compute.
- **Invoice**: From each document in {{documents}}: vendor name, address, tax ID, invoice number and date, due date, payment terms, PO, bill-to, currency, line items (description, quantity, unit price, amount), subtotal, tax (rate, amount), total, payment details. Plus: {{fields}}
Table doc | field | value | quote with the shortest verbatim quote per value; missing = 'not found', no quote. Don't infer or convert currencies. Add two 'derived' rows per invoice with the math: line items vs subtotal, subtotal plus tax vs total, each 'matches' or the difference.
- **RFP**: From each document in {{documents}}: issuer, title and reference, submission deadline (date, time, time zone), question deadline, submission method and format, page limits, each 'must' or 'shall' requirement as a numbered row, desirable requirements, criteria with weights, budget, contract length, eligibility, required documents, contact. Plus: {{fields}}
Table doc | field | value | quote with the shortest verbatim quote per value; missing = 'not found', no quote. Don't infer.
- **Report or resume**: From each document in {{documents}}. Resume: name, location, contact, roles (company, title, dates), skills, education, certifications, gaps over 6 months (marked 'derived'). Research report: title, authors, organization, date, question, method, sample size and population, findings with numbers, stated limitations, funding or conflicts. Plus: {{fields}}
Table doc | field | value | quote with the shortest verbatim quote per value; missing = 'not found', no quote. Infer nothing except 'derived' rows.
- **Mixed batch**: Extract from {{documents}} by each type in {{inventory}}. Contract: parties, dates, term, renewal and notice, termination, fees, liability cap, indemnities, governing law, unusual clauses. Invoice: vendor, tax ID, number, dates, PO, currency, line items, subtotal, tax, total, payment details, plus 'derived' math checks (line items vs subtotal; subtotal plus tax vs total). RFP: issuer, deadlines with time zone, submission method, mandatory requirements, weighted criteria, budget. Resume: name, roles with dates, skills, education. Report: title, authors, date, method, sample size, findings, limitations. Other: title, parties, dates, amounts, obligations. Plus: {{fields}}
Table doc | type | field | value | quote with the shortest verbatim quote per value; missing = 'not found', no quote. Infer nothing except 'derived' rows.
4. **Verify every field against the source** — Re-read {{documents}} and mark every row of {{extraction}}:
- verified: the quote is in that document (ignoring spacing) and supports the value
- corrected: the quote is real but misread; give the fix
- not found: no quote, or it isn't there; clear the value
Derived rows pass only if the math is shown on verified values. Add rows for fields wrongly marked 'not found'. Return the table with type and status columns, then counts per status. Save the result as `verified`.
5. **Plain-English summary and red flags** — For each document in {{verified}}, write an actionable plain-English summary under 100 words, then red flags (high, medium, low) citing field and quote. Use only verified or corrected values.
Check at least: contracts: auto-renewal with notice over 60 days, uncapped or one-sided liability or indemnity, unilateral price changes, one-sided termination, assignment without consent. Invoices: totals that don't add up, missing PO or tax ID, repeated numbers, the due date (state it so the reviewer can check it hasn't passed), payment details that differ between one vendor's invoices or a request to pay a new account (a fraud sign: confirm by phone on a number you already have). RFPs: deadline up front, pass/fail requirements, unweighted scoring. Reports: small samples, missing method. Resumes: unexplained gaps.
Weigh the user's priorities (may be blank): {{priorities}}
Say when a check fails for a 'not found' field. End with: 'This is a reading aid, not legal or accounting advice.' Save the result as `summary`.
6. **Format the export** — Turn {{verified}} into {{output_format}} (JSON if blank). JSON: an array of {doc, type, field, value, quote, status}, value null when not found. CSV: header doc,type,field,value,quote,status; values double-quoted, inner quotes doubled; one row per line item (line_item_1, line_item_2…). Return only the data. Save the result as `export`.
7. **Spot-check and approve** — STOP and ask the user to approve before continuing: Spot-check 3+ values against the originals, starting with corrected rows and high flags; note fixes in the approval note. Approve to export; reject to stop.
8. **Save the extraction** — Finish: Return {{export}} and {{summary}}.
## Done when
Every step has run, each approval was given, and you've reported what was produced and where it was saved.