contract-review: Skill for Claude Code

.claude/skills/doc-parser/SKILL.md

doc-parser is a skill for Claude Code 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 Code

Written for Claude Code: installed under .claude/.

This is lowtidebuild/contract-review's own configuration. It tells Claude Code how to work on contract-review itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything contract-review configures →

Reuse

Borrowing it

Nothing to install: this file belongs to lowtidebuild/contract-review. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/lowtidebuild/contract-review/main/.claude/skills/doc-parser/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/lowtidebuild/contract-review

Made for: Claude Code.

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/github.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/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-parser

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. 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.00000 $0.00559
Opus 5.5 $0.00000 $0.00224
Sonnet 5.5 $0.00000 $0.00112
Haiku 4.5 $0.00000 $0.00056

Measured 1mo ago against content hash d35cf124dcbb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 (41 stars, last pushed 3mo 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.