doc-to-md

doc-to-md is a command for Claude Code from MarcosNahuel/antigravity-plugin-cc. It costs 34 tokens per session (805 once invoked), scanned A, original, MIT.

A command for converting PDFs, Word files, images, and other documents into clean Markdown using a multimodal document reader.

In plain words
What is it for?
Use it to convert a document or image into Markdown saved under docs/agy/converted/.
Why use it?
It turns source files into editable text and preserves useful document structure instead of requiring manual transcription.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions subagents.

Part of the antigravity plugin — 2 skills, 22 commands, 1 agent shipped together

Good fit Use it to convert a document or image into Markdown saved under docs/agy/converted/.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/marcosnahuel/antigravity-plugin-cc/doc-to-md
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.

Clone the repo
git clone --depth 1 https://github.com/MarcosNahuel/antigravity-plugin-cc

Made for: Claude Code.

Or install antigravity, the plugin that ships this one along with the rest of its 2 skills, 22 commands, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for doc-to-md

README.md
[![agentmods](https://agentmods.dev/badge/commands/marcosnahuel/antigravity-plugin-cc/doc-to-md/github.svg)](https://agentmods.dev/commands/marcosnahuel/antigravity-plugin-cc/doc-to-md)
Your own site
<a href="https://agentmods.dev/commands/marcosnahuel/antigravity-plugin-cc/doc-to-md"><img src="https://agentmods.dev/badge/commands/marcosnahuel/antigravity-plugin-cc/doc-to-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for doc-to-md

Your own site · 80×15
<a href="https://agentmods.dev/commands/marcosnahuel/antigravity-plugin-cc/doc-to-md"><img src="https://agentmods.dev/badge/commands/marcosnahuel/antigravity-plugin-cc/doc-to-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 805 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00034 $0.00805
Opus 5 $0.00017 $0.00402
Sonnet 5 $0.00007 $0.00161
Haiku 4.5 $0.00003 $0.00081

Measured 9d ago against content hash e8cdfe615746, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

doc-to-md 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 9d 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.

plugins/antigravity/commands/doc-to-md.md · 68 lines

How it starts

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

Route this to the antigravity:agy-rescue subagent in MODE: doc-to-md.

Raw user request: $ARGUMENTS

Routing rules

  1. Parse the file path: the first whitespace-separated token of $ARGUMENTS that resolves to an existing file (check with test -f) IS the source file. Convert relative paths to absolute. If no valid file is found, ask once: "Which file should I convert?".

  2. Extraction focus: everything else in $ARGUMENTS (anything that's not the path) is optional natural-language guidance on what to focus on (e.g., "extract only the pricing tables and ignore the legal boilerplate"). Empty by default = "produce a faithful full-fidelity markdown conversion".

  3. Detect file type via extension:

    • .pdf → PDF (multimodal)
    • .docx, .doc → Word (multimodal or text)
    • .png, .jpg, .jpeg, .webp, .gif → image (multimodal — OCR + structure inference)
    • .html, .htm → HTML (text)
    • other → text or warn
  4. Slug: lowercase the source filename base (without extension), non-alphanumeric → -, collapse repeats, trim to 60 chars.

  5. Date: today in YYYY-MM-DD (local time).

  6. Paths (relative to current working directory):

    • OUTPUT_DIR = docs/agy/converted/
    • WRITE_FILE = docs/agy/converted/<date>-<slug>.md
  7. Pre-flight (ONE Bash call):

    mkdir -p docs/agy/converted
    
  8. Hand off: pass this header to the subagent:

    MODE: doc-to-md
    SOURCE_FILE: <absolute path>
    FILE_TYPE: pdf|docx|image|html|other
    FOCUS: <natural-language focus or empty>
    CWD: <absolute path to current working directory>
    WRITE_FILE: docs/agy/converted/<date>-<slug>.md
    

Operating rules

  • The subagent invokes agy with --add-dir <CWD> so it can write the result.
  • For PDF / docx / image, agy uses Gemini's multimodal vision capabilities — preserves tables, lists, headings, code blocks. Inline images become ![description](image-extraction-note) placeholders.
  • The subagent reports:
    1. Saved markdown path.
    2. Original file path and detected type.
    3. First ~30 lines of the conversion (preview).
    4. Pages/sections processed.
  • Present that to the user as-is.
  • If the file is too large (>200 MB) or the format is unsupported, surface the error verbatim. Suggest splitting or pre-processing.

Read the full file on GitHub · 68 lines

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. 9d ago First seen · 68 lines · 34 tokens per session scan A e8cdfe615746

Subscribe to this mod's changes

doc-to-md is a command published in the GitHub repository MarcosNahuel/antigravity-plugin-cc (28 stars, last pushed 24d ago), licensed MIT. It adds 34 tokens to every session and 805 once invoked, about $0.0002 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-30.