
Legal Document Analyzer
Extract obligations, liabilities, and termination terms from NDAs and vendor contracts before you sign or ship integrations.
Overview
Legal Document Analyzer is an agent skill most often used in Validate (also Operate) that parses contract data to extract type, parties, obligations, rights, liabilities, and termination terms for pre-signature review.
Install
npx skills add https://github.com/qodex-ai/ai-agent-skills --skill legal-document-analyzerWhat is this skill?
- Identifies contract type (NDA, employment, service, purchase) from keyword patterns
- Extracts obligations, rights, liabilities, termination, and dispute-resolution clauses
- Structured analysis output: parties, key terms, and liability buckets in one pass
- Python ContractAnalyzer module for plugging parsed contract dicts into agent workflows
- Supports comprehensive contract_data dictionaries from upstream parsers
- 7 analysis dimensions: contract type, parties, key terms, obligations, rights, liabilities, termination, dispute resolut
Adoption & trust: 793 installs on skills.sh; 26 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are about to sign an NDA or vendor contract but cannot quickly see who owes what, how you can exit, or where liability concentrates.
Who is it for?
Solo founders reviewing NDAs, service agreements, and employment contracts from parsed text before committing cash or IP.
Skip if: Replacing licensed legal advice, analyzing unscanned image-only PDFs without a separate OCR or parser skill, or automated filing with courts or regulators.
When should I use this skill?
You have parsed contract_data and need structured extraction of terms, obligations, and liabilities before signing or renewing.
What do I get? / Deliverables
You get a structured contract analysis dict—type, parties, key terms, obligations, rights, liabilities, termination, and dispute resolution—so you can negotiate or escalate with clarity.
- Contract analysis dictionary with type, parties, obligations, rights, liabilities, termination, and dispute resolution
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Validate because solo builders most often run contract analysis while scoping deals, partnerships, and legal commitments before full build. Scope subphase covers pre-commitment review of what you are agreeing to—aligned with parsing parties, key terms, and risk clauses.
Where it fits
Run analysis on a pilot vendor MSA before you commit build time to their API.
Compare liability and payment obligations across two pricing-tier contracts.
Re-analyze an expiring contractor agreement during renewal negotiations.
Flag dispute-resolution and data-handling clauses before production integration go-live.
How it compares
Use as a structured clause extractor on top of plain-text contracts, not as a full e-discovery or CLM platform.
Common Questions / FAQ
Who is legal-document-analyzer for?
Indie builders and small teams who need repeatable contract triage on NDAs, services, and employment agreements before signing or renewing.
When should I use legal-document-analyzer?
During Validate when scoping vendor and partner deals, and during Operate when reviewing renewals—after you have contract text in a contract_data dict.
Is legal-document-analyzer safe to install?
Review the Security Audits panel on this Prism page and treat contract text as sensitive; the module analyzes data you supply and does not replace professional legal review.
SKILL.md
READMESKILL.md - Legal Document Analyzer
""" Contract Analysis Module Analyzes contracts to extract key terms, obligations, rights, and liabilities. """ import re from typing import Dict, List class ContractAnalyzer: """Analyzes contract documents for key information.""" def analyze_contract(self, contract_data: Dict) -> Dict: """ Perform comprehensive contract analysis. Args: contract_data: Dictionary with parsed contract data Returns: Dictionary with contract analysis """ analysis = { "contract_type": self._identify_contract_type(contract_data), "parties_involved": contract_data.get("parties"), "key_terms": self._extract_key_terms(contract_data), "obligations": self._extract_obligations(contract_data), "rights": self._extract_rights(contract_data), "liabilities": self._extract_liabilities(contract_data), "termination_conditions": self._extract_termination(contract_data), "dispute_resolution": self._extract_dispute_resolution(contract_data) } return analysis def _identify_contract_type(self, contract_data: Dict) -> str: """Identify the type of contract.""" keywords = { "nda": ["confidential", "non-disclosure", "proprietary"], "employment": ["employment", "salary", "position", "employee"], "service": ["services", "service provider", "agreement"], "purchase": ["purchase", "sale", "buyer", "seller"], "lease": ["lease", "tenant", "landlord", "rent"] } text = contract_data.get("full_text", "").lower() scores = {} for contract_type, keywords_list in keywords.items(): scores[contract_type] = sum( 1 for keyword in keywords_list if keyword in text ) return max(scores, key=scores.get) if scores else "unknown" def _extract_key_terms(self, contract_data: Dict) -> Dict: """Extract key terms from contract.""" key_terms = { "effective_date": self._find_date(contract_data, "effective|commencement"), "expiration_date": self._find_date(contract_data, "expiration|end|termination"), "renewal_terms": self._find_renewal_terms(contract_data), "payment_terms": self._find_payment_terms(contract_data), "performance_metrics": self._find_performance_metrics(contract_data) } return key_terms def _extract_obligations(self, contract_data: Dict) -> List[str]: """Extract obligations from contract.""" text = contract_data.get("full_text", "") pattern = r'(?:shall|must|agree to|required to)\s+(.+?)(?:\.|;|,)' matches = re.finditer(pattern, text, re.IGNORECASE) return [match.group(1) for match in matches] def _extract_rights(self, contract_data: Dict) -> List[str]: """Extract rights from contract.""" text = contract_data.get("full_text", "") pattern = r'(?:may|can|has the right to|entitled to)\s+(.+?)(?:\.|;|,)' matches = re.finditer(pattern, text, re.IGNORECASE) return [match.group(1) for match in matches] def _extract_liabilities(self, contract_data: Dict) -> List[str]: """Extract liability clauses from contract.""" # Placeholder for liability extraction return [] def _extract_termination(self, contract_data: Dict) -> Dict: """Extract termination conditions from contract.""" # Placeholder for termination extraction return {} def _extract_dispute_resolution(self, contract_data: Dict) -> Dict: """Extract dispute resolution clauses.""" # Placeholder for dispute resolution extraction return {} def _find_date(self, contract_data: Dict, pattern: str) -> str: """Find date matching pattern.""" # Placeholder for date finding return "" def _find_renew