首页龙虾技能列表 › Invoice Scan — 技能工具

Invoice Scan — 技能工具

v2.2.0

AI-powered invoice OCR, scanning, and data extraction. 适用于: (1) user needs OCR or text extraction from invoice images, scanned documents, or PDFs, (2) s...

0· 430·0 当前·0 累计
by @mr-muddle·MIT-0
下载技能包
License
MIT-0
最后更新
2026/4/11
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
medium confidence
The skill's code, install steps, and runtime instructions are consistent with an invoice OCR/extraction tool; nothing in the bundle appears intentionally deceptive, but there are a few pragmatic caveats (networking in CLI mode, local Node dependency) you should review before use.
评估建议
This skill appears to do what it says, but review and consider the following before installing or using it: - Privacy: CLI mode sends base64-encoded invoice images (which include PII and financial details) to api.anthropic.com. Only use CLI mode if sending that data to a third party is acceptable; prefer agent-native mode for local-only extraction if you must avoid data exfiltration. - API keys: Use a limited/monitored ANTHROPIC_API_KEY for CLI automation; do not reuse high-privilege keys. The...
详细分析 ▾
用途与能力
Name/description match the files and behavior: this is an invoice OCR/extraction tool. Requested binary (node) and optional ANTHROPIC_API_KEY align with the two modes (CLI → Anthropic, agent-native → local). No unrelated credentials or binaries are requested.
指令范围
SKILL.md explicitly separates two modes: 'agent-native' (use agent vision; do NOT call scanInvoice) and 'CLI standalone' (requires ANTHROPIC_API_KEY and sends base64 images to api.anthropic.com). That scope is reasonable, but the instructions ask the agent to require local JS (require('{SKILL_DIR}/scripts') and call formatOutput()). Calling local scripts requires a Node runtime and the installed scripts; ensure your agent environment supports executing local Node code. Also note the CLI mode transmits PII (supplier/buyer names, bank details, amounts) to Anthropic as base64 images — the SKILL.md warns about this.
安装机制
Install is an npm install --production in scripts/, pulling standard packages (sharp, xlsx). This is a packaged-registry install (moderate risk vs. pure instruction-only). There are no downloads from arbitrary URLs or extract-from-unknown-host steps. Be aware 'sharp' may trigger native builds on install.
凭证需求
Only ANTHROPIC_API_KEY is declared (optional), which matches needing an API key for the Anthropic/Claude provider. The code contains a small mapping for other providers (OPENAI/GEMINI env names) but they are not required by this skill. One small inconsistency: the SKILL.md treats ANTHROPIC_API_KEY as optional for agent-native mode, but the core scanInvoice() function (used by CLI) will throw if no apiKey is provided — this is expected for CLI but worth noting so the agent or a user doesn't accidentally call the CLI path without credentials.
持久化与权限
Skill does not request always:true and does not modify other skills. It uses normal agent invocation. The bundle writes code to disk only if you run the npm install step; there is no automatic persistent system-wide privilege requested.
scripts/extraction/scanner.js:62
File read combined with network send (possible exfiltration).
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv2.2.02026/3/13

Schema completeness checker — local validation catches missing fields at zero token cost; Retry pass for missing critical/important fields — sends focused re-extraction prompt with __NOT_ON_DOCUMENT__ sentinel; Merge + re-validate pipeline recovers fields the first pass missed; Completeness metadata in every output (score, populated, missing, retryRecovered); prepare.js agent-native mode also gets completeness warnings

● 无害

安装命令 点击复制

官方npx clawhub@latest install invoice-scan
镜像加速npx clawhub@latest install invoice-scan --registry https://cn.clawhub-mirror.com

技能文档

⚠️ Privacy Notice

CLI mode sends base64-encoded invoice images to Anthropic's API (api.anthropic.com). Invoice data (supplier/buyer names, addresses, IBANs, bank details, amounts) will be transmitted to a third-party service. Confirm this is acceptable under your privacy and compliance requirements before use. Consider dedicated API credentials with usage limits.

Agent-native mode does NOT send data externally — the agent uses its own built-in vision. Only formatOutput() is called locally for CSV/Excel export.

Setup

Install dependencies (required before first use):

cd {SKILL_DIR}/scripts && npm install --production

Dependencies: sharp (image processing), xlsx (Excel export). Review scripts/package.json before installing.

CLI mode requires: ANTHROPIC_API_KEY environment variable. Agent-native mode requires: nothing — uses agent's built-in vision capability.

Two Modes

Mode 1: Agent-Native (No API Key, No External Calls)

Use your built-in vision to look at the invoice image directly. Do NOT call scanInvoice() — that function requires an API key and sends data externally. Instead:

  • Look at the image with your vision capability
  • Extract all fields into a JSON object matching the canonical schema in references/canonical-schema.md
  • Classify document type: invoice, credit-note, receipt, purchase-order, delivery-note, confirmation, statement, other-financial, not-financial
  • Validate arithmetic and business rules per references/validation-rules.md
  • Present results (see Output Format below)
  • For CSV/Excel export, construct the canonical JSON object and pass it to formatOutput() only:
const { formatOutput } = require('{SKILL_DIR}/scripts');
// invoiceData = the JSON object YOU built from your vision extraction
// IMPORTANT: include ALL fields from canonical-schema.md, including charges[]
// e.g. invoiceData.charges = [{ type: 'shipping', label: 'P&P', amount: 5.99, vatRate: 20, vatAmount: 1.20 }]
const csv = formatOutput(invoiceData, 'csv');    // string — local only
const xlsx = formatOutput(invoiceData, 'excel');  // Buffer — local only

Key: formatOutput() is purely local — no network calls, no API key needed. It just formats your extracted data into CSV or Excel.

Mode 2: CLI Standalone (Needs API Key)

For automation or pipelines. Requires ANTHROPIC_API_KEY env var.

ANTHROPIC_API_KEY= node {SKILL_DIR}/scripts/cli.js scan  [--format json|csv|excel] [--output result.json]

Options: --provider claude, --accept strict|relaxed|any, --no-preprocess, --model

Agent-Native Extraction Checklist

Extract ALL of:

Header: invoiceNumber, invoiceDate (YYYY-MM-DD), dueDate, currency (ISO 4217), supplierName, supplierAddress, supplierVatNumber, buyerName, buyerAddress, buyerVatNumber, paymentTerms, paymentReference, bankDetails (iban, bic, accountNumber, sortCode)

Line items: description, quantity, unitOfMeasure, unitPrice, lineTotal, vatRate, sku, discount

References: PO, contract, GRN, timesheet, project, proforma, invoice (original invoice if this is a credit/debit memo), credit-note, debit-note refs. For credit/debit memos, ALWAYS include the original invoice reference.

Totals: netTotal, vatBreakdown (rate + amount + type per band — type is the tax regime label e.g. "CGST", "SGST", "USt", "НДС", "IVA"), vatTotal, grossTotal, amountPaid, amountDue, discount (invoice-level discount amount), discountRate (percentage)

Metadata: paidDate (YYYY-MM-DD — date from PAID stamp), vatInclusive (true if line totals include VAT, false if net, null if unknown)

Charges: Surcharges/fees outside line items — shipping, postage, P&P, delivery, freight, carriage, dispatch, handling, insurance, eco-levy, surcharges. Each: type (shipping|handling|insurance|surcharge|discount|other), label (original text from document), amount, vatRate, vatAmount. Do NOT duplicate items already captured as line items.

Document type: documentType (invoice, credit-note, debit-note, receipt, purchase-order, delivery-note, confirmation, statement, other-financial, not-financial)

Additional: handwritten notes, stamps/seals (type + text), remarks/comments, document language (ISO 639-1)

Arithmetic Validation

  • qty × unitPrice = lineTotal (per line)
  • Sum of lineTotals = netTotal
  • netTotal + vatTotal = grossTotal
(Tolerance: ±0.02 for rounding)

Locale Numbers

Parse regional formats automatically: US/UK (1,234.56), European (1.234,56), French (1 234,56), Indian (1,23,456.78). Use currency/country context when ambiguous.

Quality Score

Count present from: invoiceNumber, invoiceDate, currency, supplierName, buyerName, supplierVatNumber, netTotal, vatTotal, grossTotal. Score = present / 9. good ≥ 0.8, partial ≥ 0.5, poor < 0.5.

Output Format

📄 Invoice #{number} | {date}
   Supplier: {name} → Buyer: {name}
   Net: {currency}{net} | VAT: {currency}{vat} | Gross: {currency}{gross}
   [if charges exist] 📦 Charges: {label} {currency}{amount} [per charge]
   [if amountDue is not null] Amount Due: {currency}{amountDue} [if amountPaid] (Paid: {currency}{amountPaid})
   Items: {count} | Arithmetic: ✅/❌ | Quality: {rating} ({score}/9)

List warnings/flags, then offer: "Want JSON, CSV, or Excel?"

File Delivery

  • Output directory: {WORKSPACE}/invoice-scan/output/ (create if needed)
  • Naming: {supplierName}_{invoiceNumber}_{invoiceDate}.{ext} (replace spaces/slashes with hyphens)
  • Always save JSON automatically, offer CSV/Excel on request
  • Send file as chat attachment + confirm path

References

  • Full schema: references/canonical-schema.md
  • Validation rules: references/validation-rules.md
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务