ai-document-engine

A local document-reading service that gives coding agents searchable context and stable references for files such as PDFs, Word documents, spreadsheets, slides, emails, archives, Markdown, code, and logs.

In plain words
What is it for?
Use it to analyze local files, search for exact terms, retrieve focused sections, and answer questions grounded in document content.
Why use it?
It avoids manually opening complex file formats and makes it easier to find and refer back to specific parts of a document.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/flyfish-dev/file-ai/ai-document-engine
Any agent
npx skills add flyfish-dev/file-ai --skill ai-document-engine
Clone the repo
git clone --depth 1 https://github.com/flyfish-dev/file-ai

Made for: Claude Code, Codex.

Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 624 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00081 $0.00624
Opus 5 $0.00041 $0.00312
Sonnet 5 $0.00016 $0.00125
Haiku 4.5 $0.00008 $0.00062

Measured 2d ago against content hash e8ca855e8598, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ai-document-engine scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/ai-document-engine/SKILL.md · 37 lines

How it starts

The opening of the file, as written. The whole thing — 37 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AI Document Engine

Use the File AI MCP tools as the source of truth for document content. Do not manually unzip Office files, inspect PDF internals, or infer spreadsheet structure when these tools are available.

File AI format recognition follows the Flyfish File Viewer core registry. Treat profile.format as the authoritative format decision and profile.extraction as the current content-awareness strategy for that format.

Core Workflow

  1. Call doc_analyze with the local file path before answering content questions.
  2. Use profile.indexId for all later calls in the same task.
  3. Use doc_context when the user asks about a topic, section, page, slide, sheet, or nearby content.
  4. Use doc_search for exact terms, entities, clauses, headings, table labels, filenames inside archives, or attachment names.
  5. Use doc_read for a specific anchorId, blockId, or chunkId returned by the engine.
  6. Cite or mention the relevant anchorId values in answers when making document-grounded claims.

Tool Rules

  • Prefer doc_context over reading all chunks when the user asks a focused question.
  • Prefer doc_search before broad summarization if the user provides keywords or entity names.
  • Use doc://{indexId}/profile, doc://{indexId}/outline, and doc://{indexId}/chunks resources only after doc_analyze has cached the document.
  • Treat warnings in profile.warnings as part of the evidence, especially scanned PDFs, clipped sheets, unsupported formats, or best-effort fallback text.
  • Use doc_list_formats when choosing whether a file extension is recognized by File Viewer; do not infer supported formats from extractor names alone.
  • If profile.format.known is true but profile.extraction.structured is false, say the file is recognized by File Viewer but File AI only has metadata or best-effort text for that renderer-only format.
  • For spreadsheets, keep sheet names and row context in the answer when available.
  • For presentations, keep slide numbers in the answer when available.
  • For PDFs, keep page numbers in the answer when available.
  • For archives, report manifest entries and nested paths; do not extract or mutate archive entries unless another explicit tool supports it.

Read the full file on GitHub · 37 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 37 lines · 81 tokens per session scan A e8ca855e8598

Subscribe to this mod's changes

ai-document-engine is a skill published in the GitHub repository flyfish-dev/file-ai (3 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 81 tokens to every session and 624 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

xcodebuildmcp-structured-output-review

Use when reviewing XcodeBuildMCP structured output schema changes, schema versioning, manifest outputSchema metadata, and JSON fixture compatibility.

getsentry/XcodeBuildMCP · 37 tokens

opik-diagnose

Surface the Opik traces worth a developer's attention, ranked by signal — errors, failed tool calls, latency, regressions, and low online-eval scores — plus Diagnostics issues. Reads live/production traces via the SDK (searchtraces and agentinsights) and works with no MCP; uses the MCP issue entity when connected.…

comet-ml/opik-mcp · 147 tokens

cortex-automate

Set up automation — prospective memory triggers, neuro-symbolic rules, and CLAUDE.md sync. Use when the user says 'remind me when', 'trigger when', 'create a rule', 'auto-remember', 'sync to CLAUDE.md', 'push insights', 'set up trigger', 'when I open this file', 'when this keyword appears', or when you want to…

cdeust/Cortex · 93 tokens

tabnexus-mcp-evals

Generate, validate, and run isolated Codex-to-TabNexus MCP evaluations with a curated 600-query dataset, executable gold tool labels, safety checks, and best-of-three stability scoring. Use when testing TabNexus MCP tool coverage, Agent behavior, regression quality, destructive-action safety, prompt changes, or a…

KaichenCurry/TabNexus · 75 tokens

compare

Structured comparison of 2+ alternatives with consistent criteria and decision matrix.

n24q02m/wet-mcp · 15 tokens

maya-shot-export

Pipeline stage — shot-level export: frame ranges, cameras, FBX / Alembic packaging for editorial. Use when packaging shot data for downstream departments. Not for full pipeline publish (maya-pipeline) or scene assembly (maya-scene-assembly).

dcc-mcp/dcc-mcp-maya · 60 tokens