doc-parser

doc-parser is a skill for Claude Code, Codex from lowtidebuild/contract-review. It costs 0 tokens per session (559 once invoked), scanned A, original, Apache-2.0.

A tool for checking, identifying, and converting contract files such as DOCX, PDF, Markdown, text, and HTML into consistent text files. It also detects duplicates and flags scanned PDFs that may need OCR, which means turning images of text into readable text.

In plain words
What is it for?
It helps validate file types, create document fingerprints, extract headings, lists, and tables, normalize contracts into Markdown and plain text, and mark likely image-only PDFs.
Why use it?
It avoids handling each document format differently and makes missing text, invalid files, and duplicate documents visible.

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/lowtidebuild/contract-review/doc-parser
Any agent
npx skills add lowtidebuild/contract-review --skill doc-parser
Clone the repo
git clone --depth 1 https://github.com/lowtidebuild/contract-review

Made for: Claude Code, Codex.

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-parser

README.md
[![agentmods](https://agentmods.dev/badge/skills/lowtidebuild/contract-review/doc-parser.svg)](https://agentmods.dev/skills/lowtidebuild/contract-review/doc-parser)
Your own site
<a href="https://agentmods.dev/skills/lowtidebuild/contract-review/doc-parser"><img src="https://agentmods.dev/badge/skills/lowtidebuild/contract-review/doc-parser.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 559 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.00000 $0.00559
Opus 5 $0.00000 $0.00280
Sonnet 5 $0.00000 $0.00112
Haiku 4.5 $0.00000 $0.00056

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

Security

Grade A, and why

doc-parser 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 4d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/detect-format.py, scripts/fingerprint.py, scripts/normalize.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.claude/skills/doc-parser/SKILL.md · 53 lines

How it starts

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

doc-parser Skill

Parse and normalize contract documents from various formats into standardized outputs.

Capabilities

  1. Format Detection (scripts/detect-format.py)

    • Validates file format (DOCX, PDF, MD, TXT, HTML)
    • Checks file integrity via magic bytes
    • Rejects legacy .doc binaries with explicit .docx conversion guidance
    • Usage: python3 detect-format.py <file_path>
  2. Fingerprinting (scripts/fingerprint.py)

    • Computes SHA-256 hash
    • Generates provisional doc_id
    • Checks for duplicates against documents.json
    • Usage: python3 fingerprint.py <file_path>
    • Exit code 2 = exact duplicate found
  3. Normalization (scripts/normalize.py)

    • Converts any supported format to wrapped clean.md + raw plain.txt
    • DOCX: parses document.xml preserving headings, lists, tables
    • PDF: uses pdftotext → pymupdf → pypdf fallback chain
    • Flags likely image-only/scanned PDFs as needs_ocr: true instead of silently failing
    • Wraps clean.md in <untrusted_contract_content source="..."> ... </untrusted_contract_content>
    • Validates wrapper with python3 normalize.py --validate-wrapper <clean.md>
    • Validates output quality (text length ratio check)
    • Usage: python3 normalize.py <file_path> <output_dir>

When to Use

  • At the start of any ingestion pipeline (WF1 Steps 1-3)
  • At the start of any review pipeline (WF2 Steps 1-2)
  • When a new document enters the system

Output Artifacts

Artifact Location Description
Format detection result stdout (JSON) File format, size, support status
Fingerprint result stdout (JSON) doc_id, sha256, duplicate status
clean.md {output_dir}/clean.md Markdown-formatted normalized text inside the untrusted-content wrapper
plain.txt {output_dir}/plain.txt Plain text without formatting

Quality Checks

  • Normalization validates that output text length is ≥ 50% of source (10% for binary formats)
  • Heading count is tracked for structural integrity comparison
  • Review/ingestion agents must reject wrapperless clean.md artifacts
  • Empty files are rejected at detection stage
  • Legacy .doc files must be converted to .docx before normalization
  • Scanned PDFs are reported as OCR-required when no extractable text is detected

Read the full file on GitHub · 53 lines

Files

What ships with it

3 files 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. 4d ago First seen · 53 lines · 0 tokens per session scan A d35cf124dcbb

Subscribe to this mod's changes

doc-parser is a skill published in the GitHub repository lowtidebuild/contract-review (40 stars, last pushed 1mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 559 tokens. 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.

Related

Other skills, from other repositories

software-copyright-materials

Generate guided Chinese software copyright application materials from a real project. Use this skill when the user asks for 软件著作权, 软著申请资料, 软著代码材料, 操作手册, 申请表信息, or wants Word/TXT materials for software copyright registration. The workflow analyzes the imported project, extracts real source code, creates Markdown drafts…

Fokkyp/SoftwareCopyright-Skill · 97 tokens

software-certificate-skill

面向普通用户,从真实软件项目全自动生成中国软件著作权申请资料:一次收集登记事实,自动分析业务、选择可追溯源码、取得真实界面证据,生成申请表信息、规范黑白灰操作手册、代码前后30页或全部材料及真实 DOCX/PDF;内部验证、渲染、哈希与备份只进入系统临时运行区,项目最终仅保留正式资料。适配 Codex、Claude Code、Cursor、OpenCode、WorkBuddy、QoderWork、TraeWork 及支持 Agent Skills 或 AGENTS.md 的平台。用户提到软件著作权、软著申请资料、申请表、代码材料、操作手册或软著审查时使用。.

IvanCodesDev/software-certificate-skill · 170 tokens

paper2patent

Convert academic papers into complete Chinese invention patent application deliverables, including DOCX/PDF application documents, claims, specifications, abstracts, drawing specifications, and fidelity reviews. Use when drafting patent text, generating Word or PDF patent applications, preparing patent drawings, or…

7toCR/paper2patent · 64 tokens

data-privacy-agreement

Draft and fill data privacy agreement templates — DPA, data processing agreement, GDPR, HIPAA BAA, business associate agreement, AI addendum. Produces signable DOCX files from Common Paper standard forms. Use when user says "DPA," "data processing agreement," "HIPAA BAA," "business associate agreement," or "AI…

open-agreements/open-agreements · 121 tokens

softcopyright

智能软件著作权申请材料生成工具。自动分析项目源码,生成符合软著申请要求的软件说明书和源代码文档。支持关键词搜索、智能源码分析、格式化输出和PDF导出。.

peterfei/ai-agent-team · 49 tokens

indian-health-insurance-claim-help

Audit, organize, and create PDF packets for hospitalization-linked Indian health-insurance indemnity reimbursement claims, including day-care and pre/post-hospitalization evidence. Use for claim-document preparation or QA; not for standalone OPD, fixed-benefit claims, eligibility decisions, or promising approval.

DhananjayBhosale/Indian-Health-Insurance-Claim-Help · 66 tokens