Legal Document Analysis
Extract and analyze legal documents, contracts, and agreements.
Disclaimer: This is AI-generated analysis for informational purposes only, not legal advice.
When to use this skill
- •User asks to review a contract or legal agreement
- •User wants to find specific clauses (termination, confidentiality, non-compete)
- •User needs obligations, deadlines, or payment terms extracted
- •User asks about risks or ambiguous language in a legal document
Steps
- •
Ensure
pymupdfis installed:bashpip install pymupdf
- •
Extract text from the legal document.
bashpython scripts/extract_text.py "INPUT_FILE_PATH"
The script prints extracted text directly to stdout.
- •
Read the shell output (or use the Read tool if saved to file).
- •
Produce a structured legal review:
code## Legal Document Review **Document Type**: Contract / NDA / Terms of Service / ... **Parties**: Party A, Party B **Effective Date**: ... **Governing Law**: ... ### Key Clauses #### Obligations - Party A must ... - Party B must ... #### Termination - Conditions for termination - Notice period required #### Confidentiality - Scope and duration #### Liability & Indemnification - Caps and triggers #### Payment Terms - Amounts, schedules, penalties ### Risk Flags - [Page X] Ambiguous language in clause Y: "..." - [Page X] One-sided indemnification favoring Party A ### Plain English Summary 3–5 sentence summary of practical implications.
- •
(Optional) Search for specific clauses by keyword:
bashpython scripts/search_clauses.py "INPUT_FILE_PATH" termination confidential indemnif
Multiple keywords can be passed as separate arguments.
Edge cases
- •Scanned contracts: If text extraction yields garbage, inform the user OCR is needed.
- •Multi-party agreements: Clearly identify all parties and their respective obligations.
- •Amendments / addenda: Check if the document references external amendments not included in the PDF.
- •Complex documents: If too many clauses to analyze at once, offer to focus on specific sections.
Scripts
- •extract_text.py — Extract full document text
- •search_clauses.py — Search for keywords with page/line references