cip-document-generation
Generate professional contract analysis reports (.docx) for the Contract Intelligence Platform. Three report types: (1) Contract Risk Review - initial analysis with risk ratings, heat map, clause analysis, negotiation playbook; (2) Suggested Redlines and Revisions - proposed changes with before/a...
SKILL.md
Full skill instructions
CIP Document Generation Skill
Generate three contract analysis report types as professional .docx documents with consistent formatting, visual risk indicators, and structured data storage.
Report Types
| Report | Trigger | Output |
|---|---|---|
| Contract Risk Review | "analyze risk", "review contract", "risk assessment" | Risk ratings, heat map, clause analysis, negotiation playbook |
| Suggested Redlines and Revisions | "suggest changes", "redline", "revisions needed" | Proposed changes, before/βafter risk, negotiation guide |
| Version Comparison | "compare versions", "what changed", "V1 vs V2" | Delta analysis, grouped comparison table |
Workflow
Phase 1: Gather Requirements
Ask one at a time, wait for response:
- Report type? (Risk Review / Redlines / Comparison)
- Contract name?
- Your entity name (or token from document, e.g., [COMPANY_A])
- Counterparty name (or token, e.g., [COMPANY_B])
- Your position/βrole? (Buyer, Seller, Integrator, Vendor, etc.)
- For Comparison only: Version identifiers (e.g., "October Draft" β "November Final")
Phase 2: Extract Contract
Read docx skill first:
cat /βmnt/βskills/βpublic/βdocx/βSKILL.md
Extract text:
pandoc --track-changes=accept contract.docx -o contract.md
Phase 3: Analyze by Clause Type
Detect clauses using taxonomy keywords. Classify each by:
Three-tier clause weighting:
| Weight | Clause Types |
|---|---|
| Critical | Indemnification, Limitation of Liability, IP/βWork Ownership |
| High | Termination, Insurance, Vendor Displacement, Non-Solicitation |
| Standard | Confidentiality, Payment/βFees, Warranties, Force Majeure, Governing Law |
Risk levels: π΄ CRITICAL, π HIGH, π΅ MODERATE, π’ LOW
Phase 4: Generate Report
Read docx-js documentation:
cat /βmnt/βskills/βpublic/βdocx/βdocx-js.md
Generate .docx using report structure below.
Phase 5: Save to Database
On user finalization:
- Save to
reportstable withstatus: finalized - Extract findings to
report_findingstable - For comparisons, save deltas to
report_deltastable
Phase 6: Deliver
β
REPORT COMPLETE
[View Report](computer:///mnt/user-data/outputs/[filename].docx)
SUMMARY:
βββββββββββββββββββββββββββββββββββββββββββββ
[Report-specific summary]
Report Structures
Report 1: Contract Risk Review
1. Title Page
2. Executive Summary
3. Risk Heat Map
4. Clause Analysis Table (grouped by clause type)
5. Negotiation Playbook
6. Disclaimers
Report 2: Suggested Redlines and Revisions
1. Title Page
2. Executive Summary
3. Combined Risk Matrix (Before | After | Delta)
4. Redline Table (grouped by clause type)
5. Implementation Notes
6. Negotiation Guide
7. Disclaimers
Report 3: Version Comparison
1. Title Page
2. Executive Summary
3. Combined Risk Matrix (V1 | V2 | Delta)
4. Detailed Comparison Table (grouped by clause type)
5. Disclaimers
Component Specifications
Title Page
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β [CONTRACT NAME] β
β β
β [REPORT TYPE TITLE] β
β β
β [Version info - comparison only] β
β β
β Date: [Date] β
β β
β Our Entity: [COMPANY_A] β
β Counterparty: [COMPANY_B] β
β Position: [Role] β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Report type titles:
- CONTRACT RISK REVIEW
- SUGGESTED REDLINES AND REVISIONS
- VERSION COMPARISON REPORT
Executive Summary: Contract Risk Review
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OVERALL RISK ASSESSMENT: [CRITICAL / HIGH / MODERATE / LOW]β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β TOP CONCERNS β
β 1. [Clause type]: [One-line concern] β
β 2. [Clause type]: [One-line concern] β
β 3. [Clause type]: [One-line concern] β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β RISK DISTRIBUTION β
β π΄ CRITICAL: [n] π HIGH: [n] π΅ MODERATE: [n] π’ LOW: [n]β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Overall Risk Scoring (adjectival, clause-weighted):
IF any Critical-weight clause has CRITICAL risk β Overall: CRITICAL
ELSE IF any Critical-weight clause has HIGH risk β Overall: HIGH
ELSE IF any High-weight clause has CRITICAL risk β Overall: HIGH
ELSE IF multiple High-weight clauses have HIGH risk β Overall: HIGH
ELSE IF any clause has HIGH risk β Overall: MODERATE
ELSE β Overall: LOW
Executive Summary: Suggested Redlines and Revisions
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β REVISION IMPACT β
β β Before β After β β
β π΄ CRITICAL β [n] β [n] β β
β π HIGH β [n] β [n] β β
β π΅ MODERATE β [n] β [n] β β
β π’ LOW β [n] β [n] β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β CHANGES PROPOSED β
β Total: [n] Dealbreaker: [n] | Industry Standard: [n] | Nice-to-Have: [n]β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β KEY REVISIONS β
β 1. [Clause type]: [One-line change summary] β
β 2. [Clause type]: [One-line change summary] β
β 3. [Clause type]: [One-line change summary] β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Executive Summary: Version Comparison
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β VERSION DELTA β
β β V1 β V2 β Delta β β
β π΄ CRITICAL β [n] β [n] β [Β±n] β β
β π HIGH β [n] β [n] β [Β±n] β β
β π΅ MODERATE β [n] β [n] β [Β±n] β β
β π’ LOW β [n] β [n] β [Β±n] β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β CHANGES DETECTED β
β Total: [n] Additions: [n] | Modifications: [n] | Deletions: [n]β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β KEY THEMES (by clause priority) β
β β
β Critical Weight: β
β β’ Indemnification: [change summary or "No changes"] β
β β’ Limitation of Liability: [change summary or "No changes"]β
β β’ IP/βWork Ownership: [change summary or "No changes"] β
β β
β High Weight: β
β β’ Termination: [change summary or "No changes"] β
β β’ Insurance: [change summary or "No changes"] β
β β’ Vendor Displacement: [change summary or "No changes"] β
β β’ Non-Solicitation: [change summary or "No changes"] β
β β
β Standard Weight: [n] changes across [n] clause types β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Combined Risk Matrix
Used in: Reports 2 and 3
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RISK MATRIX β
ββββββββββββββββββββββββββββ¬βββββββββββ¬βββββββββββ¬βββββββββ β
β Clause Type β Before/βV1β After/βV2 β Delta β β
ββββββββββββββββββββββββββββΌβββββββββββΌβββββββββββΌβββββββββ€ β
β [Clause with findings] β π΄ β π β βΌ β β
β [Clause with findings] β π β π΅ β βΌ β β
ββββββββββββββββββββββββββββ΄βββββββββββ΄βββββββββββ΄βββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β NO CHANGES REQUIRED β
β β’ [Section] [Title] β’ [Section] [Title] β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Delta symbols: β² (increased), βΌ (decreased), β (unchanged)
Risk Heat Map
Used in: Report 1
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RISK HEAT MAP β
ββββββββββββββββββββββββ¬βββββββ¬βββββββ¬βββββββ¬βββββββ β
β Clause Type β CRIT β HIGH β MOD β LOW β β
ββββββββββββββββββββββββΌβββββββΌβββββββΌβββββββΌβββββββ€ β
β [Clause type] β π΄ β β β β β
β [Clause type] β β π β β β β
ββββββββββββββββββββββββ΄βββββββ΄βββββββ΄βββββββ΄βββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β NO FINDINGS β
β β’ [Section] [Title] β’ [Section] [Title] β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Clause Analysis Table
Used in: Report 1 (grouped by clause type)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β [CLAUSE TYPE] π΄ β
βββββββββββ¬βββββββ¬βββββββββββββββββββ¬ββββββββββββββββββββββββββ€
β Section β Risk β Concern β Recommendation β
βββββββββββΌβββββββΌβββββββββββββββββββΌββββββββββββββββββββββββββ€
β [#] β π΄ β [Concern text] β [Recommendation text] β
βββββββββββ΄βββββββ΄βββββββββββββββββββ΄ββββββββββββββββββββββββββ
Redline Table
Used in: Report 2 (grouped by clause type)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β [CLAUSE TYPE] π΄ β
βββββββββββ¬βββββββ¬ββββββββββββββββββ¬ββββββββββββββββββ¬βββββββββββββββββββββββββ€
β Section β Risk β Original β Proposed Change β Rationale β
βββββββββββΌβββββββΌββββββββββββββββββΌββββββββββββββββββΌβββββββββββββββββββββββββ€
β [#] β π΄ β [Original text] β [Redlined text] β [Rationale text] β
βββββββββββ΄βββββββ΄ββββββββββββββββββ΄ββββββββββββββββββ΄βββββββββββββββββββββββββ
Comparison Table
Used in: Report 3 (5-column, sequential with related clauses)
| # | Section / Category | V1 (Original) | V2 (Final) - Redlined | Business Impact |
|---|---------------------|---------------|----------------------|-----------------|
| [n] | [#] - [Title] | [V1 text] | [V2 redlined text] | [Impact narrative] |
| | Related: [x.x, y.y] | | | |
Negotiation Playbook
Used in: Report 1
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β NEGOTIATION PLAYBOOK β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β YOUR LEVERAGE β
β β’ [Leverage point] β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β COUNTERPARTY LEVERAGE β
β β’ [Their leverage point] β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β RECOMMENDED SEQUENCE β
β 1. π΄ [Critical clause first] β
β 2. π [High clause second] β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β POTENTIAL TRADE-OFFS β
β β’ Give π΅ [Moderate item] β Get π΄ [Critical item] β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Negotiation Guide
Used in: Report 2
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β NEGOTIATION GUIDE β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β TALKING POINTS β
β π΄ [Clause] ([Section]) β
β β’ [Key argument] β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β CONCESSION STRATEGY β
β ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββ β
β β GIVE β GET β β
β ββββββββββββββββββββββββββΌβββββββββββββββββββββββββ€ β
β β π΅ [Moderate item] β π΄ [Critical item] β β
β ββββββββββββββββββββββββββ΄βββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β WALK-AWAY TRIGGERS β
β β’ π΄ [Dealbreaker condition] β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Implementation Notes
Used in: Report 2
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β IMPLEMENTATION NOTES β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β SEQUENCING β
β 1. π΄ [Section] - [Why first] β
β 2. π [Section] - [Dependency note] β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β DEPENDENCIES β
β β’ [Section] β requires [Other section] first β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β NOTES β
β β’ [Special considerations] β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Disclaimers
Used in: All reports
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DISCLAIMER β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Risk Advisory: This report applies generally accepted β
β contract risk categories and contract management best β
β practices. Stakeholders must use this analysis to make β
β informed business decisions regarding risk acceptance and β
β mitigation. Failure to address identified risks may result β
β in material financial, operational, or legal exposure. β
β β
β Legal: This analysis is for informational purposes only and β
β does not constitute legal advice. Consult qualified legal β
β counsel before making decisions based on this report. β
β β
β AI-Generated: This report was generated with AI assistance. β
β All findings should be verified against source documents. β
β β
β Confidential: This document contains confidential analysis. β
β Do not distribute without authorization. β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Redline Notation
| Change Type | Markdown | .docx Format |
|---|---|---|
| Deletion | ~~text~~ | Red #FF0000 strikethrough |
| Addition | **text** | Green #00B050 bold |
| New section | **[NEW]** prefix | Green bold |
| Deleted section | ~~[DELETED]~~ prefix | Red strikethrough |
Example: The cure period shall be ~~fifteen (15)~~ **thirty (30)** calendar days.
Visual Specifications
Risk Level Colors
| Risk Level | Symbol | Hex Color |
|---|---|---|
| CRITICAL | π΄ | #C00000 |
| HIGH | π | #ED7D31 |
| MODERATE | π΅ | #2E75B6 |
| LOW | π’ | #00B050 |
Delta Symbols
| Symbol | Meaning |
|---|---|
| β² | Risk increased |
| βΌ | Risk decreased |
| β | No change |
Document Styling
| Element | Value |
|---|---|
| Header background | Navy #1F4E79 |
| Header text | White #FFFFFF |
| Body font | Arial |
| Margins | 0.75" |
Clause Type Taxonomy
Detection Keywords
| Clause Type | Keywords |
|---|---|
| Indemnification | indemnify, hold harmless, defend |
| Limitation of Liability | limitation, liability cap, consequential, damages |
| IP/βWork Ownership | intellectual property, work product, ownership, license |
| Termination | termination, cancel, cure period, breach |
| Insurance | insurance, coverage, policy, certificate |
| Vendor Displacement | transition, displacement, incumbent, handover |
| Non-Solicitation | non-solicit, non-compete, hiring, recruit |
| Confidentiality | confidential, NDA, proprietary, disclose |
| Payment/βFees | payment, fees, invoice, net, billing |
| Warranties | warrant, represent, guarantee, covenant |
| Force Majeure | force majeure, act of god, pandemic |
| Governing Law | governing law, jurisdiction, venue, choice of law |
Database Storage
Reports saved to SQLite on finalization.
See references/βdatabase-schema.md for full schema.
Tables:
reports- Core metadata, versionedreport_findings- Queryable findings per clausereport_deltas- Version comparison deltas
File Output
Naming convention:
[ContractName]_[ReportType]_[Date].docx
Examples:
MSA_Risk_Review_20251129.docxMSA_Redlines_20251129.docxMSA_V1_to_V2_Comparison_20251129.docx
Output location:
/βmnt/βuser-data/βoutputs/
References
references/βclause-taxonomy.md- Full keyword lists and classification rulesreferences/βdatabase-schema.md- SQLite schema with versioningreferences/βcolor-specs.md- Hex codes and styling details
Scripts
scripts/βextract_clauses.py- Clause detection and classificationscripts/βgenerate_risk_review.py- Report 1 generationscripts/βgenerate_redline.py- Report 2 generationscripts/βgenerate_comparison.py- Report 3 generation
