Legal Document Analyzer Build intelligent legal document analysis agents that review contracts, identify risks, and provide legal insights. Document Parsing See examples/legal document parser.py for : - Parse PDF, DOCX, and text documents - Extract and structure document content - Identify sections, clauses, definitions, parties, and dates Contract Analysis See examples/contract analyzer.py for : - Identify contract type (NDA, employment, service, purchase, lease) - Extract key terms (dates, renewal, payment, performance metrics) - Extract obligations, rights, and liabilities Risk Identificat…

\n matches = re.finditer(pattern, text, re.MULTILINE)\n return [match.group(0) for match in matches]\n\n def _extract_clauses(self, text: str) -> List[str]:\n \"\"\"Extract clauses from document.\"\"\"\n # Placeholder for clause extraction logic\n return []\n\n def _extract_definitions(self, text: str) -> Dict[str, str]:\n \"\"\"Extract defined terms from document.\"\"\"\n # Placeholder for definition extraction\n return {}\n\n def _extract_parties(self, text: str) -> List[str]:\n \"\"\"Extract party names from document.\"\"\"\n # Placeholder for party extraction\n return []\n\n def _extract_dates(self, text: str) -> List[str]:\n \"\"\"Extract dates from document.\"\"\"\n # Placeholder for date extraction\n return []\n","content_type":"text/x-python; charset=utf-8","language":"python","size":2953,"content_sha256":"4594cdfcd73db4a1804da8044c768dbc7d84d81464cbe67d3634cdcb4056606a"},{"filename":"examples/legal_report_generator.py","content":"\"\"\"\nLegal Report Generation Module\n\nGenerates comprehensive legal analysis reports for contracts.\n\"\"\"\n\nfrom typing import Dict, List\n\n\nclass LegalReportGenerator:\n \"\"\"Generates legal analysis reports.\"\"\"\n\n def generate_analysis_report(self, analysis: Dict, risks: Dict) -> str:\n \"\"\"\n Generate comprehensive contract analysis report.\n\n Args:\n analysis: Contract analysis results\n risks: Risk assessment results\n\n Returns:\n Formatted report as string\n \"\"\"\n report = f\"\"\"\n# Contract Analysis Report\n\n## Contract Overview\n- Type: {analysis.get('contract_type')}\n- Parties: {analysis.get('parties_involved')}\n\n## Key Terms\n{self._format_key_terms(analysis.get('key_terms', {}))}\n\n## Obligations & Rights\n### Obligations\n{self._format_list(analysis.get('obligations', []))}\n\n### Rights\n{self._format_list(analysis.get('rights', []))}\n\n## Risk Assessment\n{self._format_risks(risks)}\n\n## Recommendations\n{self._generate_recommendations(analysis, risks)}\n \"\"\"\n return report\n\n def _format_key_terms(self, key_terms: Dict) -> str:\n \"\"\"Format key terms for report.\"\"\"\n formatted = \"\"\n for term, value in key_terms.items():\n formatted += f\"- **{term.replace('_', ' ').title()}**: {value}\\n\"\n return formatted\n\n def _format_list(self, items: List) -> str:\n \"\"\"Format list items for report.\"\"\"\n if not items:\n return \"None identified\"\n return \"\\n\".join([f\"- {item}\" for item in items])\n\n def _format_risks(self, risks: Dict) -> str:\n \"\"\"Format risks for report.\"\"\"\n formatted = \"\"\n for risk_type, risk_list in risks.items():\n formatted += f\"\\n### {risk_type.replace('_', ' ').title()}\\n\"\n for risk in risk_list:\n formatted += f\"- **[{risk.get('severity')}]** {risk.get('description')}\\n\"\n formatted += f\" Recommendation: {risk.get('recommendation')}\\n\"\n return formatted\n\n def _generate_recommendations(self, analysis: Dict, risks: Dict) -> str:\n \"\"\"Generate overall recommendations.\"\"\"\n # Placeholder for recommendation generation\n return \"Review all identified risks and implement recommended actions.\"\n","content_type":"text/x-python; charset=utf-8","language":"python","size":2271,"content_sha256":"d33f340446866ca7741d36737b9b709797437aa0b5ea3c0b664a3f90f984e3f7"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Legal Document Analyzer","type":"text"}]},{"type":"paragraph","content":[{"text":"Build intelligent legal document analysis agents that review contracts, identify risks, and provide legal insights.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Document Parsing","type":"text"}]},{"type":"paragraph","content":[{"text":"See ","type":"text"},{"text":"examples/legal_document_parser.py","type":"text","marks":[{"type":"link","attrs":{"href":"examples/legal_document_parser.py","title":null}}]},{"text":" for ","type":"text"},{"text":"LegalDocumentParser","type":"text","marks":[{"type":"code_inline"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Parse PDF, DOCX, and text documents","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Extract and structure document content","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Identify sections, clauses, definitions, parties, and dates","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Contract Analysis","type":"text"}]},{"type":"paragraph","content":[{"text":"See ","type":"text"},{"text":"examples/contract_analyzer.py","type":"text","marks":[{"type":"link","attrs":{"href":"examples/contract_analyzer.py","title":null}}]},{"text":" for ","type":"text"},{"text":"ContractAnalyzer","type":"text","marks":[{"type":"code_inline"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Identify contract type (NDA, employment, service, purchase, lease)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Extract key terms (dates, renewal, payment, performance metrics)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Extract obligations, rights, and liabilities","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Risk Identification","type":"text"}]},{"type":"paragraph","content":[{"text":"See ","type":"text"},{"text":"examples/contract_risk_analyzer.py","type":"text","marks":[{"type":"link","attrs":{"href":"examples/contract_risk_analyzer.py","title":null}}]},{"text":" for ","type":"text"},{"text":"ContractRiskAnalyzer","type":"text","marks":[{"type":"code_inline"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Analyze financial risks (unlimited liability, price escalations)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Identify legal risks (ambiguous terms, conflicting clauses)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Assess operational risks","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Check compliance risks (GDPR, data protection)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Legal Research","type":"text"}]},{"type":"paragraph","content":[{"text":"Build legal research capabilities to:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Find applicable laws for contract type and jurisdiction","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Identify regulatory requirements","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Research relevant case law","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Identify standard practices and precedents","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Compliance Checking","type":"text"}]},{"type":"paragraph","content":[{"text":"Build compliance checking capabilities to:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Verify contract compliance with regulations","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Identify compliance gaps","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Generate compliance recommendations","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Track required clauses and documentation","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Report Generation","type":"text"}]},{"type":"paragraph","content":[{"text":"See ","type":"text"},{"text":"examples/legal_report_generator.py","type":"text","marks":[{"type":"link","attrs":{"href":"examples/legal_report_generator.py","title":null}}]},{"text":" for ","type":"text"},{"text":"LegalReportGenerator","type":"text","marks":[{"type":"code_inline"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Generate comprehensive contract analysis reports","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Format key terms and obligations","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Present risk assessments","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Provide actionable recommendations","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Best Practices","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Document Review","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✓ Review full document systematically","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✓ Identify all parties and roles","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✓ Understand key terms and conditions","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✓ Identify potential risks","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✓ Check for compliance","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Risk Management","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✓ Prioritize high-severity risks","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✓ Negotiate unfavorable terms","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✓ Seek legal counsel for major issues","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✓ Document agreed changes","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✓ Keep signed copies","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Compliance","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✓ Understand applicable regulations","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✓ Ensure required clauses present","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✓ Document compliance measures","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✓ Review regulatory updates","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"✓ Train team on obligations","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Tools & Resources","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Document Processing","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"pypdf","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"python-docx","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"textract","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"OCR libraries","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Legal Research","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"LexisNexis","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Westlaw","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Google Scholar","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Free Law Project","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Getting Started","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Upload contract document","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Parse document structure","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Identify contract type","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Extract key terms and obligations","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Analyze for risks","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Check compliance","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Generate report","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Provide recommendations","type":"text"}]}]}]}]},"metadata":{"date":"2026-11-02","name":"legal-document-analyzer","author":"@skillopedia","source":{"stars":47,"repo_name":"ai-agent-skills","origin_url":"https://github.com/qodex-ai/ai-agent-skills/blob/HEAD/skills/legal-document-analyzer/SKILL.md","repo_owner":"qodex-ai","body_sha256":"c92f5c0e96ab15174c8aed4e99b38621a91ed7c4b10c6f77a15598aa031e8cca","cluster_key":"2bc6924d493ae14e987cd0eb2ef5e4871c7f8719fb3ee5cbe05dbd7ee41246b5","clean_bundle":{"format":"clean-skill-bundle-v1","source":"qodex-ai/ai-agent-skills/skills/legal-document-analyzer/SKILL.md","text_bytes":13821,"source_commit":"6ea9f00885c5dc5e6d9435d443dbf7d9ce865e29","skills_sh_rank":11583,"attachment_count":4,"text_attachments":4,"attachment_storage":"skill_attachments","binary_attachments":0},"cluster_size":1,"skill_md_path":"skills/legal-document-analyzer/SKILL.md","import_metadata":{"date":"2026-11-02","author":"@skillopedia","version":"v1","category":"business-sales-marketing","category_label":"Business"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"business-sales-marketing","import_tag":"skills-sh-top20k-2026-11","description":"Build agents for legal document analysis, contract review, and compliance checking. Handles document parsing, risk identification, and legal research. Use when creating contract analysis tools, legal research assistants, compliance checkers, or document review systems."}},"renderedAt":1793671778850}

Legal Document Analyzer Build intelligent legal document analysis agents that review contracts, identify risks, and provide legal insights. Document Parsing See examples/legal document parser.py for : - Parse PDF, DOCX, and text documents - Extract and structure document content - Identify sections, clauses, definitions, parties, and dates Contract Analysis See examples/contract analyzer.py for : - Identify contract type (NDA, employment, service, purchase, lease) - Extract key terms (dates, renewal, payment, performance metrics) - Extract obligations, rights, and liabilities Risk Identificat…