# text-comparison-validator

A subagent that checks extracted text against an existing markdown file, line by line. It flags missing words, typos, formatting drift and paragraph structure problems, then reports them with line numbers.

- subagent · `type=agent` · Claude Code · 545 installs
- Author: davila7
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/agents/ocr-extraction-team/text-comparison-validator.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/agents/text-comparison-validator

## What it does

It runs as a separate agent inside Claude. You hand it two sources: the text after extraction (OCR output, for instance) and the file to compare against. From there it walks the lines and diffs them.

What lands in the report: missing and extra words, substituted characters, typos. Formatting gets its own pass — bullet markers `•` vs `-` vs `*`, numbering styles `1.` vs `1)` vs `(1)`, heading level mismatches, indentation, stray or dropped line breaks. Then structure: paragraphs merged that should stay apart, paragraphs split that belong together, reordered sections.

Output order is fixed. A short summary with an overall accuracy percentage first. Then findings grouped by category: content discrepancies, character errors, formatting, structure. Each item quotes the relevant lines from both sources, explains the difference, gives the line number, and suggests a likely cause such as an OCR error or a formatting glitch. It closes with correction recommendations.

Findings are ranked by severity: critical for missing content, major for clusters of typos or broken paragraphs, minor for formatting and single characters. The agent carries only `Read` and `Write`, so it reads and writes files and runs nothing. When it cannot tell which version is correct, it does not guess — it shows both and asks. Worth knowing before you point it at a document where the right version is not obvious.

## Install

### Claude Code (native platform)

1. **claude-code-templates**
```bash
npx claude-code-templates@latest --agent ocr-extraction-team/text-comparison-validator
```

2. **Manually: put the files in place**
- File: `.claude/agents/text-comparison-validator.md` — For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

### Codex

**Manually: put the files in place**
- File: `.codex/agents/text-comparison-validator.toml` — Codex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/

### Cursor

**Manually: put the files in place**
- File: `.cursor/agents/text-comparison-validator.md` — Cursor also reads .claude/agents/

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/agents/ocr-extraction-team/text-comparison-validator.md

## When to use it
- check OCR output against the original markdown file
- catch missing and extra words across two document versions
- spot mismatched bullet markers and numbering styles
- find merged and split paragraphs
- get a correction list with line numbers

## Example prompts
- Compare the extracted text in `output.txt` against `source.md` and list the line-by-line differences
- Check `draft.md` against `reference.md` and flag typos and formatting issues
- Diff these two files and rank the findings as critical, major and minor

## Similar
- [image-to-text](https://affpapa.org/en/nevibecode/skills/image-to-text.md) — skill · 713 installs
- [portable-text-serialization](https://affpapa.org/en/nevibecode/skills/portable-text-serialization.md) — skill · 2900 installs
- [MinerU Open MCP](https://affpapa.org/en/nevibecode/mcp/mineru-open-mcp.md) — MCP server · ★ 229
- [markitdown](https://affpapa.org/en/nevibecode/skills/julianobarbosa-markitdown.md) — skill · 1600 installs
- [paddleocr-doc-parsing](https://affpapa.org/en/nevibecode/skills/paddleocr-doc-parsing.md) — skill · 471 installs
- [markdown-converter](https://affpapa.org/en/nevibecode/skills/steipete-markdown-converter.md) — skill · 339 installs

From the same set: [davila7/claude-code-templates](https://affpapa.org/en/nevibecode/by/davila7/claude-code-templates.md) — 205 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
