contract-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
⚠️ EXPERIMENTAL — This skill is provided for educational and informational purposes only. It does NOT constitute legal advice. All responsibility for usage rests with the user. Consult qualified legal professionals before acting on any output.
⚠️ 实验性工具 — 本技能仅用于教育和信息展示,不构成法律建议。使用风险由用户自行承担。根据输出内容采取行动前,请咨询合格的法律专业人士。

Contract Review

合同审查

Automated contract review tools that analyze agreements against organizational playbooks, classify clause risk with GREEN/YELLOW/RED severity, and generate prioritized redline suggestions with fallback positions.

自动化合同审查工具,可对照组织操作手册分析协议,以GREEN/YELLOW/RED三级风险等级对条款风险进行分类,并生成带有备选方案的优先级红线修改建议。

Table of Contents

目录

Tools

工具

Contract Analyzer

合同分析器

Analyzes contract text files for clause types, missing standard clauses, and risk indicators.
bash
undefined
分析合同文本文件的条款类型、缺失的标准条款以及风险指标。
bash
undefined

Analyze a contract file

Analyze a contract file

python scripts/contract_analyzer.py contract.txt
python scripts/contract_analyzer.py contract.txt

JSON output for pipeline integration

JSON output for pipeline integration

python scripts/contract_analyzer.py agreement.md --json
python scripts/contract_analyzer.py agreement.md --json

Save analysis to file

Save analysis to file

python scripts/contract_analyzer.py contract.txt --output analysis.json --json

**What it detects:**
- Clause types: Limitation of Liability, Indemnification, IP, Data Protection, Term & Termination, Governing Law, Reps & Warranties, Force Majeure, Confidentiality, Payment Terms
- Missing standard clauses against a baseline checklist
- Risk indicators: uncapped liability, perpetual terms, unilateral indemnification, automatic renewal without opt-out, broad IP assignment, unlimited audit rights

**Risk Classification:**

| Level | Meaning | Action |
|-------|---------|--------|
| RED | Deal-breaker risk | Must negotiate before signing |
| YELLOW | Material concern | Should negotiate, may accept with mitigation |
| GREEN | Standard or favorable | Acceptable as-is |

---
python scripts/contract_analyzer.py contract.txt --output analysis.json --json

**检测内容:**
- 条款类型:责任限制、赔偿条款、知识产权(IP)、数据保护、期限与终止、管辖法律、陈述与保证、不可抗力、保密条款、付款条款
- 对照基线清单检测缺失的标准条款
- 风险指标:无上限责任、永久条款、单方赔偿、无退出机制的自动续约、宽泛的知识产权转让、无限制审计权

**风险分类:**

| 等级 | 含义 | 行动 |
|-------|---------|--------|
| RED | 交易否决风险 | 签署前必须协商修改 |
| YELLOW | 重大关切 | 应协商修改,可在缓解风险后接受 |
| GREEN | 标准或有利条款 | 可直接接受 |

---

Redline Generator

红线生成器

Takes contract analysis JSON and generates formatted redline suggestions with priority tiers.
bash
undefined
接收合同分析JSON文件,生成带有优先级层级的格式化红线修改建议。
bash
undefined

Generate redlines from analysis

Generate redlines from analysis

python scripts/contract_analyzer.py contract.txt --json --output analysis.json python scripts/redline_generator.py analysis.json
python scripts/contract_analyzer.py contract.txt --json --output analysis.json python scripts/redline_generator.py analysis.json

JSON output

JSON output

python scripts/redline_generator.py analysis.json --json
python scripts/redline_generator.py analysis.json --json

Save redlines to file

Save redlines to file

python scripts/redline_generator.py analysis.json --output redlines.md

**Output includes:**
- Priority tier (Must-Have / Should-Have / Nice-to-Have)
- Preferred redline language
- Rationale for each change
- Fallback position if counterparty rejects
- Negotiation notes

**Priority Tiers:**

| Tier | Label | Description |
|------|-------|-------------|
| 1 | Must-Have | Deal-breakers; walk away if rejected |
| 2 | Should-Have | Strong preferences; push hard but negotiable |
| 3 | Nice-to-Have | Concession candidates; trade for Tier 1-2 wins |

---
python scripts/redline_generator.py analysis.json --output redlines.md

**输出内容包括:**
- 优先级层级(必备/应备/可选)
- 首选红线修改措辞
- 每项修改的理由
- 若对方拒绝的备选方案
- 谈判备注

**优先级层级:**

| 层级 | 标签 | 描述 |
|------|-------|-------------|
| 1 | 必备 | 交易否决项;若被拒绝则放弃交易 |
| 2 | 应备 | 强烈偏好项;全力争取但可协商 |
| 3 | 可选 | 可让步项;用于换取层级1-2的谈判成果 |

---

Reference Guides

参考指南

Clause Analysis Guide

条款分析指南

references/clause_analysis_guide.md
Deep reference covering 8+ clause types:
  • Limitation of Liability (cap types, carveouts, consequential damages)
  • Indemnification (mutuality, scope, procedure)
  • IP (ownership, licenses, work-for-hire, feedback)
  • Data Protection (DPA, sub-processors, breach notification, transfers)
  • Term & Termination (auto-renewal, cure periods, transition)
  • Governing Law (jurisdiction, arbitration, jury waiver)
  • Representations & Warranties
  • Force Majeure
references/clause_analysis_guide.md
深度参考文档,涵盖8+种条款类型:
  • 责任限制(上限类型、例外情况、间接损失)
  • 赔偿条款(相互性、范围、流程)
  • 知识产权(所有权、许可、委托作品、反馈)
  • 数据保护(数据处理协议(DPA)、分包商、数据泄露通知、数据传输)
  • 期限与终止(自动续约、补救期、过渡安排)
  • 管辖法律(司法管辖、仲裁、放弃陪审团审判)
  • 陈述与保证
  • 不可抗力

Negotiation Playbook

谈判操作手册

references/negotiation_playbook.md
Negotiation priority framework with:
  • Tier 1 deal-breakers and walkaway criteria
  • Tier 2 strong preferences with trading strategies
  • Tier 3 concession candidates for strategic give-backs
  • Redline format template
  • Common negotiation pitfalls

references/negotiation_playbook.md
谈判优先级框架,包含:
  • 层级1交易否决项及放弃交易标准
  • 层级2强烈偏好项及交易策略
  • 层级3可让步项,用于战略性让步
  • 红线格式模板
  • 常见谈判陷阱

Workflows

工作流程

Standard Contract Review

标准合同审查流程

  1. Ingest -- Save contract as
    .txt
    or
    .md
    file
  2. Analyze -- Run
    contract_analyzer.py
    with
    --json
    flag
  3. Review findings -- Check RED items first, then YELLOW
  4. Generate redlines -- Run
    redline_generator.py
    on analysis output
  5. Prioritize -- Focus on Must-Have redlines, prepare fallbacks for Should-Have
  6. Send to counsel -- Attach analysis and redlines for final review
  1. 导入 — 将合同保存为
    .txt
    .md
    文件
  2. 分析 — 运行
    contract_analyzer.py
    并添加
    --json
    参数
  3. 查看结果 — 先检查RED项,再检查YELLOW项
  4. 生成红线建议 — 基于分析输出运行
    redline_generator.py
  5. 优先级排序 — 聚焦必备红线建议,为应备项准备备选方案
  6. 提交法务 — 附上分析结果和红线建议供最终审查

Rapid Risk Triage

快速风险分类

  1. Run
    contract_analyzer.py
    in text mode for quick scan
  2. If any RED findings: escalate immediately to legal counsel
  3. If YELLOW only: schedule review within 48 hours
  4. If all GREEN: proceed with standard approval workflow

  1. 以文本模式运行
    contract_analyzer.py
    进行快速扫描
  2. 若存在RED项:立即上报法务
  3. 若仅存在YELLOW项:48小时内安排审查
  4. 若全为GREEN项:走标准审批流程

Troubleshooting

故障排查

ProblemCauseSolution
Error: File not found
Contract file path is incorrect or file does not existVerify the file path; use absolute paths if relative paths fail
No clauses detectedContract uses unusual formatting or non-standard clause headersEnsure contract is plain text; strip PDF artifacts before analysis
All clauses marked GREENContract is genuinely favorable, or text extraction missed key sectionsManually verify critical clauses (liability, indemnification, IP) are present in the input file
Redline generator produces empty outputAnalysis JSON has no YELLOW or RED findingsConfirm analysis JSON is valid; re-run analyzer if contract was updated
False positive on uncapped liabilityLiability section references a cap elsewhere in the documentReview the full Limitation of Liability section; the tool scans for cap keywords within each clause boundary
Missing clause false positiveClause exists but uses non-standard heading (e.g., "Damages Cap" instead of "Limitation of Liability")The analyzer checks multiple heading variants; add custom aliases if your organization uses unique terminology

问题原因解决方案
Error: File not found
合同文件路径错误或文件不存在验证文件路径;若相对路径失败,使用绝对路径
未检测到任何条款合同使用非常规格式或非标准条款标题确保合同为纯文本格式;分析前清除PDF转换残留的格式 artifacts
所有条款均标记为GREEN合同确实对我方有利,或文本提取遗漏了关键章节手动验证输入文件中是否包含关键条款(责任限制、赔偿条款、知识产权)
红线生成器输出为空分析JSON文件中无YELLOW或RED风险项确认分析JSON文件有效;若合同已更新,重新运行分析器
误判无上限责任责任章节在文档其他位置提及了责任上限完整查看责任限制章节;工具仅在每个条款范围内扫描上限关键词
误判缺失条款条款存在但使用非标准标题(如用“损害赔偿上限”替代“责任限制”)分析器会检查多种标题变体;若贵组织使用独特术语,可添加自定义别名

Success Criteria

成功标准

  • Contract review time reduced by 50%: Automated clause identification and risk classification eliminates manual scanning.
  • Zero missed RED-severity clauses: Every uncapped liability, unilateral indemnification, and broad IP assignment is flagged before human review.
  • Redline generation under 2 minutes: From analysis JSON to prioritized redline document.
  • Consistent risk classification across reviewers: GREEN/YELLOW/RED framework eliminates subjective assessments.
  • 100% of contracts reviewed with structured output: Every agreement gets a clause inventory and risk report before negotiation begins.
  • Negotiation success rate above 80% on Must-Have items: Tier 1 redlines with prepared fallbacks improve negotiation outcomes.

  • 合同审查时间缩短50%: 自动化条款识别和风险分类消除了人工扫描工作。
  • 零遗漏RED级条款: 在人工审查前,所有无上限责任、单方赔偿、宽泛知识产权转让项都会被标记。
  • 红线建议生成耗时少于2分钟: 从分析JSON到生成带优先级的红线文档。
  • 审查人员风险分类一致: GREEN/YELLOW/RED框架消除了主观评估差异。
  • 100%合同审查均生成结构化输出: 每份协议在谈判前都会得到条款清单和风险报告。
  • 必备项谈判成功率超过80%: 带有备选方案的层级1红线建议提升了谈判成果。

Scope & Limitations

适用范围与局限性

Covers:
  • Static text analysis of contract clauses using keyword and pattern matching
  • Clause type identification across 10+ standard commercial contract categories
  • Risk indicator detection: uncapped liability, perpetual terms, unilateral obligations, auto-renewal traps
  • Missing clause detection against a standard commercial contract baseline
  • Prioritized redline generation with fallback positions
Does NOT cover:
  • Legal advice -- this tool supports review, it does not replace qualified legal counsel
  • Jurisdiction-specific compliance -- use
    ra-qm-team
    skills for regulatory compliance (GDPR, SOC 2, etc.)
  • Contract execution or e-signature workflows -- out of scope
  • Multi-document cross-reference (e.g., checking SOW against MSA) -- analyze each document separately
  • Non-English contracts -- pattern matching is English-language only

涵盖内容:
  • 使用关键词和模式匹配对合同条款进行静态文本分析
  • 识别10+种标准商业合同类别中的条款类型
  • 风险指标检测:无上限责任、永久条款、单方义务、自动续约陷阱
  • 对照标准商业合同基线检测缺失条款
  • 生成带备选方案的优先级红线建议
不涵盖内容:
  • 法律建议 — 本工具仅辅助审查,不能替代合格的法务人员
  • 特定司法管辖区合规性 — 如需监管合规(GDPR、SOC 2等),请使用
    ra-qm-team
    技能
  • 合同签署或电子签名流程 — 不在范围内
  • 多文档交叉引用(如对照主服务协议(MSA)检查工作说明书(SOW)) — 需单独分析每份文档
  • 非英文合同 — 模式匹配仅支持英文

Anti-Patterns

反模式

Anti-PatternWhy It FailsBetter Approach
Signing contracts with only GREEN findings and no human reviewAutomated analysis cannot catch context-dependent risks, ambiguous language, or business-specific concernsAlways have qualified counsel review before execution, even on all-GREEN contracts
Treating all RED findings as equalSome RED items are structural deal-breakers while others may be resolvable with a single word changeUse the redline generator to assess effort and fallback positions for each RED finding
Skipping the redline fallback positionsEntering negotiation with only preferred positions leaves no room for strategic concessionAlways prepare Must-Have fallbacks and identify Nice-to-Have items to trade away
Running analysis on poorly extracted textPDF-to-text conversion artifacts break clause detection patternsClean the text file before analysis: remove headers, footers, page numbers, and formatting artifacts

反模式失败原因改进方案
签署仅含GREEN项的合同且未经过人工审查自动化分析无法识别依赖上下文的风险、模糊表述或业务特定问题即使全是GREEN项,签署前也必须由合格法务人员审查
将所有RED项视为同等重要部分RED项是结构性交易否决项,而有些仅需修改单个词语即可解决使用红线生成器评估每个RED项的修改难度和备选方案
跳过红线备选方案准备仅带着首选方案进入谈判会失去战略性让步的空间始终为必备项准备备选方案,并确定可用于交换的可选项
在提取质量差的文本上运行分析PDF转文本的格式残留会破坏条款检测模式分析前清理文本文件:移除页眉、页脚、页码和格式 artifacts

Tool Reference

工具参考

contract_analyzer.py

contract_analyzer.py

Purpose: Analyzes contract text files for clause types, identifies missing standard clauses, and flags risk indicators with GREEN/YELLOW/RED severity classification.
Usage:
bash
python scripts/contract_analyzer.py <contract_file> [--json] [--output FILE]
Flags:
FlagShortDefaultDescription
contract_file
(positional)Path to contract text file (.txt or .md)
--json
offOutput in JSON format
--output
-o
(stdout)Write output to file
Example Output (JSON):
json
{
  "file": "vendor_agreement.txt",
  "clauses_found": [
    {
      "type": "limitation_of_liability",
      "severity": "RED",
      "text_snippet": "...liability shall not be limited...",
      "risk_flags": ["uncapped_liability"],
      "notes": "No liability cap found; uncapped exposure"
    }
  ],
  "missing_clauses": ["force_majeure", "data_protection"],
  "risk_summary": {"RED": 2, "YELLOW": 3, "GREEN": 5},
  "overall_risk": "RED"
}

用途: 分析合同文本文件的条款类型,识别缺失的标准条款,并以GREEN/YELLOW/RED风险等级标记风险指标。
用法:
bash
python scripts/contract_analyzer.py <contract_file> [--json] [--output FILE]
参数:
参数缩写默认值描述
contract_file
(位置参数)合同文本文件路径(.txt或.md格式)
--json
关闭以JSON格式输出结果
--output
-o
(标准输出)将输出写入指定文件
示例输出(JSON格式):
json
{
  "file": "vendor_agreement.txt",
  "clauses_found": [
    {
      "type": "limitation_of_liability",
      "severity": "RED",
      "text_snippet": "...liability shall not be limited...",
      "risk_flags": ["uncapped_liability"],
      "notes": "No liability cap found; uncapped exposure"
    }
  ],
  "missing_clauses": ["force_majeure", "data_protection"],
  "risk_summary": {"RED": 2, "YELLOW": 3, "GREEN": 5},
  "overall_risk": "RED"
}

redline_generator.py

redline_generator.py

Purpose: Takes contract analysis JSON and generates formatted redline suggestions with priority tiers, rationale, and fallback positions.
Usage:
bash
python scripts/redline_generator.py <analysis_json> [--json] [--output FILE]
Flags:
FlagShortDefaultDescription
analysis_json
(positional)Path to contract analysis JSON file
--json
offOutput in JSON format
--output
-o
(stdout)Write output to file
Example Output:
REDLINE SUGGESTIONS
===================

[MUST-HAVE] Limitation of Liability — Uncapped Liability
  Severity: RED
  Preferred: "Aggregate liability shall not exceed 12 months of fees paid."
  Rationale: Uncapped liability creates unlimited financial exposure.
  Fallback: "Aggregate liability shall not exceed 24 months of fees paid."

[SHOULD-HAVE] Indemnification — Unilateral Indemnification
  Severity: YELLOW
  Preferred: "Each party shall indemnify the other for breaches of this Agreement."
  Rationale: Mutual indemnification balances risk between parties.
  Fallback: "Indemnification obligations shall be subject to the liability cap."
用途: 接收合同分析JSON文件,生成带有优先级层级、理由和备选方案的格式化红线修改建议。
用法:
bash
python scripts/redline_generator.py <analysis_json> [--json] [--output FILE]
参数:
参数缩写默认值描述
analysis_json
(位置参数)合同分析JSON文件路径
--json
关闭以JSON格式输出结果
--output
-o
(标准输出)将输出写入指定文件
示例输出:
REDLINE SUGGESTIONS
===================

[MUST-HAVE] Limitation of Liability — Uncapped Liability
  Severity: RED
  Preferred: "Aggregate liability shall not exceed 12 months of fees paid."
  Rationale: Uncapped liability creates unlimited financial exposure.
  Fallback: "Aggregate liability shall not exceed 24 months of fees paid."

[SHOULD-HAVE] Indemnification — Unilateral Indemnification
  Severity: YELLOW
  Preferred: "Each party shall indemnify the other for breaches of this Agreement."
  Rationale: Mutual indemnification balances risk between parties.
  Fallback: "Indemnification obligations shall be subject to the liability cap."