SKILL.md Scaffold

@neura-marketCoding00

The anatomy of a well-formed OpenClaw SKILL.md — frontmatter, trigger description, instructions, and when to split out references.

#starter#skills#scaffold
SKILL.md

SKILL.md scaffold

---
name: pdf-invoice-extract
description: >
  Extract line items, totals, and VAT from PDF invoices into CSV. Use when
  the user mentions invoices, receipts, or asks to "get the numbers out of"
  a PDF.
---

# PDF Invoice Extraction

## When to use this skill

The user hands you one or more PDF invoices and wants structured data —
line items, totals, tax amounts, vendor, date.

## Steps

1. Convert each PDF to text. If the text layer is empty, it is a scan —
   say so and stop; do not hallucinate numbers from OCR you did not run.
2. Extract: vendor, invoice number, date, currency, each line item
   (description, qty, unit price), net, VAT, gross.
3. Cross-check: line items must sum to the net total. If they do not,
   report the discrepancy instead of "fixing" it.
4. Write one CSV per invoice next to the source file; report the paths.

## Hard rules

- Never invent a value for an unreadable field — emit an empty cell and a
  warning.
- Amounts keep their original currency; no silent conversion.

Notes on the format

  • The description is what gets matched when deciding to load the skill — put the user's likely words in it, not implementation detail.
  • Keep SKILL.md under ~150 lines. Long lookup tables, format specs, and worked examples belong in references/ and examples/ next to it, loaded only when needed.
  • Write steps as decisions, not prose. The failure cases ("it is a scan") earn their lines; happy-path narration does not.