From legal
Úsalo después de una revisión de contrato para generar un informe PDF profesional listo para el cliente. Activa cuando alguien diga 'genera el PDF', 'quiero el informe en PDF', 'crea el informe para el cliente', o después de /legal:review. Genera PDF en A4 con portada, gauge de riesgo y resumen ejecutivo.
npx claudepluginhub catafal/ai-legal-spanishThis skill uses the workspace's default tool permissions.
You are the PDF report generator for `/legal report-pdf`. You collect data from the most recent contract review analysis and generate a professional, branded PDF document using Python and ReportLab.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Analyzes competition with Porter's Five Forces, Blue Ocean Strategy, and positioning maps to identify differentiation opportunities and market positioning for startups and pitches.
You are the PDF report generator for /legal report-pdf. You collect data from the most recent contract review analysis and generate a professional, branded PDF document using Python and ReportLab.
The user runs /legal report-pdf after having completed a contract review (via /legal review, /legal freelancer, or other analysis commands). You find the most recent analysis data, then generate a polished PDF report.
Search for the most recent contract review output file in the working directory. Look for files matching these patterns (in order of preference):
CONTRACT-REVIEW-*.mdFREELANCER-REVIEW-*.mdCOMPLIANCE-AUDIT-*.mdNDA-REVIEW-*.md.md file containing "Contract Safety Score" or "Freelancer Fairness Score" or "Compliance Scorecard"Use the Glob tool to find matching files. If multiple matches exist, use the most recently modified file.
If no analysis file is found:
/legal review <file> first, then run /legal report-pdf to generate the PDF."Read the analysis file and extract:
| Data Point | Where to Find It |
|---|---|
| Score | "Contract Safety Score: X/100" or "Freelancer Fairness Score: X/100" or "Overall: X%" |
| Grade | "Grade: [letter]" |
| Contract type | "Contract Type" row in details table |
| Parties | "Parties" row or "Hiring Party" / "Freelancer" rows |
| Date | From filename or "Effective Date" row |
| Risk dashboard | High/Medium/Low risk counts and clause names |
| Clause analysis | Each clause with risk level, description, and recommendation |
| Missing protections | "Missing Protections" section or "Freelancer Bill of Rights" |
| Obligations | "Obligations & Deadlines" table |
| Compliance flags | "Compliance Flags" section |
| Negotiation priorities | "Negotiation Priorities" numbered list |
| Next steps | "Recommended Next Steps" checklist |
| Executive summary | "Executive Summary" section |
Search for the PDF generation Python script in these locations (in order):
[working directory]/scripts/generate_pdf_report.py[working directory]/scripts/generate_pdf_report.py../scripts/generate_pdf_report.py (one level up from working directory)Use the Glob tool to search for **/generate_pdf_report.py within the project.
Run the script, passing it the path to the analysis markdown file:
python3 [script_path] --input [analysis_file_path] --output CONTRACT-REVIEW-REPORT.pdf
If no script is found, generate the PDF directly using inline Python with ReportLab. Write and execute a Python script that produces the PDF.
First, check that ReportLab is installed:
pip3 install reportlab 2>/dev/null || pip install reportlab 2>/dev/null
Then generate and execute the following Python script. The script MUST produce a professional PDF with all elements described in Phase 3.
The generated PDF MUST include all of the following sections with professional styling.
| Property | Value |
|---|---|
| Page size | A4 (210 × 297 mm) — standard in Spain and EU |
| Margins | 0.75" all sides |
| Font family | Helvetica (built into ReportLab) |
| Primary color | #1a1a2e (dark navy) |
| Accent color | #16213e (medium navy) |
| High risk color | #d32f2f (red) |
| Medium risk color | #f9a825 (amber/yellow) |
| Low risk color | #388e3c (green) |
| Background | White (#ffffff) |
| Table header bg | #1a1a2e (dark navy) |
| Table alt row | #f5f5f5 (light gray) |
The cover page MUST include:
[Top: Thin colored bar across full width in primary color]
INFORME DE REVISIÓN CONTRACTUAL
CONTRACT REVIEW REPORT
[Large, bold, primary color, centered]
[Subtitle: Contract type or "Análisis Jurídico Integral / Comprehensive Legal Analysis"]
[Large circular score gauge graphic — see 3.3]
Puntuación de Seguridad Contractual / Contract Safety Score: [SCORE]/100
Calificación / Grade: [LETTER] — [LABEL]
[Color-coded based on score: red for F/D, amber for C, green for B/A]
Preparado para / Prepared for: [Party name or "Contract Review"]
Fecha / Date: [DD/MM/YYYY — use Spanish date format]
[Bottom of page:]
⚠️ AVISO LEGAL / LEGAL DISCLAIMER: Este análisis ha sido generado por IA y
no constituye asesoramiento jurídico. Consulte siempre a un abogado colegiado.
This analysis is AI-generated and does not constitute legal advice.
Always consult a licensed attorney.
[Thin colored bar at bottom]
Draw a semi-circular gauge (speedometer style) using ReportLab drawing primitives:
Implementation approach using ReportLab:
from reportlab.graphics.shapes import Drawing, Wedge, String, Line
from reportlab.graphics import renderPDF
from reportlab.lib.colors import Color
import math
# Create a drawing for the gauge
# Use Wedge shapes for the colored arc segments
# Use Line for the needle
# Use String for the score text
If the gauge is too complex to render reliably, fall back to a large color-coded score box:
+----------------------------------+
| CONTRACT SAFETY SCORE |
| |
| 72 / 100 |
| Grade: B |
| (Fair) |
+----------------------------------+
Color the box border and score text based on the grade.
EXECUTIVE SUMMARY
[Section header with colored underline]
[3-4 sentence overview from the analysis]
CONTRACT DETAILS
[Table with alternating row colors:]
| Field | Value |
| Contract Type | [type] |
| Parties | [party 1] ↔ [party 2] |
| Effective Date | [date] |
| Term | [duration] |
| Total Value | [amount] |
| Governing Law | [jurisdiction] |
RISK DASHBOARD
[Section header with colored underline]
[Color-coded risk summary boxes in a row:]
+----------+ +----------+ +----------+
| 🔴 HIGH | | 🟡 MED | | 🟢 LOW |
| [n] | | [n] | | [n] |
+----------+ +----------+ +----------+
[Risk matrix table:]
| Risk Level | Count | Clauses Affected |
|------------|-------|----------------------------|
| High | [n] | [clause1], [clause2], ... |
| Medium | [n] | [clause1], [clause2], ... |
| Low | [n] | [clause1], [clause2], ... |
Use colored circles or squares (red/yellow/green) for the risk level indicators in the table. ReportLab can draw these with canvas.circle() or by using colored table cell backgrounds.
For EACH clause analyzed, create a structured entry:
[Risk level color bar on left margin]
CLAUSE: [Clause Name] — Section [X.X]
Risk Level: [🔴 HIGH / 🟡 MEDIUM / 🟢 LOW]
What it says:
[plain English summary]
Why it matters:
[risk explanation]
What you could lose:
[quantified impact]
Recommended change:
[specific alternative language]
[Separator line]
Group clauses by risk level: all High Risk first, then Medium, then Low.
MISSING PROTECTIONS
[Section header]
[Checklist table:]
| # | Protection | Status |
|---|-------------------------|--------|
| 1 | [protection name] | ❌ Missing |
| 2 | [protection name] | ✅ Present |
| 3 | [protection name] | ❌ Missing |
...
Use red background for missing items, green for present items.
OBLIGATIONS & DEADLINES
[Section header]
[Table:]
| Obligation | Responsible Party | Deadline | Consequence |
|------------|-------------------|----------|-------------|
| [obligation] | [who] | [when] | [what happens] |
COMPLIANCE FLAGS
[Section header]
[List of any regulatory or jurisdictional concerns identified]
NEGOTIATION PRIORITIES
[Section header]
1. [HIGHEST PRIORITY]
Current: [what the clause says now]
Proposed: [specific language to propose]
Why: [one-sentence justification]
2. [SECOND PRIORITY]
...
3. [THIRD PRIORITY]
...
Number and rank all priorities. Use bold for the priority title.
RECOMMENDED NEXT STEPS
[Section header]
☐ [First action]
☐ [Second action]
☐ [Third action]
☐ Consult a licensed attorney before signing
AVISO LEGAL / LEGAL DISCLAIMER
⚠️ Este documento ha sido generado por una herramienta de análisis jurídico
basada en IA. NO constituye asesoramiento jurídico y no debe utilizarse como
tal. El análisis se basa en interpretación automatizada de texto y puede no
capturar todos los matices del contrato ni del derecho aplicable.
This document was generated by an AI-powered legal analysis tool.
It does NOT constitute legal advice. The analysis is based on automated
text interpretation and may not capture all nuances of the contract
or applicable law.
CONSULTE SIEMPRE a un abogado colegiado antes de:
ALWAYS consult a licensed attorney before:
• Firmar cualquier contrato / Signing any contract
• Tomar decisiones jurídicas basadas en este análisis /
Making legal decisions based on this analysis
• Negociar términos contractuales / Negotiating contract terms
• Cualquier actuación con consecuencias legales /
Taking any action that could have legal consequences
Este informe se facilita únicamente a efectos informativos.
This report is provided for informational purposes only.
Generado / Generated: [DD/MM/YYYY HH:MM]
Herramienta / Tool: AI Legal Assistant — España — Claude Code
Every page after the cover should have:
[Left: "AI Legal Assistant España — Informe de Revisión Contractual"]
[Center: "CONFIDENCIAL / CONFIDENTIAL"]
[Right: "Página X de Y / Page X of Y"]
Use a thin line above the footer to separate it from content.
Date format throughout the PDF: Use DD/MM/YYYY (Spanish standard). Example: 10/04/2026 not April 10, 2026.
Write a complete Python script that:
Run the script using Bash:
cd [working directory] && python3 /tmp/generate_legal_pdf.py --input "[analysis_file]" --output "CONTRACT-REVIEW-REPORT.pdf"
After execution:
After generating the PDF:
CONTRACT-REVIEW-REPORT.pdf"| Error | Resolution |
|---|---|
| ReportLab not installed | Run pip3 install reportlab and retry |
| No analysis file found | Tell user to run /legal review first |
| Analysis file unreadable | Report the error, ask user to verify the file |
| PDF generation fails | Show the error, attempt to fix, retry once |
| Script not found and inline generation fails | Provide the markdown analysis as fallback and explain the PDF could not be generated |
| Python not available | Report that Python 3 is required for PDF generation |