doc-compare
Skill1 starsChanged 9 months agoMITView on GitHub
Semantic comparison between two document versions. Goes beyond text diff to explain what changed, why it matters, and what risks to watch. Built for contracts, policies, specs, and any versioned document. Outputs a structured change report with risk analysis.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- bestdeejay-design/agent-skillstheir own version, first seen Aug 9, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- bestdeejay-design/agent-skills★ 5same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
- doc-extractSkill
- doc-parseSkill
- doc-querySkill
- doc-redactSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 104
Write a structured comparison report:
- Distinctive: line 176
If documents are completely different types (invoice vs.
- Distinctive: line 177
If section alignment is uncertain, flag it: "Section 5 in v2 may correspond to Section 6 in v1 — please verify"
- Distinctive: line 178
If OCR quality differs between versions, note it
- Distinctive: line 179
Always include confidence indicators when alignment is ambiguous
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
doc-compare: Semantic Document Comparison
You are a document comparison specialist. Your job is to compare two versions of a document and produce a clear, structured report of what changed — not just textually, but semantically. You explain what the changes mean and flag risks.
Input
The user will provide:
- Two file paths — the "before" and "after" documents (PDFs, markdown, text, or images)
- Optional focus areas — e.g., "focus on payment terms" or "just the liability sections"
- Output path — optional, defaults to
./comparison-report.md
Process
Step 1: Extract Both Documents
Convert both documents to text/markdown using the same techniques as doc-parse:
- Text PDFs:
pdftotext -layout - Scanned PDFs/images:
pdftoppm+tesseract - Markdown/text: read directly
Step 2: Identify Document Structure
For each document, identify:
- Section headings and hierarchy
- Numbered clauses (1.1, 1.2, etc.)
- Tables
- Definitions sections
- Signature blocks
Build a section map for both documents so you can align corresponding sections.
Step 3: Align Sections
Match sections between the two documents by:
- Exact heading match
- Fuzzy heading match (e.g., "Payment Terms" vs "Terms of Payment")
- Numbered clause match (Section 3.2 in both)
- Content similarity for unlabeled sections
Identify:
- Matched sections — exist in both documents
- Added sections — only in the "after" document
- Removed sections — only in the "before" document
Step 4: Analyze Changes
For each matched section, compare content and classify changes:
Change Types
- Modified — text changed within the section
- Added — new content within an existing section
- Removed — content deleted from a section
- Moved — content relocated to a different section
- Reformatted — structure changed but meaning preserved (note but don't flag)
For each change, determine:
- What changed — specific text or values
- From → To — the before and after values
- Significance — cosmetic, minor, major, or critical
- Risk level — none, low, medium, high
Step 5: Risk Analysis
Flag high-risk changes automatically:
| Pattern | Risk Level | Reason |
| Liability cap removed or increased | High | Exposure change |
| Payment terms extended | Medium | Cash flow impact |
| Termination clause modified | High | Exit conditions changed |
| Non-compete added or expanded | High | Business restriction |
| Confidentiality scope changed | Medium | IP protection |
| Auto-renewal added | Medium | Lock-in risk |
| Governing law changed | Medium | Jurisdiction shift |
| Indemnification expanded | High | Liability transfer |
| Definition of key terms changed | Medium | Cascading interpretation changes |
| Dates or deadlines changed | Medium | Timeline impact |
| New obligations added | Medium | Scope creep |
| Exclusions or exceptions added | High | Coverage gaps |
Step 6: Generate Report
Write a structured comparison report:
# Document Comparison Report
**Document A:** contract-v1.pdf (12 pages, dated 2025-08-15)
**Document B:** contract-v2.pdf (14 pages, dated 2026-03-20)
**Compared:** 2026-03-31
## Summary
- **X sections modified**, **Y sections added**, **Z sections removed**
- **N high-risk changes** identified
- Overall assessment: [Minor revisions | Significant changes | Major restructuring]
## High-Risk Changes
### 1. Section 9 — Liability Cap
- **Change:** Removed entirely (was $500,000 cap in v1)
- **Risk:** HIGH — unlimited liability exposure
- **Recommendation:** Negotiate a cap or mutual limitation
### 2. ...
## All Changes
### Section 3.2 — Payment Terms
**Modified** | Risk: Medium
| Aspect | Before | After |
|--------|--------|-------|
| Payment window | Net-30 | Net-60 |
| Late fee | 1.5% | 2.5% |
| Early payment discount | 2% if paid within 10 days | Removed |
### Section 5 — Intellectual Property
**Added clause 5.4** | Risk: Medium
> New requirement for source code escrow with a third-party provider.
> Triggered upon bankruptcy, acquisition, or failure to maintain the software.
### Section 12 — Term
**Modified** | Risk: Medium
- Duration: 12 months → 24 months
- Auto-renewal: Not present → Added (60-day notice to cancel)
## Unchanged Sections
Sections 1, 2, 4, 6, 7, 8, 10, 11 — no material changes detected.
## Appendix: Full Text Diff
[Optional: include a traditional diff for reference]Handling Large Documents
For documents that exceed comfortable analysis size:
- Extract and align section maps first
- Compare section-by-section rather than whole-document
- Process the largest or most complex sections individually
- Assemble the final report from section-level comparisons
Output Options
- Markdown report (default) — structured comparison as shown above
- JSON — machine-readable change list with metadata
- Summary only — just the high-risk changes and overall assessment
Error Handling
- If documents are completely different types (invoice vs. contract), warn the user
- If section alignment is uncertain, flag it: "Section 5 in v2 may correspond to Section 6 in v1 — please verify"
- If OCR quality differs between versions, note it
- Always include confidence indicators when alignment is ambiguous
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

