⚠️ 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.
Table of Contents
Clarify First
Before reviewing the contract, confirm these inputs. If any is unknown or vague, ASK — do not assume:
Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the review.
Tools
Contract Analyzer
Analyzes contract text files for clause types, missing standard clauses, and risk indicators.
# Analyze a contract file
python scripts/contract_analyzer.py contract.txt
# JSON output for pipeline integration
python scripts/contract_analyzer.py agreement.md --json
# 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 |
Redline Generator
Takes contract analysis JSON and generates formatted redline suggestions with priority tiers.
# Generate redlines from analysis
python scripts/contract_analyzer.py contract.txt --json --output analysis.json
python scripts/redline_generator.py analysis.json
# JSON output
python scripts/redline_generator.py analysis.json --json
# 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 |
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
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
Workflows
Standard Contract Review
- Ingest -- Save contract as
.txt or .md file
- Analyze -- Run
contract_analyzer.py with --json flag
- Review findings -- Check RED items first, then YELLOW
- Generate redlines -- Run
redline_generator.py on analysis output
- Prioritize -- Focus on Must-Have redlines, prepare fallbacks for Should-Have
- Send to counsel -- Attach analysis and redlines for final review
Rapid Risk Triage
- Run
contract_analyzer.py in text mode for quick scan
- If any RED findings: escalate immediately to legal counsel
- If YELLOW only: schedule review within 48 hours
- If all GREEN: proceed with standard approval workflow
Troubleshooting
| Problem |
Cause |
Solution |
Error: File not found |
Contract file path is incorrect or file does not exist |
Verify the file path; use absolute paths if relative paths fail |
| No clauses detected |
Contract uses unusual formatting or non-standard clause headers |
Ensure contract is plain text; strip PDF artifacts before analysis |
| All clauses marked GREEN |
Contract is genuinely favorable, or text extraction missed key sections |
Manually verify critical clauses (liability, indemnification, IP) are present in the input file |
| Redline generator produces empty output |
Analysis JSON has no YELLOW or RED findings |
Confirm analysis JSON is valid; re-run analyzer if contract was updated |
| False positive on uncapped liability |
Liability section references a cap elsewhere in the document |
Review the full Limitation of Liability section; the tool scans for cap keywords within each clause boundary |
| Missing clause false positive |
Clause 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 |
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.
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
Anti-Patterns
| Anti-Pattern |
Why It Fails |
Better Approach |
| Signing contracts with only GREEN findings and no human review |
Automated analysis cannot catch context-dependent risks, ambiguous language, or business-specific concerns |
Always have qualified counsel review before execution, even on all-GREEN contracts |
| Treating all RED findings as equal |
Some RED items are structural deal-breakers while others may be resolvable with a single word change |
Use the redline generator to assess effort and fallback positions for each RED finding |
| Skipping the redline fallback positions |
Entering negotiation with only preferred positions leaves no room for strategic concession |
Always prepare Must-Have fallbacks and identify Nice-to-Have items to trade away |
| Running analysis on poorly extracted text |
PDF-to-text conversion artifacts break clause detection patterns |
Clean the text file before analysis: remove headers, footers, page numbers, and formatting artifacts |
Tool Reference
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:
python scripts/contract_analyzer.py <contract_file> [--json] [--output FILE]
Flags:
| Flag |
Short |
Default |
Description |
contract_file |
(positional) |
|
Path to contract text file (.txt or .md) |
--json |
|
off |
Output in JSON format |
--output |
-o |
(stdout) |
Write output to file |
Example Output (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
Purpose: Takes contract analysis JSON and generates formatted redline suggestions with priority tiers, rationale, and fallback positions.
Usage:
python scripts/redline_generator.py <analysis_json> [--json] [--output FILE]
Flags:
| Flag |
Short |
Default |
Description |
analysis_json |
(positional) |
|
Path to contract analysis JSON file |
--json |
|
off |
Output 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."
1---2name: contract-review-73description: Contract review assistant analyzing agreements against playbooks. GREEN/YELLOW/RED severity. Use when reviewing vendor contracts, SaaS agreements, service agreements, or generating redline suggestions.4license: MIT + Commons Clause5---6> **⚠️ 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.
7
8# Contract Review
9
10Automated 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.
11
12---
13
14## Table of Contents
15
16- [Tools](#tools)
17 - [Contract Analyzer](#contract-analyzer)
18 - [Redline Generator](#redline-generator)
19- [Reference Guides](#reference-guides)
20- [Workflows](#workflows)
21 - [Standard Contract Review](#standard-contract-review)
22 - [Rapid Risk Triage](#rapid-risk-triage)
23- [Troubleshooting](#troubleshooting)
24- [Success Criteria](#success-criteria)
25- [Scope & Limitations](#scope--limitations)
26- [Anti-Patterns](#anti-patterns)
27- [Tool Reference](#tool-reference)
28
29---
30
31## Clarify First
32
33Before reviewing the contract, confirm these inputs. If any is unknown or vague, ASK — do not assume:
34
35- [ ] **Which side you represent** — customer/buyer vs vendor/provider flips which clauses are favorable and reverses the direction of every redline
36- [ ] **Contract type** — SaaS, services, vendor/supply, or license — sets the standard-clause baseline and which missing clauses get flagged
37- [ ] **Risk tolerance / playbook positions** — what your org treats as a deal-breaker — defines the RED vs YELLOW cutoff and the Must-Have vs Nice-to-Have tiering
38- [ ] **Deal leverage / value** — calibrates which redlines are walkaway (Tier 1) vs tradeable concessions (Tier 3)
39
40Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the review.
41
42## Tools
43
44### Contract Analyzer
45
46Analyzes contract text files for clause types, missing standard clauses, and risk indicators.
47
48```bash
49# Analyze a contract file
50python scripts/contract_analyzer.py contract.txt
51
52# JSON output for pipeline integration
53python scripts/contract_analyzer.py agreement.md --json
54
55# Save analysis to file
56python scripts/contract_analyzer.py contract.txt --output analysis.json --json
57```
58
59**What it detects:**
60- Clause types: Limitation of Liability, Indemnification, IP, Data Protection, Term & Termination, Governing Law, Reps & Warranties, Force Majeure, Confidentiality, Payment Terms
61- Missing standard clauses against a baseline checklist
62- Risk indicators: uncapped liability, perpetual terms, unilateral indemnification, automatic renewal without opt-out, broad IP assignment, unlimited audit rights
63
64**Risk Classification:**
65
66| Level | Meaning | Action |
67|-------|---------|--------|
68| RED | Deal-breaker risk | Must negotiate before signing |
69| YELLOW | Material concern | Should negotiate, may accept with mitigation |
70| GREEN | Standard or favorable | Acceptable as-is |
71
72---
73
74### Redline Generator
75
76Takes contract analysis JSON and generates formatted redline suggestions with priority tiers.
77
78```bash
79# Generate redlines from analysis
80python scripts/contract_analyzer.py contract.txt --json --output analysis.json
81python scripts/redline_generator.py analysis.json
82
83# JSON output
84python scripts/redline_generator.py analysis.json --json
85
86# Save redlines to file
87python scripts/redline_generator.py analysis.json --output redlines.md
88```
89
90**Output includes:**
91- Priority tier (Must-Have / Should-Have / Nice-to-Have)
92- Preferred redline language
93- Rationale for each change
94- Fallback position if counterparty rejects
95- Negotiation notes
96
97**Priority Tiers:**
98
99| Tier | Label | Description |
100|------|-------|-------------|
101| 1 | Must-Have | Deal-breakers; walk away if rejected |
102| 2 | Should-Have | Strong preferences; push hard but negotiable |
103| 3 | Nice-to-Have | Concession candidates; trade for Tier 1-2 wins |
104
105---
106
107## Reference Guides
108
109### Clause Analysis Guide
110`references/clause_analysis_guide.md`
111
112Deep reference covering 8+ clause types:
113- Limitation of Liability (cap types, carveouts, consequential damages)
114- Indemnification (mutuality, scope, procedure)
115- IP (ownership, licenses, work-for-hire, feedback)
116- Data Protection (DPA, sub-processors, breach notification, transfers)
117- Term & Termination (auto-renewal, cure periods, transition)
118- Governing Law (jurisdiction, arbitration, jury waiver)
119- Representations & Warranties
120- Force Majeure
121
122### Negotiation Playbook
123`references/negotiation_playbook.md`
124
125Negotiation priority framework with:
126- Tier 1 deal-breakers and walkaway criteria
127- Tier 2 strong preferences with trading strategies
128- Tier 3 concession candidates for strategic give-backs
129- Redline format template
130- Common negotiation pitfalls
131
132---
133
134## Workflows
135
136### Standard Contract Review
137
1381. **Ingest** -- Save contract as `.txt` or `.md` file
1392. **Analyze** -- Run `contract_analyzer.py` with `--json` flag
1403. **Review findings** -- Check RED items first, then YELLOW
1414. **Generate redlines** -- Run `redline_generator.py` on analysis output
1425. **Prioritize** -- Focus on Must-Have redlines, prepare fallbacks for Should-Have
1436. **Send to counsel** -- Attach analysis and redlines for final review
144
145### Rapid Risk Triage
146
1471. Run `contract_analyzer.py` in text mode for quick scan
1482. If any RED findings: escalate immediately to legal counsel
1493. If YELLOW only: schedule review within 48 hours
1504. If all GREEN: proceed with standard approval workflow
151
152---
153
154## Troubleshooting
155
156| Problem | Cause | Solution |
157|---------|-------|----------|
158| `Error: File not found` | Contract file path is incorrect or file does not exist | Verify the file path; use absolute paths if relative paths fail |
159| No clauses detected | Contract uses unusual formatting or non-standard clause headers | Ensure contract is plain text; strip PDF artifacts before analysis |
160| All clauses marked GREEN | Contract is genuinely favorable, or text extraction missed key sections | Manually verify critical clauses (liability, indemnification, IP) are present in the input file |
161| Redline generator produces empty output | Analysis JSON has no YELLOW or RED findings | Confirm analysis JSON is valid; re-run analyzer if contract was updated |
162| False positive on uncapped liability | Liability section references a cap elsewhere in the document | Review the full Limitation of Liability section; the tool scans for cap keywords within each clause boundary |
163| Missing clause false positive | Clause 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 |
164
165---
166
167## Success Criteria
168
169- **Contract review time reduced by 50%:** Automated clause identification and risk classification eliminates manual scanning.
170- **Zero missed RED-severity clauses:** Every uncapped liability, unilateral indemnification, and broad IP assignment is flagged before human review.
171- **Redline generation under 2 minutes:** From analysis JSON to prioritized redline document.
172- **Consistent risk classification across reviewers:** GREEN/YELLOW/RED framework eliminates subjective assessments.
173- **100% of contracts reviewed with structured output:** Every agreement gets a clause inventory and risk report before negotiation begins.
174- **Negotiation success rate above 80% on Must-Have items:** Tier 1 redlines with prepared fallbacks improve negotiation outcomes.
175
176---
177
178## Scope & Limitations
179
180**Covers:**
181- Static text analysis of contract clauses using keyword and pattern matching
182- Clause type identification across 10+ standard commercial contract categories
183- Risk indicator detection: uncapped liability, perpetual terms, unilateral obligations, auto-renewal traps
184- Missing clause detection against a standard commercial contract baseline
185- Prioritized redline generation with fallback positions
186
187**Does NOT cover:**
188- **Legal advice** -- this tool supports review, it does not replace qualified legal counsel
189- **Jurisdiction-specific compliance** -- use `ra-qm-team` skills for regulatory compliance (GDPR, SOC 2, etc.)
190- **Contract execution or e-signature workflows** -- out of scope
191- **Multi-document cross-reference** (e.g., checking SOW against MSA) -- analyze each document separately
192- **Non-English contracts** -- pattern matching is English-language only
193
194---
195
196## Anti-Patterns
197
198| Anti-Pattern | Why It Fails | Better Approach |
199|-------------|-------------|-----------------|
200| Signing contracts with only GREEN findings and no human review | Automated analysis cannot catch context-dependent risks, ambiguous language, or business-specific concerns | Always have qualified counsel review before execution, even on all-GREEN contracts |
201| Treating all RED findings as equal | Some RED items are structural deal-breakers while others may be resolvable with a single word change | Use the redline generator to assess effort and fallback positions for each RED finding |
202| Skipping the redline fallback positions | Entering negotiation with only preferred positions leaves no room for strategic concession | Always prepare Must-Have fallbacks and identify Nice-to-Have items to trade away |
203| Running analysis on poorly extracted text | PDF-to-text conversion artifacts break clause detection patterns | Clean the text file before analysis: remove headers, footers, page numbers, and formatting artifacts |
204
205---
206
207## Tool Reference
208
209### contract_analyzer.py
210
211**Purpose:** Analyzes contract text files for clause types, identifies missing standard clauses, and flags risk indicators with GREEN/YELLOW/RED severity classification.
212
213**Usage:**
214
215```bash
216python scripts/contract_analyzer.py <contract_file> [--json] [--output FILE]
217```
218
219**Flags:**
220
221| Flag | Short | Default | Description |
222|------|-------|---------|-------------|
223| `contract_file` | *(positional)* | | Path to contract text file (.txt or .md) |
224| `--json` | | off | Output in JSON format |
225| `--output` | `-o` | *(stdout)* | Write output to file |
226
227**Example Output (JSON):**
228
229```json
230{
231 "file": "vendor_agreement.txt",
232 "clauses_found": [
233 {
234 "type": "limitation_of_liability",
235 "severity": "RED",
236 "text_snippet": "...liability shall not be limited...",
237 "risk_flags": ["uncapped_liability"],
238 "notes": "No liability cap found; uncapped exposure"
239 }
240 ],
241 "missing_clauses": ["force_majeure", "data_protection"],
242 "risk_summary": {"RED": 2, "YELLOW": 3, "GREEN": 5},
243 "overall_risk": "RED"
244}
245```
246
247---
248
249### redline_generator.py
250
251**Purpose:** Takes contract analysis JSON and generates formatted redline suggestions with priority tiers, rationale, and fallback positions.
252
253**Usage:**
254
255```bash
256python scripts/redline_generator.py <analysis_json> [--json] [--output FILE]
257```
258
259**Flags:**
260
261| Flag | Short | Default | Description |
262|------|-------|---------|-------------|
263| `analysis_json` | *(positional)* | | Path to contract analysis JSON file |
264| `--json` | | off | Output in JSON format |
265| `--output` | `-o` | *(stdout)* | Write output to file |
266
267**Example Output:**
268
269```
270REDLINE SUGGESTIONS
271===================
272
273[MUST-HAVE] Limitation of Liability — Uncapped Liability
274 Severity: RED
275 Preferred: "Aggregate liability shall not exceed 12 months of fees paid."
276 Rationale: Uncapped liability creates unlimited financial exposure.
277 Fallback: "Aggregate liability shall not exceed 24 months of fees paid."
278
279[SHOULD-HAVE] Indemnification — Unilateral Indemnification
280 Severity: YELLOW
281 Preferred: "Each party shall indemnify the other for breaches of this Agreement."
282 Rationale: Mutual indemnification balances risk between parties.
283 Fallback: "Indemnification obligations shall be subject to the liability cap."
284```