Skip to content
Back to skills

Contract Review

ASecurity

Scans a contract text file for risky clauses (uncapped liability, one-sided indemnity, broad IP assignment, perpetual term, no breach notice) and missing standard clauses, quotes the offending line with a fix, and drafts prioritised redlines with fallbacks. Use when reviewing a vendor, SaaS or services agreement before signing or when you need redline wording.

  • 1,271 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added May 30, 2026
ai-agentspythongobashapi

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add borghei/Claude-Skills --skill contract-review --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Contract Review?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Contract Review
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/borghei-contract-review/badge)](https://www.skillsdirectory.com/skills/borghei-contract-review)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: contract-review
description: >
  Scans a contract text file for risky clauses (uncapped liability, one-sided indemnity,
  broad IP assignment, perpetual term, no breach notice) and missing standard clauses, quotes
  the offending line with a fix, and drafts prioritised redlines with fallbacks. Use when
  reviewing a vendor, SaaS or services agreement before signing or when you need redline wording.
license: MIT + Commons Clause
metadata:
  version: 1.0.0
  author: The Glass Room
  category: legal
  domain: contract-analysis
  updated: 2026-04-10
  tags: [contract-review, redline, negotiation, risk-assessment, legal]
---
> **⚠️ 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

- [Tools](#tools)
  - [Contract Analyzer](#contract-analyzer)
  - [Redline Generator](#redline-generator)
- [Reference Guides](#reference-guides)
- [Workflows](#workflows)
  - [Standard Contract Review](#standard-contract-review)
  - [Rapid Risk Triage](#rapid-risk-triage)
- [Troubleshooting](#troubleshooting)
- [Success Criteria](#success-criteria)
- [Scope & Limitations](#scope--limitations)
- [Anti-Patterns](#anti-patterns)
- [Tool Reference](#tool-reference)

---

## Clarify First

Before reviewing the contract, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.

- **Which side you represent:** customer/buyer vs vendor/provider flips which clauses are favorable and reverses the direction of every redline.
- **Contract type:** SaaS, services, vendor/supply, or license — sets the standard-clause baseline and which missing clauses get flagged.
- **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.
- **Deal leverage / value:** calibrates which redlines are walkaway (Tier 1) vs tradeable concessions (Tier 3).

Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.

## Tools

Run from the skill folder. Exit codes for both tools: `0` no findings, `1` findings to act on, `2` unusable input (missing or empty file, fewer than 30 words, no contract language, invalid analysis JSON). Every finding quotes the contract line and gives a fix. Input is a positional path, `--input`, or `-` for stdin; `--format text|json` (`--json` is a legacy alias); `-o FILE` writes the report.

### Contract Analyzer

```bash
python3 scripts/contract_analyzer.py assets/flawed_vendor_agreement.txt
python3 scripts/contract_analyzer.py assets/flawed_vendor_agreement.txt --format json -o analysis.json
```

Real output (excerpt):

```
CONTRACT ANALYSIS REPORT
==================================================
File: flawed_vendor_agreement.txt  (read 174 words, 28 lines, 8 clause types recognised)
Overall Risk: RED
Risk Summary: RED=3  YELLOW=4  GREEN=1  MISSING=2

--- RED ---
  [RED] Limitation of Liability (limitation_of_liability)
    - Uncapped liability exposure [line 15]
...
FIX 12 issues
```

- Clauses detected: liability, indemnification, IP, audit rights, data protection, term and termination, governing law, warranties, force majeure, confidentiality, payment terms (heading near line start, else 3+ keyword hits).
- Risk patterns: uncapped liability, liability section without cap language, consequential damages, one-sided indemnity, broad IP assignment, perpetual term, auto-renewal, no cure period, unlimited audit, no breach notification, jurisdiction, jury waiver, as-is warranty.
- Missing-clause baseline (internal heuristic, not a legal standard): liability, indemnification, IP, data protection, term, governing law, confidentiality.
- Limits: English pattern matching, first match per pattern; a clause found only through a risk pattern does not count as present.

| Level | Meaning | Action |
|-------|---------|--------|
| RED | Deal-breaker risk | Must negotiate before signing |
| YELLOW | Material concern or missing standard clause | Should negotiate |
| GREEN | No flagged pattern | Still needs counsel review |

---

### Redline Generator

Turns the analyzer's JSON into redlines. Wording is drafted for the customer/buyer side; swap sides if you represent the vendor.

```bash
python3 scripts/contract_analyzer.py assets/flawed_vendor_agreement.txt --format json -o analysis.json
python3 scripts/redline_generator.py analysis.json -o redlines.md
python3 scripts/redline_generator.py analysis.json --format json
```

Each redline has the flagged quote, preferred language, rationale, fallback and a negotiation note, grouped by tier:

| 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 |

Tiers and "common negotiating position" wording are the skill's heuristics, not sourced benchmarks. The 72-hour breach notice follows GDPR Art. 33 (2016).

---

## 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

1. **Ingest** -- Save contract as `.txt` or `.md` file
2. **Analyze** -- Run `contract_analyzer.py` with `--format json`
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

### 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

---

## Troubleshooting

| Problem | Cause | Solution |
|---------|-------|----------|
| `error: file not found` (exit 2) | 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 prints PASS with 0 redlines | Analysis JSON has no YELLOW or RED findings and nothing missing | 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

- Every RED and YELLOW finding quotes the contract line and carries a fix.
- A known-good agreement (`assets/sample_msa.txt`) exits 0; a flawed one exits 1; text with no contract language exits 2.
- Every Must-Have redline has a fallback ready before negotiation starts.
- Counsel reviews the output before anything is signed.

---

## 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

| Tool | Input | Flags | Exit |
|------|-------|-------|------|
| `scripts/contract_analyzer.py` | contract `.txt`/`.md`, or `-` | `--input`, `--format text\|json`, `--json`, `-o` | 0 clean, 1 findings, 2 unusable |
| `scripts/redline_generator.py` | analyzer JSON, or `-` | `--input`, `--format text\|json`, `--json`, `-o` | 0 none needed, 1 redlines, 2 unusable |

Analyzer JSON carries `verdict`, `read` (words, lines, clauses), `clauses_found[].findings[]` (`flag`, `severity`, `rule`, `line`, `quote`, `fix`), `missing_clauses`, `risk_summary`, `next_actions` (max 3). Redline JSON carries `verdict`, `redlines[]` and `total`.

Samples: `assets/sample_msa.txt` (exit 0), `assets/flawed_vendor_agreement.txt` (exit 1), `assets/malformed_contract.txt` (exit 2), plus matching `*_analysis.json` files for the redline tool.

Files in this skill

  • SKILL.md11.1 KB
  • references/clause_analysis_guide.md18.1 KB
  • references/negotiation_playbook.md12.8 KB
  • scripts/contract_analyzer.py16.8 KB
  • scripts/redline_generator.py21.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.