anbeime/skill / skills/legal-assistant-skills-main/contract-review
contract-review
Verified律师助理与法律助手、项目管理专家在审核合同、排查条款风险时必备。自动执行基础、商业、法律三层审查,仅添加批注不改原文,一键生成带批注合同、审查摘要、综合意见及业务流程图,让合同风控与业务梳理更高效专业。
| File | Kind | Size |
|---|---|---|
| LICENSE.txt | markdown | 11.1 KB |
| SKILL.md | skill md | 5.4 KB |
| references/checklist.md | markdown | 5.3 KB |
| references/examples.md | markdown | 5.5 KB |
| references/flowchart.md | markdown | 1.8 KB |
| references/language.md | markdown | 2.0 KB |
| references/opinion.md | markdown | 1.3 KB |
| references/summary.md | markdown | 2.8 KB |
| references/technical.md | markdown | 2.7 KB |
| scripts/__init__.py | script | 50 B |
| scripts/contract_analyzer.py | script | 9.2 KB |
| scripts/document.py | script | 11.3 KB |
| scripts/error_handling.py | script | 16.3 KB |
| scripts/mermaid_renderer.py | script | 6.9 KB |
| scripts/ooxml/__init__.py | script | 189 B |
| scripts/ooxml/pack.py | script | 3.5 KB |
| scripts/ooxml/unpack.py | script | 1.1 KB |
| scripts/ooxml/validate.py | script | 1.7 KB |
| scripts/ooxml/validation/__init__.py | script | 433 B |
| scripts/ooxml/validation/base.py | script | 1.5 KB |
| scripts/ooxml/validation/docx.py | script | 311 B |
| scripts/ooxml/validation/pptx.py | script | 274 B |
| scripts/ooxml/validation/redlining.py | script | 217 B |
| scripts/opinion_renderer.py | script | 4.2 KB |
| scripts/summary_renderer.py | script | 9.1 KB |
| scripts/utilities.py | script | 3.1 KB |
| scripts/workflow.py | script | 59.2 KB |
references/examples.md
View on GitHub# Contract Review Examples
## Quick Start
```python
# -*- coding: utf-8 -*-
from scripts.workflow import ContractReviewWorkflow
comments = [
{
"search": "Total Price",
"comment": """[Issue Type] Payment Terms
[Risk Reason] The total amount is stated as USD 100,000 in Section 3.2, but the payment clause lists USD 1,000,000 in Section 5.1.
[Revision Suggestion] Align the total amount across clauses and clarify tax inclusion.""",
"risk_level": "High",
}
]
workflow = ContractReviewWorkflow("Contract.docx", "Reviewer")
workflow.run_full_workflow(comments, "Contract_Reviewed.docx")
```
## Contract Summary (English)
```python
# -*- coding: utf-8 -*-
summary_text = """I. Basic Contract Information
Item\tContent
Contract Name\tNot specified
Contract Type\tNot specified
Parties\tParty A: Not specified
Party B: Not specified
Signing Date\tNot specified
Term\tNot specified
Contract Amount\tNot specified
II. Business Model Overview
Brief description: Not specified
III. Key Clause Elements
3.1 Transaction Elements
Element\tDetails
Subject Matter/Services\tNot specified
Quantity/Specs\tNot specified
Pricing Structure\tNot specified
Payment Terms\tNot specified
Delivery Terms\tNot specified
3.2 Rights and Obligations
Party A main rights/obligations:
Not specified
Party B main rights/obligations:
Not specified
3.3 Performance Safeguards
Clause Type\tDetails
Liability/Default\tNot specified
Guarantees/Security\tNot specified
Acceptance Standards\tNot specified
Quality Warranty\tNot specified
3.4 Risk Allocation & Special Terms
Risk Allocation:
Not specified
Special Terms:
Not specified
3.5 Dispute Resolution & Termination
Item\tDetails
Dispute Resolution\tNot specified
Amendment\tNot specified
Termination\tNot specified
Governing Law\tNot specified
IV. Key Timeline Milestones
Not specified
"""
workflow = ContractReviewWorkflow("Contract.docx", "Reviewer")
workflow.run_full_workflow(
comments,
"Contract_Reviewed.docx",
summary_text=summary_text,
summary_filename="Contract_Summary.docx",
summary_font="Times New Roman",
)
```
## Consolidated Opinion (English)
```python
# -*- coding: utf-8 -*-
opinion_text = """This agreement is a goods sales contract under which our side purchases specific devices from the counterparty for a total amount of USD 100,000, payable as a 30% prepayment and 70% balance after acceptance, with delivery and acceptance milestones defined in the contract.
After review, the following key risks require attention: 1. Product model names are inconsistent across clauses, which may cause delivery disputes; 2. The prepayment amount does not match the stated percentage, potentially causing payment execution issues; 3. Delivery timing is stated as “reasonable time,” which is ambiguous and may lead to delay disputes."""
workflow = ContractReviewWorkflow("Contract.docx", "Reviewer")
workflow.run_full_workflow(
comments,
"Contract_reviewed.docx",
opinion_text=opinion_text,
opinion_filename="Consolidated_Opinion.docx",
opinion_font="Times New Roman",
)
```
## Business Flowchart (Mermaid)
```python
# -*- coding: utf-8 -*-
flowchart_mermaid = """flowchart TD
A[Contract Signed] -->|?| B[Performance]
"""
workflow = ContractReviewWorkflow("Contract.docx", "Reviewer")
workflow.run_full_workflow(
comments,
"Contract_reviewed.docx",
flowchart_mermaid=flowchart_mermaid,
)
```
## Full Workflow Example
```python
# -*- coding: utf-8 -*-
#!/usr/bin/env python3
import sys
from pathlib import Path
skill_dir = Path(__file__).parent.parent
sys.path.insert(0, str(skill_dir))
from scripts.workflow import ContractReviewWorkflow
contract_path = "path/to/contract.docx"
output_path = "contract_reviewed.docx"
report_path = "review_report.txt"
reviewer = "Reviewer"
comments = [
{
"search": "Total Price",
"comment": """[Issue Type] Payment Terms
[Risk Reason] Amount mismatch between pricing and payment clauses.
[Revision Suggestion] Align total amount and clarify tax.""",
"risk_level": "High"
}
]
summary_text = """I. Basic Contract Information
Item\tContent
Contract Name\tNot specified
Contract Type\tNot specified
Parties\tParty A: Not specified
Party B: Not specified
Signing Date\tNot specified
Term\tNot specified
Contract Amount\tNot specified
"""
opinion_text = """This agreement is a services contract between our side and the counterparty with defined scope, pricing, and milestones.
After review, the following key risks require attention: 1. Payment timing is unclear; 2. Acceptance criteria are missing."""
flowchart_mermaid = """flowchart TD
A[Contract Signed] -->|?| B[Performance]
"""
workflow = ContractReviewWorkflow(
contract_path=contract_path,
reviewer_name=reviewer,
enable_smart_keyword_expansion=False,
)
workflow.run_full_workflow(
comments=comments,
output_docx_filename=output_path,
report_filename=report_path,
summary_text=summary_text,
summary_filename="Contract_Summary.docx",
summary_font="Times New Roman",
opinion_text=opinion_text,
opinion_filename="Consolidated_Opinion.docx",
opinion_font="Times New Roman",
flowchart_mermaid=flowchart_mermaid,
render_flowchart=True,
parallel_outputs=True,
)
print(f"✓ Added comments: {len(workflow.comments_added)}")
print(f"✗ Failed comments: {len(workflow.comments_failed)}")
```
## Language Notes
- Output must follow the contract’s language.
- For Chinese contracts, use the Chinese labels in **[language.md](language.md)** and set `summary_font` / `opinion_font` to Fangsong (仿宋).
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |