Contract Review & Redline Skill
Analyzes legal agreements to identify problematic terms, missing protections, and market departures, then generates structured redlines in a standardized JSON format.
About this skill
This AI agent skill acts as a contract review assistant, guiding an AI to meticulously analyze legal agreements. It systematically identifies potentially problematic terms, flags missing protective clauses, and highlights departures from market standards across various risk categories, including liability, termination, IP/data, financial terms, and dispute resolution. The primary use case involves automating the initial, often time-consuming, phase of contract review. By generating structured redlines in a machine-readable JSON format, the skill ensures consistency and allows for further automated processing, such as generating tracked changes in .docx files, PDFs, or markdown. Legal professionals, in-house counsel, and business development teams can leverage this to significantly accelerate their workflow. Users benefit from a standardized and efficient approach to contract scrutiny, reducing the manual effort involved in identifying key issues. The skill's ability to output structured data means the findings can be easily integrated into other legal tech tools or document generation systems, enhancing overall productivity and accuracy in legal document management.
Best use case
This skill is primarily designed for legal professionals, paralegals, or business teams involved in the high-volume review and negotiation of legal contracts. It automates the initial assessment phase, allowing human experts to focus on strategic decision-making and negotiation rather than the manual identification and markup of routine issues.
Analyzes legal agreements to identify problematic terms, missing protections, and market departures, then generates structured redlines in a standardized JSON format.
Users should expect a JSON array detailing proposed contract changes, categorized by type (replace, delete, insert_after, add_section), along with optional metadata like section, title, and rationale for each redline.
Practical example
Example input
Review the attached Software License Agreement. Identify any clauses related to liability caps, data privacy, and intellectual property ownership that deviate from standard market practice, and generate structured redlines with a priority tier 1 or 2.
Example output
[
{
"type": "replace",
"old": "The Licensor shall not be liable for any indirect damages.",
"new": "The Licensor's aggregate liability shall be limited to the fees paid by Licensee in the twelve (12) months preceding the claim.",
"section": "8.2",
"title": "Liability Cap",
"tier": 1,
"rationale": "Introduce a clear monetary cap on liability, aligning with market standards for software licenses."
},
{
"type": "insert_after",
"anchor": "Confidentiality.",
"text": "\n\n9.3 Data Protection. Both parties shall comply with all applicable data protection laws and regulations concerning any personal data processed under this Agreement.",
"section": "9.3",
"title": "Data Protection Clause",
"tier": 2,
"rationale": "Add explicit data protection language to address privacy concerns and regulatory compliance."
}
]When to use this skill
- When drafting or reviewing a high volume of contracts requiring consistent analysis.
- To ensure standardized application of review criteria across different legal agreements.
- When needing structured, machine-readable output of contract changes for further automation.
- To accelerate the initial review and redlining phase of legal documents efficiently.
When not to use this skill
- For highly nuanced legal interpretations requiring deep human expertise beyond structured analysis.
- As a substitute for final legal counsel or without thorough human oversight and verification.
- For informal document reviews where structured redlines or automated outputs are unnecessary.
- When reviewing contracts in highly specialized legal domains not explicitly covered by its analysis framework.
How Contract Review & Redline Skill Compares
| Feature / Agent | Contract Review & Redline Skill | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | medium | N/A |
Frequently Asked Questions
What does this skill do?
Analyzes legal agreements to identify problematic terms, missing protections, and market departures, then generates structured redlines in a standardized JSON format.
How difficult is it to install?
The installation complexity is rated as medium. You can find the installation instructions above.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
SKILL.md Source
# Contract Review & Redline Skill
You are a contract review assistant that analyzes legal agreements and produces structured redlines using legal-redline-tools.
## Workflow
1. **Read the contract** — Extract full text from the .docx
2. **Analyze provisions** — Identify problematic terms, missing protections, and market departures
3. **Generate redlines** — Output a JSON array of proposed changes
4. **Produce deliverables** — Use legal-redline-tools to generate .docx with tracked changes, PDFs, and markdown
## Redline JSON Format
Each redline is a dict with these fields:
### Required fields
- `type`: One of `"replace"`, `"delete"`, `"insert_after"`, `"add_section"`
- Type-specific:
- `replace`: `old` (text to find), `new` (replacement text)
- `delete`: `text` (text to remove)
- `insert_after`: `anchor` (text to insert after), `text` (new text)
- `add_section`: `text` (new section content), `after_section` (section reference to insert after), optionally `new_section_number`
### Optional metadata fields
- `section`: Contract section reference (e.g. "7.2", "11.3(a)")
- `title`: Human-readable title (e.g. "Liability Cap", "Change of Control")
- `tier`: Priority 1-3 (1=non-starter, 2=important, 3=desirable)
- `rationale`: Why this change is proposed (internal only — never shown to counterparty)
- `walkaway`: Fall-back position if counterparty rejects (internal only)
- `precedent`: Market standard or comparable deal reference (internal only)
## Analysis Framework
When reviewing a contract, evaluate each provision against:
### Risk Categories
- **Liability** — caps, uncapped indemnities, consequential damages waivers
- **Termination** — convenience clauses, cure periods, material breach definitions
- **IP/Data** — ownership, licenses, data protection, audit rights
- **Financial** — payment terms, fee changes, minimum commitments
- **Dispute** — arbitration venue/rules, governing law, jury waiver
- **Change of control** — assignment restrictions, M&A triggers
- **Operational** — SLAs, force majeure, insurance requirements
### Tier Classification
- **Tier 1 (Non-Starters):** Issues that create unacceptable risk. The deal cannot proceed without these changes.
- **Tier 2 (Important):** Significant issues that should be negotiated but aren't dealbreakers alone.
- **Tier 3 (Desirable):** Improvements that strengthen position but can be conceded in trades.
## Producing Output
After generating the redlines JSON array, use the Python API:
```python
import json
from legal_redline import (
apply_redlines, render_redline_pdf, generate_summary_pdf,
generate_memo_pdf, generate_markdown, scan_document
)
# Load redlines
redlines = [...] # your generated redlines
# 1. Tracked-changes .docx (for counterparty)
apply_redlines("original.docx", "redlined.docx", redlines, author="Author Name")
# 2. Full-document redline PDF (for counterparty)
render_redline_pdf("original.docx", redlines, "redline.pdf",
header_text="Proposed Redlines")
# 3. Summary PDF — external (for counterparty, clean)
generate_summary_pdf(redlines, "summary.pdf",
doc_title="Agreement Title",
doc_parties="Party A / Party B",
mode="external")
# 4. Internal memo PDF (for your team only — includes tiers, rationale, walkaway)
generate_memo_pdf(redlines, "memo.pdf",
doc_title="Agreement Title",
doc_parties="Party A / Party B")
# 5. Markdown (for PRs, docs, or AI pipelines)
md = generate_markdown(redlines, doc_title="Agreement Title", mode="internal")
```
## Text Matching Rules
The `old`, `text`, and `anchor` fields must **exactly match** text in the document. Tips:
- Copy text directly from the .docx — don't paraphrase
- Include enough surrounding text to be unique (avoid matching the wrong instance)
- Watch for smart quotes, em-dashes, and special characters in the document
- If a passage spans formatting changes (bold to normal), the text still matches as plain text
- Test with `scan_document()` first to find placeholders and verify text
## Cross-Agreement Workflows
When reviewing multiple related agreements:
```python
from legal_redline import compare_agreements, format_comparison_report, remap_redlines
# Compare redlines across agreements for consistency
result = compare_agreements({
"msa": msa_redlines,
"sow": sow_redlines,
"dpa": dpa_redlines,
})
report = format_comparison_report(result)
# Remap redlines from one document version to another
updated, report = remap_redlines("old.docx", "new.docx", redlines)
```
## Example Redline
```json
[
{
"type": "replace",
"old": "aggregate liability shall not exceed twenty percent (20%) of the fees paid during the twelve (12) month period",
"new": "aggregate liability shall not exceed one hundred percent (100%) of the fees paid during the twelve (12) month period, or Two Hundred Fifty Thousand US Dollars ($250,000), whichever is greater",
"section": "11.3",
"title": "Liability Cap",
"tier": 1,
"rationale": "20% cap is well below market standard for B2B SaaS (typically 100% of fees or 12-month fees). Creates asymmetric risk allocation.",
"walkaway": "Accept 50% floor if counterparty insists, but push for $250K minimum.",
"precedent": "Industry standard is 100% of trailing 12-month fees."
},
{
"type": "delete",
"text": "Company may terminate this Agreement immediately upon written notice if there is a material change in Partner's business",
"section": "13.5",
"title": "Delete Unilateral Termination",
"tier": 1,
"rationale": "Vague 'material change' standard allows arbitrary termination. M&A, fundraising, or pivots could all qualify."
},
{
"type": "add_section",
"after_section": "Section 16.6",
"text": "BPA Precedence Guardrail. To the extent the BPA contains terms that are less protective of Partner than this Agreement, the more protective term shall govern.",
"new_section_number": "16.7",
"title": "BPA Precedence Guardrail",
"tier": 2,
"rationale": "BPA 'takes precedence' over tri-party per Section 5 references. This ensures key protections aren't overridden."
}
]
```Related Skills
Contract Analyzer
Analyzes contracts and agreements for risks, unusual terms, and missing clauses
flutter-dart-code-review
库无关的Flutter/Dart代码审查清单,涵盖Widget最佳实践、状态管理模式(BLoC、Riverpod、Provider、GetX、MobX、Signals)、Dart惯用法、性能、可访问性、安全性和整洁架构。
security-review
Use this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment/sensitive features. Provides comprehensive security checklist and patterns.
addressing-pr-review-comments
Address all valid review comments on a PR for the current branch in the streamlit/streamlit repo. Covers both inline review comments and general PR (issue) comments. Use when a PR has reviewer feedback to address, including code changes, style fixes, and documentation updates.
lightning-architecture-review
Review Bitcoin Lightning Network protocol designs, compare channel factory approaches, and analyze Layer 2 scaling tradeoffs. Covers trust models, on-chain footprint, consensus requirements, HTLC/PTLC compatibility, liveness, and watchtower support.
gha-security-review
Find exploitable vulnerabilities in GitHub Actions workflows. Every finding MUST include a concrete exploitation scenario — if you can't build the attack, don't report it.
gh-review-requests
Fetch unread GitHub notifications for open PRs where review is requested from a specified team or opened by a team member. Use when asked to "find PRs I need to review", "show my review requests", "what needs my review", "fetch GitHub review requests", or "check team review queue".
fix-review
Verify fix commits address audit findings without new bugs
error-debugging-multi-agent-review
Use when working with error debugging multi agent review
employment-contract-templates
Templates and patterns for creating legally sound employment documentation including contracts, offer letters, and HR policies.
django-perf-review
Django performance code review. Use when asked to "review Django performance", "find N+1 queries", "optimize Django", "check queryset performance", "database performance", "Django ORM issues", or audit Django code for performance problems.
django-access-review
django-access-review