Agent skill

Contract Review

by zh-xx in zh-xx/legal-assistant-skills

Contract review skill that adds comment-based issue annotations without changing original text.

Apache-2.0Auto-check passedLegal & Compliance

Install Contract Review

skills CLI
$ npx skills add zh-xx/legal-assistant-skills --skill contract-review -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install zh-xx/legal-assistant-skills contract-review --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/zh-xx/legal-assistant-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/contract-review .claude/skills/contract-review && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
contract-review
GitHub stars
174
Token cost
~1.6k tokens
SKILL.md length
670 words
Files
27 (incl. scripts, references)
Skills in repo
8
Repo updated
First seen
Licence
Apache-2.0

At a glance

Contract review skill that adds comment-based issue annotations without changing original text.

  • Works in 9 steps: Unpack the contract (.docx) for XML… → Read contract text (pandoc or XML) → Extract and verify contracting parties… → …
  • Tasks that involve Diagrams
  • SKILL.md covers Overview, Workflow, Output Naming and Comment Principles, plus 9 more sections
  • Runs Python scripts from its folder

What it does

Contract Review is an agent skill from zh-xx/legal-assistant-skills. Contract review skill that adds comment-based issue annotations without changing original text. Enforces a four-layer review (entity verification, basic, business, legal), writes structured comments (issue type, risk reason, revision suggestion) with risk level encoded via reviewer name, and generates a contract summary, consolidated opinion, and Mermaid business flowchart (with rendered image). Output language must follow the contract’s language.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 29 other files, including scripts and reference files (for example `references/checklist.md`, `references/examples.md` and `references/flowchart.md`).

It sits in Legal & Compliance, covering Diagrams and Contract review. It works with Mermaid and Microsoft Word. The repository describes itself as: AI assistant skills for legal work. Compatible with Claude Code, Codex, and other platforms. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Diagrams
  • Tasks that involve Contract review

Example prompts

  • “/contract-review”

Requirements

  • Python 3

Workflow steps

9 steps, taken from the first numbered list in SKILL.md.

  1. Unpack the contract (.docx) for XML operations
  2. Read contract text (pandoc or XML)
  3. Extract and verify contracting parties (Layer 0)
  4. Execute three-layer clause review (Layer 1–3)
  5. Add comments to the document
  6. Generate contract summary
  7. Generate consolidated opinion
  8. Generate business flowchart and render image
  9. Repack to .docx

What it can do on your machine

Read from SKILL.md and the folder at commit 3094afd. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 10 files in scripts/ (Python, from the files we listed), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Contract Review loads about 1.6k tokens when it runs, and up to ~7.5k if it reads all its reference files. Until then it costs about 117 tokens; SKILL.md has 670 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~117
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from zh-xx/legal-assistant-skills at commit 3094afd, republished under its Apache-2.0 licence (© zh-xx). 670 words, ~1,605 tokens.

Download SKILL.mdSave it as .claude/skills/contract-review/SKILL.md (or your agent's skills folder). This skill also uses 26 other files; get the full folder from GitHub.
name
contract-review
description
Contract review skill that adds comment-based issue annotations without changing original text. Enforces a four-layer review (entity verification, basic, business, legal), writes structured comments (issue type, risk reason, revision suggestion) with risk level encoded via reviewer name, and generates a contract summary, consolidated opinion, and Mermaid business flowchart (with rendered image). Output language must follow the contract’s language.

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

  1. Unpack the contract (.docx) for XML operations
  2. Read contract text (pandoc or XML)
  3. Extract and verify contracting parties (Layer 0)
  4. Execute three-layer clause review (Layer 1–3)
  5. Add comments to the document
  6. Generate contract summary
  7. Generate consolidated opinion
  8. Generate business flowchart and render image
  9. Repack to .docx

Output Naming

  • Output directory: 审核结果:{ContractName} for Chinese or Review_Result_{ContractName} for English
  • Reviewed contract: {ContractName}_审核版.docx for Chinese or {ContractName}_Reviewed.docx for English
  • Review report: 审核报告.txt for Chinese or Review_Report.txt for 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:
    1. 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.
    2. If no such MCP tool is available, use Web Search to look up "[entity name] 工商登记信息" or "[entity name] business registration".
    3. 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
  • 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
Show full SKILL.md (258 more words)Show less

Contract Summary

Generate a structured, objective summary in the contract’s language.

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.mmd
  • business_flowchart.png

li## Technical Notes

Core workflow:

  1. 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 mmdc installed; use Chrome path or Puppeteer config

Examples

See references/examples.md for a full workflow example.

Important Rules

  1. Never alter original contract text
  2. Entity verification (Layer 0) must complete before clause review (Layers 1–3)
  3. Review all four layers, do not skip items
  4. Ensure risk level is accurate and consistent
  5. Keep comments precise, professional, and actionable
  6. Flowchart must come strictly from the contract text
  7. Summary is objective only; no risk analysis
  8. 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.

© zh-xx, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 26 other files (scripts, references) in contract-review of zh-xx/legal-assistant-skills.

  • SKILL.md
  • references/checklist.md
  • references/examples.md
  • references/flowchart.md
  • references/language.md
  • references/opinion.md
  • references/summary.md
  • references/technical.md
  • scripts/__init__.py
  • scripts/contract_analyzer.py
  • scripts/document.py
  • scripts/error_handling.py
  • scripts/mermaid_renderer.py
  • scripts/ooxml/__init__.py
  • scripts/ooxml/pack.py
  • scripts/ooxml/unpack.py
  • scripts/ooxml/validate.py
  • scripts/ooxml/validation
  • … and 9 more

Open the folder on GitHubat commit 3094afd

Compare with similar skills

Contract Review next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Contract Review compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Contract Review this skillzh-xx/legal-assistant-skills174—~1.6kAutomated safety check: PassApache-2.0
Contract Reviewanbeime/skill7.8k—~1.3kAutomated safety check: PassApache-2.0
LunwenDoryoku1223/lunwen-skill652—~1.7kAutomated safety check: PassMIT
Pii Contract Analyzegregmos/PII-Shield150—~8.9kAutomated safety check: NotesMIT
Patent Disclosure Skilltrsoliu/mini-wiki116—~1.7kAutomated safety check: NotesMIT
Finnish Legal Document Reviewakunikkola/claude-for-legal-finland109—~3.4kAutomated safety check: PassMIT

Similar skills

  • Contract Review

    anbeime/skill

    律师助理与法律助手、项目管理专家在审核合同、排查条款风险时必备。自动执行基础、商业、法律三层审查,仅添加批注不改原文,一键生成带批注合同、审查摘要、综合意见及业务流程图,让合同风控与业务梳理更高效专业。

    7.8k GitHub stars~1.3k tokensUpdated 2 days ago
    Legal & ComplianceAuto-check passed
  • Lunwen

    Doryoku1223/lunwen-skill

    用于撰写、补写、压缩、仿写、规范化交付中文毕业论文、毕业设计论文、技术报告和课程设计论文。用户提到论文、样文、学校模板、参考文献、摘要、图表、截图、Word 成稿、查重口吻优化,或需要基于真实项目代码生成论文正文时必须使用。本技能内置样文结构学习、样式提取、章节控字、参考文献筛选、Mermaid/PlantUML 图表处理、Chrome MCP 页面截图工作流,以及 doc/docx Word…

    652 GitHub stars~1.7k tokensUpdated 6 mo ago
    Documents & OfficeAuto-check passed
  • Pii Contract Analyze

    gregmos/PII-Shield

    Universal legal document processor with PII anonymization. An agent skill from gregmos/PII-Shield.

    150 GitHub stars~8.9k tokensUpdated 3 mo ago
    Legal & ComplianceAuto-check: notes
  • Patent Disclosure Skill

    trsoliu/mini-wiki

    中国专利:从项目文档挖掘专利点并生成可交付技术交底书(查新、脱敏成文、自检与迭代);或将已有专利解读为通俗笔记与 Obsidian 知识图谱(叙事故事线、公开线索辅助)。| China patents: draft technical disclosures from project docs, or read existing patents into plain-language…

    116 GitHub stars~1.7k tokensUpdated 6 days ago
    Legal & ComplianceAuto-check: notes
  • Finnish Legal Document Review

    akunikkola/claude-for-legal-finland

    Checks a Finnish legal document, such as a contract, statement, appeal or decision, in eight stages, looking for errors, gaps and risks before it is signed or submitted.

    109 GitHub stars~3.4k tokensUpdated 3 mo ago
    Legal & ComplianceAuto-check passed
  • Contract And Proposal Writer

    alirezarezvani/claude-skills

    Generate professional, jurisdiction-aware business documents: freelance contracts, project proposals, SOWs, NDAs, and MSAs.

    28k GitHub starsUsed in 2 repos~3.4k tokens
    Legal & ComplianceAuto-check passed

More from zh-xx/legal-assistant-skills

All 8 skills in this repo
  • Legal Risk Visualization

    zh-xx/legal-assistant-skills

    法律风险结构化分析与可视化。基于法律分析文本,执行五步风险抽取模型, 生成四层可视化输出(雷达图数据、风险矩阵、影响路径图、决策树)。

    174 GitHub stars~2.4k tokensUpdated 5 mo ago
    Auto-check passed
  • Ad Compliance Review

    zh-xx/legal-assistant-skills

    广告合规审核技能,用于审核广告素材是否符合中国广告法及相关法规。适用场景:(1) 用户提交广告文案、广告素材要求合规审核时;(2) 用户提到"广告审核""广告合规""广告法审查"等关键词时;(3) 用户要求检查广告内容是否存在违法违规风险时;(4) 用户提交房地产、食品、医疗、药品、互联网等行业广告要求专项审核时。审核依据涵盖《广告法》《反不正当竞争法》及行业专项法规。

    174 GitHub stars~1.2k tokensUpdated 5 mo ago
    Auto-check passed
  • Contract Gen

    zh-xx/legal-assistant-skills

    合同生成技能,以资深法律专家身份生成完整合同。适用场景:(1) 用户要求'起草合同''生成合同''拟定协议''写合同''草拟合同'时;(2) 用户提供合同类型和交易信息,要求生成完整合同文本时;(3) 用户要求根据特定立场(甲方/乙方/买方/卖方/出租方/承租方)起草倾斜性合同时;(4) 用户要求将已有合同要点或业务条件生成为正式合同文本时。输出 Markdown 格式,可选导出 .docx。

    174 GitHub stars~897 tokensUpdated 5 mo ago
    Auto-check passed
  • Food Label Review

    zh-xx/legal-assistant-skills

    预包装食品标签合规审核技能,用于审核食品标签是否符合 GB 7718(预包装食品标签通则)和 GB 28050(预包装食品营养标签通则)。适用场景:(1) 用户提交食品标签图片、文字或文档要求合规审核时;(2) 用户提到"食品标签审核""标签合规""营养标签审查""GB 7718""GB 28050"等关键词时;(3) 用户要求检查食品标签是否存在缺项、错误或违规风险时。支持 2011 版和…

    174 GitHub stars~1.7k tokensUpdated 5 mo ago
    Auto-check passed
  • Legal Job Search

    zh-xx/legal-assistant-skills

    法律AI求职助手 - 帮助法律人(法务/律师)使用AI辅助求职。支持公司/律所调研、法律风险分析、网页简历生成、针对性材料准备、面试备忘录生成。具备MCP工具级降级能力,无MCP时自动使用Web Search。

    174 GitHub stars~1.7k tokensUpdated 5 mo ago
    Auto-check passed
  • Law To Markdown

    zh-xx/legal-assistant-skills

    将法条/规范文件(.txt/.docx/.pdf)转为 Markdown。适用于用户要求“法条转 markdown”“pdf/docx 转 markdown”。处理 .pdf/.docx 时先检查是否已安装 mineru-ocr skill;未安装先引导安装,安装后优先用 mineru-ocr;仅在用户明确同意时再用本地回退方案。

    174 GitHub starsUsed in 1 repo~669 tokens
    Auto-check passed

Questions about Contract Review

What does Contract Review do?

Contract review skill that adds comment-based issue annotations without changing original text. Contract Review is an agent skill from zh-xx/legal-assistant-skills. Contract review skill that adds comment-based issue annotations without changing original text.

When should I use Contract Review?

Contract Review fits situations like: tasks that involve Diagrams; tasks that involve Contract review.

How do I install Contract Review in Claude Code?

Run `npx skills add zh-xx/legal-assistant-skills --skill contract-review -a claude-code`. Or copy the skill folder (contract-review in zh-xx/legal-assistant-skills) into .claude/skills/contract-review in your project. Claude Code loads it when a task matches its description.

How do I install Contract Review in Codex?

Run `npx skills add zh-xx/legal-assistant-skills --skill contract-review -a codex`. Or copy the skill folder (contract-review in zh-xx/legal-assistant-skills) into .agents/skills/contract-review in your project. Codex loads it when a task matches its description.

Can I use Contract Review in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add zh-xx/legal-assistant-skills --skill contract-review -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/contract-review, .gemini/skills/contract-review, .github/skills/contract-review and .opencode/skills/contract-review in your project.

What does Contract Review need to run?

Going by SKILL.md and its folder, Contract Review needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Contract Review access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Contract Review safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Contract Review use?

Contract Review is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Contract Review use?

About 1.6k tokens (SKILL.md is roughly 6.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.8k tokens, read only when the agent opens those files.

What are the alternatives to Contract Review?

Skills that share tags, products or a category with Contract Review: Contract Review (anbeime/skill, 7.8k stars), Lunwen (Doryoku1223/lunwen-skill, 652 stars), Pii Contract Analyze (gregmos/PII-Shield, 150 stars) and Patent Disclosure Skill (trsoliu/mini-wiki, 116 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Contract Review?

zh-xx (a GitHub user) maintains it in zh-xx/legal-assistant-skills, which has 174 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on April 18, 2026.

Source: zh-xx/legal-assistant-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.