agentleFS
leaf76leaf76/agent-skills/image-file-reader/SKILL.md

image-file-reader

Skill0 starsChanged 3 months agoMITView on GitHub

Read files and images in automation-friendly way when multimodal parsing is not available. Use for OCR on screenshots, extracting text from PDFs/TXT/JSON/CSV, and returning structured output for downstream processing. Use when you need deterministic, local file inspection instead of model vision.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If the file is image format, use OCR mode (--ocr) when needed.

    line 19
  2. Distinctive:

    Read multiple files and output JSON:

    line 30
  3. Distinctive:

    Use JSON mode when you need consistent parsing for scripts/agents.

    line 36
  4. Distinctive:

    If no extractor is available, the tool will return a clear, actionable error and suggestions.

    line 54
  5. Distinctive:

    Keep only extracted content and metadata needed for triage.

    line 58
  6. Distinctive:

    If OCR confidence is low or output is empty:

    line 64

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Image and File Reader

Goal

Extract readable content from image and file inputs using local tools so the model can continue analyzing without native multimodal input.

Tools

  • scripts/read_file.py — one command to inspect one or many files.

Core Workflow

  1. Choose files and run the reader.
  2. If the file is image format, use OCR mode (--ocr) when needed.
  3. Return the extracted text (or clear error messages) for downstream reasoning.

Command Patterns

Read one file:

python3 scripts/read_file.py ./screenshot.png --ocr

Read multiple files and output JSON:

python3 scripts/read_file.py ./a.png ./b.pdf ./note.txt --ocr --json

Use JSON mode when you need consistent parsing for scripts/agents.

python3 scripts/read_file.py ./doc.pdf --json > doc_payload.json

Common flags

  • --ocr : Enable OCR for image files.
  • --ocr-lang : OCR language (default eng+chi_tra).
  • --max-chars : Truncate long text output for a safer payload.
  • --json : Output machine-readable JSON object.

Notes

  • OCR needs one of:
    • tesseract CLI (preferred)
  • PDF text extraction prefers pdftotext CLI.
  • If no extractor is available, the tool will return a clear, actionable error and suggestions.

Output Rules

  • Keep only extracted content and metadata needed for triage.
  • Preserve raw text and mention truncation when it happens.
  • Never invent content.

Next-Step Guidance

If OCR confidence is low or output is empty:

  • Re-run with a higher-resolution image.
  • Pre-process image (crop/contrast) before OCR.
  • Provide a manual transcript if needed.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.