document-interpretation

Classifies document type and extracts key fields from raw text into structured JSON.

1|Updated Jun 21, 2026
One-click install
npx skills add https://github.com/tapway/shogun-os --skill document-interpretation-tapway
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: document-interpretation
Source: https://github.com/tapway/shogun-os/tree/main/skills/general/document-interpretation
Command: npx skills add https://github.com/tapway/shogun-os --skill document-interpretation-tapway

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Raw text from OCR or pasted content is unstructured and hard to act on. This Skill turns that text into a structured JSON object with a document type, type-specific extracted fields, and a concise 3-line summary, bridging the gap between OCR output and document storage. ## Core Features & Use Cases - Document Classification: Identifies six document types — invoice, quotation, legal contract, purchase order, delivery order, or other — using an LLM classification prompt. - Type-Specific Field Extraction: Applies dedicated extraction schemas per document type (e.g., vendor, invoice_number, total, due_date for invoices; parties and key_clauses for legal contracts) defined in references/field-schemas.md. - 3-Line Summary Generation: Produces a Telegram-friendly summary covering type/vendor, key amount or obligation, and key date. - Use Case: After OCR extracts text from a supplier invoice, run this Skill to get {"document_type": "invoice", "fields": {...}, "summary": "..."} ready for downstream storage or retrieval. ## Quick Start Paste the raw text of a document and ask the agent to classify it and extract the key fields using the document-interpretation skill.

Frequently Asked Questions about document-interpretation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract fields from an invoice using LLM prompts?

Classify the text as an invoice first, then apply the invoice extraction prompt from references/field-schemas.md. It returns JSON with vendor_name, invoice_number, dates, line_items, subtotal, tax, total, currency, and payment_terms, using null for missing fields.

What document types can be classified from raw text?

The classification step supports six types: invoice, quotation, legal_contract, purchase_order, delivery_order, and other. Each type has a dedicated extraction schema with fields tailored to that document's structure.

Does document interpretation work on PDF or image files directly?

No, it only accepts raw text input. Use an OCR step first (such as the document-ocr skill) to extract text from PDFs or images, then pass that text here for classification and field extraction.

What is the difference between document-interpretation and document-storage?

Document-interpretation classifies text and extracts structured fields into JSON, while document-storage persists results to the brain. Interpretation sits between OCR and storage in the pipeline and never stores data itself.

Why is my extracted JSON missing some fields?

Fields absent from the source text are returned as null by design, per the extraction prompts. If many fields are null, verify the input text is complete and that the document was classified into the correct type before extraction.