contract-review
Contract Review Skill
Overview
This skill performs contract reviews by adding comments only (no edits to the original text). It follows a four-layer review (entity verification, basic, business, legal) and generates:
- Annotated contract (.docx)
- Contract summary (.docx)
- Consolidated review opinion (.docx)
- Business flowchart (Mermaid + rendered image)
Language rule: detect the contract’s dominant language and output all generated content (comments, summary, opinion, flowchart text) in that language. Use the guidance in references/language.md.
Workflow
- Unpack the contract (.docx) for XML operations
- Read contract text (pandoc or XML)
- Extract and verify contracting parties (Layer 0)
- Execute three-layer clause review (Layer 1–3)
- Add comments to the document
- Generate contract summary
- Generate consolidated opinion
- Generate business flowchart and render image
- Repack to .docx
Output Naming
- Output directory:
审核结果:{ContractName}for Chinese orReview_Result_{ContractName}for English - Reviewed contract:
{ContractName}_审核版.docxfor Chinese or{ContractName}_Reviewed.docxfor English - Review report:
审核报告.txtfor Chinese orReview_Report.txtfor English
Comment Principles
- Comments only: do not modify the original text or formatting
- Precise anchoring: comment should target specific clauses/paragraphs
- Structured content: each comment includes issue type, risk reason, and revision suggestion
- Risk level: carried by reviewer name; do not include a “risk level” line in comment body
- Output language: use labels in the contract’s language (see
references/language.md)
Comment example (English):
[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. This inconsistency may cause disputes.
[Revision Suggestion] Align the total amount across clauses and clarify whether tax is included.
Review Standards
Use the four-layer review model and the detailed checklist in references/checklist.md.
Layer 0: Entity verification (subject authenticity)
- Extract all contracting parties (full legal names, credit codes, legal representatives)
- Verify each entity's registered name accuracy and business registration status
- Verification tool priority:
- If an MCP tool for business registration lookup is available in the current environment (e.g., enterprise info query, company lookup, 企业查询, 工商查询), use it to query each party's name or Unified Social Credit Code.
- If no such MCP tool is available, use Web Search to look up "[entity name] 工商登记信息" or "[entity name] business registration".
- Record the verification source (MCP tool name / Web Search) in the comment.
Layer 1: Basic (text quality)
- Accuracy of numbers, dates, terms
- Consistent numbering and references
- Clarity and lack of ambiguity
- Formatting and punctuation quality
Layer 2: Business terms
- Scope, deliverables, quantity/specs
- Pricing and payment schedule
- Delivery/acceptance procedures
- Rights/obligations and performance guarantees
Layer 3: Legal terms
- Effectiveness and term/termination
- Liability/penalties and remedies
- Dispute resolution and governing law
- Confidentiality, force majeure, IP, notice, authorization
Risk levels (encoded in reviewer name):
- 🔴 High: core business ambiguity (price, scope, rights/obligations)
- 🟡 Medium: material but non-core ambiguity
- 🔵 Low: minimal practical impact
Contract Summary
Generate a structured, objective summary in the contract’s language.
- See references/summary.md (English template)
- Use references/language.md for language selection and Chinese labels
Output file: 合同概要.docx for Chinese or Contract_Summary.docx for English (default font: 仿宋; adjust if language requires)
Consolidated Opinion
Generate a concise, two-paragraph response for the business team in the contract’s language.
Output file: 综合审核意见.docx for Chinese or Consolidated_Opinion.docx for English (default font: 仿宋; adjust if language requires)
Business Flowchart (Mermaid)
Generate Mermaid flowchart per requirements and render to image.
Outputs:
business_flowchart.mmdbusiness_flowchart.png
li## Technical Notes
Core workflow:
- Unpack → 2. Entity verification → 3. Add comments → 4. Summary → 5. Opinion → 6. Flowchart → 7. Repack
API & implementation details:
Dependencies
- Python 3.9+ (3.10+ recommended)
- pandoc (system install)
- defusedxml
- Mermaid CLI (
mmdc) for rendering - python-docx for rich text output
Troubleshooting (Short)
- Comments missing in Word: run
doc.verify_comments()and re-save - find_paragraph fails: shorten search text; confirm actual paragraph text
- Mermaid render fails: ensure
mmdcinstalled; use Chrome path or Puppeteer config
Examples
See references/examples.md for a full workflow example.
Important Rules
- Never alter original contract text
- Entity verification (Layer 0) must complete before clause review (Layers 1–3)
- Review all four layers, do not skip items
- Ensure risk level is accurate and consistent
- Keep comments precise, professional, and actionable
- Flowchart must come strictly from the contract text
- Summary is objective only; no risk analysis
- Opinion only reflects findings already identified
License
SPDX-License-Identifier: Apache-2.0
Copyright (c) 2026 JiCheng
Licensed under the Apache License, Version 2.0. See repository root LICENSE.
More from zh-xx/legal-assistant-skills
ad-compliance-review
广告合规审核技能,用于审核广告素材是否符合中国广告法及相关法规。适用场景:(1) 用户提交广告文案、广告素材要求合规审核时;(2) 用户提到"广告审核""广告合规""广告法审查"等关键词时;(3) 用户要求检查广告内容是否存在违法违规风险时;(4) 用户提交房地产、食品、医疗、药品、互联网等行业广告要求专项审核时。审核依据涵盖《广告法》《反不正当竞争法》及行业专项法规。
30food-label-review
预包装食品标签合规审核技能,用于审核食品标签是否符合 GB 7718(预包装食品标签通则)和 GB 28050(预包装食品营养标签通则)。适用场景:(1) 用户提交食品标签图片、文字或文档要求合规审核时;(2) 用户提到"食品标签审核""标签合规""营养标签审查""GB 7718""GB 28050"等关键词时;(3) 用户要求检查食品标签是否存在缺项、错误或违规风险时。支持 2011 版和 2025 版标准。
22contract-gen
合同生成技能,以资深法律专家身份生成完整合同。适用场景:(1) 用户要求'起草合同''生成合同''拟定协议''写合同''草拟合同'时;(2) 用户提供合同类型和交易信息,要求生成完整合同文本时;(3) 用户要求根据特定立场(甲方/乙方/买方/卖方/出租方/承租方)起草倾斜性合同时;(4) 用户要求将已有合同要点或业务条件生成为正式合同文本时。输出 Markdown 格式,可选导出 .docx。
17law-to-markdown
将法条/规范文件(.txt/.docx/.pdf)转为 Markdown。适用于用户要求“法条转 markdown”“pdf/docx 转 markdown”。处理 .pdf/.docx 时先检查是否已安装 mineru-ocr skill;未安装先引导安装,安装后优先用 mineru-ocr;仅在用户明确同意时再用本地回退方案。
14legal-risk-visualization
|
9legal-job-search
法律AI求职助手 - 帮助法律人(法务/律师)使用AI辅助求职。支持公司/律所调研、法律风险分析、网页简历生成、针对性材料准备、面试备忘录生成。具备MCP工具级降级能力,无MCP时自动使用Web Search。
7