# doc-extract

The doc-extract skill for Claude Code extracts plain text from binary document formats without writing files to disk. The agent invokes it when turning contracts or EHR attachments into text.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 110 installs · ★ 456 repo stars
- Author: anthropics · official Anthropic repository
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/anthropics/healthcare/tree/HEAD/plugins/healthcare/skills/doc-extract/SKILL.md
- Updated: 2026-08-27
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/doc-extract

## What it does

The script reads an input file and prints JSON to stdout without creating caches or temporary files. Setting it up requires running `bun install` in the skill directory to pull in liteparse and rtf-to-text. Without this setup, PDFs still work via a `pdftotext` fallback if poppler is installed, but other binary formats require liteparse.

Multi-column tables can interleave cells line by line during extraction, requiring verification against the original page when an answer comes from such a table. The script accepts a `--content-type` parameter for files lacking a useful extension like downloaded EHR attachments. Because liteparse refuses extensionless files, those PDFs go through the `pdftotext` fallback.

Errors print to stderr and exit with code 1. Other skills import the extraction functions directly in TypeScript, and the contracts MCP server bundles its own copy to remain self-contained.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add anthropics/healthcare --skill doc-extract -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/doc-extract/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/doc-extract/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add anthropics/healthcare --skill doc-extract -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/doc-extract/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add anthropics/healthcare --skill doc-extract -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/doc-extract/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install anthropics/healthcare plugins/healthcare/skills/doc-extract
```

2. **Manually: put the files in place**
- File: `.github/skills/doc-extract/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add anthropics/healthcare --skill doc-extract -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/anthropics/healthcare --path plugins/healthcare/skills/doc-extract
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/doc-extract/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add anthropics/healthcare --skill doc-extract -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/anthropics/healthcare/tree/HEAD/plugins/healthcare/skills/doc-extract/SKILL.md

## When to use it
- extract plain text from a PDF file
- convert a DOCX or XLSX document into JSON
- parse an RTF document into readable text
- process an extensionless file with a custom mime type

## Example prompts
- Extract text from the file `contract.pdf`
- Turn the document `report.docx` into JSON output
- Parse the attached file using `--content-type application/pdf`

## Similar
- [office-oxide-mcp](https://affpapa.org/en/nevibecode/mcp/office-oxide-mcp.md) — MCP server · ★ 165 repo stars
- [shuck-file](https://affpapa.org/en/nevibecode/mcp/shuck-file.md) — MCP server · ★ 6 repo stars
- [genoffice](https://affpapa.org/en/nevibecode/skills/genoffice.md) — skill · ★ 12746 repo stars
- [office-productivity](https://affpapa.org/en/nevibecode/skills/office-productivity.md) — skill · 1600 installs
- [office-repair](https://affpapa.org/en/nevibecode/skills/office-repair.md) — skill · 144 installs
- [OfficeAgent.NET](https://affpapa.org/en/nevibecode/mcp/officeagentnet.md) — MCP server · ★ 30 repo stars

From the same set: [anthropics/healthcare](https://affpapa.org/en/nevibecode/by/anthropics/healthcare.md) — 9 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
