Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

ocr-document-processing-skill

БесплатноЗапускает вложенные скриптыНе проверен

Amazon Textract document processing without an MCP server. Extracts reading-order linearized text, raw OCR with low-confidence flagging, tables…

awsот aws★ 3 696 звёзд на GitHub

Об этом скилле

Textract Document Processing

Overview

One AWS CLI call gets you the raw Textract JSON; one bundled parser (scripts/parse.py) turns it into whatever you need — parse.py --mode <mode> dispatches to every parser the Textract MCP server exposed. No MCP server, no boto wrapper, no infrastructure to stand up.

Works best with the AWS MCP server — recommended for sandboxed command execution and audit logging. All guidance here also works with standard AWS CLI access and does not assume any MCP-specific tooling (no call_aws, no run_script); every step is plain aws textract ….

When the AWS MCP server is available, running scripts/parse.py through its run_script tool is the preferred (sandboxed) runtime; it is optional, and the script runs equally well on any host Python 3.10+ interpreter.

This SKILL.md is the always-loaded overview: the routing table, the sync/async decision, and Step 0 setup. The detailed runbooks, worked command templates, and mode-selection guidance live in references/ — load them on demand (see Reference files).

Guardrail — where this skill's own files live (MCP vs local install)

This skill can be loaded two ways, and they resolve the skill's own bundled files (scripts/parse.py, references/*.md) from different places. Determine how the skill was loaded before reading a reference or running a script:

  • Loaded through the AWS MCP retrieve_skill tool: The skill is not installed on the local filesystem. You MUST fetch each reference or script via retrieve_skill with the file parameter (e.g. file="scripts/parse.py", file="references/procedures.md"), and run the script from the returned content. Do NOT file_read these paths locally — they do not exist on disk.
  • Installed locally (e.g. .kiro/skills/ocr-document-processing-skill/ or ~/.claude/skills/ocr-document-processing-skill/): Read and run files from the local skill directory using relative paths.

This distinction applies only to the skill's own packaged files. User data and session artifacts are always read from and written to the user's working directory. Never fetch or write customer data through retrieve_skill.

Runtime requirements — Step 0 (before any Textract call)

parse.py requires a general-purpose Python interpreter, so this skill is display-only on hosts without Python 3.10+. The agent owns setup, not the script (idempotent — safe to run every time):

python3 -c 'from importlib.metadata import version; assert version("amazon-textract-textractor") == "1.10.0"' 2>/dev/null \
  || pip install 'amazon-textract-textractor==1.10.0'
python3 -c 'from importlib.metadata import version; assert version("pandas") == "2.2.3"' 2>/dev/null \
  || pip install 'pandas==2.2.3'
  • amazon-textract-textractor is Amazon-owned open source.
  • pandas is a required third-party dependency, pinned to 2.2.3 per exact-version pinning per AWS dependency-management best practice. textractor renders reading-order tables in --mode linearize through Table.to_pandas(), so a LAYOUT+TABLES document cannot be linearized without it. Bump the pin only through a reviewed CR, never float to latest.
  • Confirm AWS access: credentials with least-privilege Textract actions (DetectDocumentText, AnalyzeDocument, AnalyzeExpense, AnalyzeID, and the specific Start*/Get* async pairs — not textract:*) plus s3:GetObject on the source prefix, and AWS_REGION set (and AWS_PROFILE if used).
  • parse.py installs nothing. If a required dependency is missing it exits 3 and reprints the install command above: amazon-textract-textractor for any mode, and pandas for the --mode linearize Markdown-table path (textractor renders those tables via Table.to_pandas()). Install both in Step 0 above.

Let $SKILL_DIR = this skill's directory; the parser is $SKILL_DIR/scripts/parse.py.

Which Textract call + mode for each task

Need AWS CLI call (feature types) parse.py mode
Reading-order text analyze-document LAYOUT [TABLES] --mode linearize
Raw OCR + flag low confidence detect-document-text --mode raw-text --flag-below 80
Tables → Markdown / CSV analyze-document TABLES --mode tables [--format csv]
Form key-value pairs analyze-document FORMS --mode forms
Ask a document a question analyze-document QUERIES (+--queries-config) --mode queries
Receipt / invoice analyze-expense --mode expense
Identity document analyze-id --mode identity
Per-block geometry/confidence any Blocks call --mode blocks
Auto-accept ≥80% / human review <80% analyze-document FORMS --mode confidence-route --threshold 80

Combine features in ONE call when you need several (e.g. --feature-types TABLES FORMS LAYOUT) — you pay per feature, so request only what you need, but batch them i

Полный SKILL.md на GitHub

Установить ocr-document-processing-skill в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/parser-and-guidance.mdreferences/procedures.mdreferences/worked-examples.mdscripts/parse.py

FAQ

Что делает скилл ocr-document-processing-skill?

Amazon Textract document processing without an MCP server. Extracts reading-order linearized text, raw OCR with low-confidence flagging, tables (Markdown/CSV), form key-value pairs, QUERIES answers, receipts/invoices (AnalyzeExpense), identity documents (AnalyzeID), per-block geometry and confidence, and the auto-accept/human-review confidence-routing pattern. Use for any OCR or document-understanding task on a PDF or image — "extract text", "reading order", "tables to markdown/CSV", "form fields", "ask this document a question", "parse this receipt", "driver's license fields", "process a 40-page PDF", "batch these documents", or "auto-accept high-confidence fields and flag the rest". Drives the AWS CLI directly (sync plus async polling) and runs a bundled parser (scripts/parse.py). Works in any runtime with AWS credentials (Textract + S3) and Python 3.10+. Also known as intelligent document processing (IDP): handles scanned PDFs, handwriting, and W2, KYC, passport, and claim documents.

Как установить скилл ocr-document-processing-skill?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл ocr-document-processing-skill запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить ocr-document-processing-skill с