Skip to content
Legal
Skill

/legal-report-pdf

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.

BOOST
From plugin
ai-legal-claude
1.8k13 skills5 agents
Install
$ npx -y skills add zubair-trabzada/ai-legal-claude --skill legal-report-pdf --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/legal-report-pdf

Context preview

The summary Claude sees to decide when to auto-load this skill.

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.

SKILL.md

legal-report-pdf.SKILL.md

Professional PDF Report Generator

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.

When This Skill Is Invoked

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.

---

Phase 1: Locate Analysis Data

1.1 Find the Most Recent Review

Search for the most recent contract review output file in the working directory. Look for files matching these patterns (in order of preference):

1. `CONTRACT-REVIEW-*.md` 2. `FREELANCER-REVIEW-*.md` 3. `COMPLIANCE-AUDIT-*.md` 4. `NDA-REVIEW-*.md` 5. Any `.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:**

  • Tell the user: "No contract review data found in the current directory. Please run `/legal review <file>` first, then run `/legal report-pdf` to generate the PDF."
  • Do NOT proceed.

1.2 Parse the Analysis Data

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 |

---

Phase 2: Locate or Generate the PDF Script

2.1 Look for Existing Script

Search for the PDF generation Python script in these locations (in order):

1. `[working directory]/ai-legal-claude/scripts/generate_pdf_report.py` 2. `[working directory]/scripts/generate_pdf_report.py` 3. `../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.

2.2 If Script Found

Run the script, passing it the path to the analysis markdown file:

python3 [script_path] --input [analysis_file_path] --output CONTRACT-REVIEW-REPORT.pdf

2.3 If Script Not Found — Generate Inline

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.

---

Phase 3: PDF Content and Layout Specification

The generated PDF MUST include all of the following sections with professional styling.

3.1 Page Setup

| Property | Value | |----------|-------| | Page size | Letter (8.5" x 11") | | 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) |

3.2 Cover Page

The cover page MUST include:

[Top: Thin colored bar across full width in primary color]

CONTRACT REVIEW REPORT
[Large, bold, primary color, centered]

[Subtitle: Contract type or "Comprehensive Legal Analysis"]

[Large circular score gauge graphic — see 3.3]

Contract Safety Score: [SCORE]/100
Grade: [LETTER] — [LABEL]
[Color-coded based on score: red for F/D, amber for C, green for B/A]

Prepared for: [Party name or "Contract Review"]
Date: [today's date]

[Bottom of page:]
⚠️ LEGAL DISCLAIMER: This analysis is AI-generated and does not
constitute legal advice. Always consult a licensed attorney.

[Thin colored bar at bottom]

3.3 Score Gauge Graphic

Draw a semi-circular gauge (speedometer style) using ReportLab drawing primitives:

  • Semi-circle arc from 0 to 180 degrees
  • Color gradient: red (left) to yellow (center) to green (right)
  • Needle pointing to the score position
  • Score number displayed large and centered below the gauge
  • Grade letter displayed below the score

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.

3.4 Executive Summary Page

EXECUTIVE SUMMARY
[Section header with colored underline]

[3-4 sentence overview from the analysis]

CONTRACT DETAILS
[Table with alternating row colors:]
| Field
Read more
Ships withai-legal-claude

AI Legal Assistant skill for Claude Code. Contract review, risk analysis, NDA generation, compliance auditing, negotiation strategy, and PDF reports — 14 skills, 5 parallel agents. If you want to learn how to sell this to real businesses, check out the Skool community

Get the whole plugin

Other skills on ai-legal-claude.