# document-structure-analyzer

This subagent maps document regions, content hierarchy, and reading order. Use it before OCR when the relationships between headings, tables, and other elements matter.

- subagent · `type=agent` · Claude Code · 1099 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/document-structure-analyzer.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/agents/document-structure-analyzer

## What it does

The subagent examines page layout and content hierarchy. It identifies headings and body text, recognizes tables, lists, and forms, and works out reading order in multi-column pages. It can also assign semantic roles to visual elements and spot recurring document patterns.

Its output can include labeled region maps, hierarchy schemas, reading sequences, and suggestions for OCR preparation. The available tools are `Read` and `Write`, and structural decisions include confidence scores. This is a pre-OCR analysis step, not text recognition itself; OCR requires a separate process.

## Install

### Claude Code (native platform)

1. **claude-code-templates**
```bash
npx claude-code-templates@latest --agent ocr-extraction-team/document-structure-analyzer
```

2. **Manually: put the files in place**
- File: `.claude/agents/document-structure-analyzer.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/document-structure-analyzer.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/document-structure-analyzer.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/document-structure-analyzer.md

## When to use it
- label regions by document content type
- set reading order for multi-column pages
- map headings and body text into a hierarchy
- identify table, list, and form structure
- prepare layout recommendations before OCR

## Example prompts
- Map the regions in this document and label their roles.
- Work out the reading sequence for this multi-column file.
- Identify headings, tables, and forms before OCR.

## Similar
- [code-reviewer](https://affpapa.org/en/nevibecode/agents/anthropic-code-reviewer.md) — subagent · 31050 installs
- [code-reviewer](https://affpapa.org/en/nevibecode/agents/code-reviewer.md) — subagent · 31050 installs
- [security-auditor](https://affpapa.org/en/nevibecode/agents/security-auditor.md) — subagent · 10718 installs
- [test-engineer](https://affpapa.org/en/nevibecode/agents/test-engineer.md) — subagent · 9715 installs
- [frontend-developer](https://affpapa.org/en/nevibecode/agents/voltagent-community-frontend-developer.md) — subagent · 40905 installs
- [code-reviewer](https://affpapa.org/en/nevibecode/agents/voltagent-community-code-reviewer.md) — subagent · 31050 installs

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