direct-reportlab-pdf-generation

direct-reportlab-pdf-generation is a skill for Claude Code, Codex from HKUDS/OpenSpace. It costs 29 tokens per session (1,493 once invoked), scanned A, original, MIT.

A method for creating structured, multi-page PDF documents directly with Python and ReportLab, a library for laying out PDFs.

In plain words
What is it for?
Use it to build PDFs with title pages, sections, tables, optional contents pages, and appendices.
Why use it?
It provides more predictable control when an automated document-making tool fails or produces unreliable layouts.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to build PDFs with title pages, sections, tables, optional contents pages, and appendices.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hkuds/openspace/direct-reportlab-pdf-generation
About the project

OpenSpace is a skill-management layer for AI agents that stores, retrieves, evaluates, shares, and improves reusable workflows. It is intended for people using multiple coding agents who want skills to be reused and refined based on task outcomes. The catalogue provides 200 skills for use with OpenSpace and the agents it supports.

HKUDS/OpenSpace · 8,146 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add HKUDS/OpenSpace --skill direct-reportlab-pdf-generation
Clone the repo
git clone --depth 1 https://github.com/HKUDS/OpenSpace

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for direct-reportlab-pdf-generation

README.md
[![agentmods](https://agentmods.dev/badge/skills/hkuds/openspace/direct-reportlab-pdf-generation/github.svg)](https://agentmods.dev/skills/hkuds/openspace/direct-reportlab-pdf-generation)
Your own site
<a href="https://agentmods.dev/skills/hkuds/openspace/direct-reportlab-pdf-generation"><img src="https://agentmods.dev/badge/skills/hkuds/openspace/direct-reportlab-pdf-generation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for direct-reportlab-pdf-generation

Your own site · 80×15
<a href="https://agentmods.dev/skills/hkuds/openspace/direct-reportlab-pdf-generation"><img src="https://agentmods.dev/badge/skills/hkuds/openspace/direct-reportlab-pdf-generation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,493 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00029 $0.01493
Opus 5.5 $0.00012 $0.00597
Sonnet 5.5 $0.00006 $0.00299
Haiku 4.5 $0.00003 $0.00149

Measured 3mo ago against content hash b185f70c7752, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

direct-reportlab-pdf-generation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

benchmarks/gdpval/skills/direct-reportlab-pdf-generation/SKILL.md · 195 lines

How it starts

The opening of the file, as written. The whole thing — 195 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Direct ReportLab PDF Generation via run_shell

When to Use This Skill

Use this pattern when:

  • You need to create a complex, multi-page PDF document with structured content
  • Delegating PDF generation to shell_agent fails or produces unreliable results
  • You need fine-grained control over PDF layout, styling, and pagination

Core Technique

Instead of asking shell_agent to handle PDF creation, write inline Python code using the reportlab library and execute it directly via run_shell. This gives you deterministic control over the document structure.

Step-by-Step Instructions

Step 1: Prepare Your PDF Content

Organize your content into logical sections that will become pages or page groups:

  • Title page
  • Table of contents (optional)
  • Main content sections
  • Appendices or references

Step 2: Write the ReportLab Python Script

Create a Python script that uses these key reportlab components:

from reportlab.lib import colors
from reportlab.lib.pagesizes import letter
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import inch
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak, Image
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY

def create_pdf(filename, content_data):
    doc = SimpleDocTemplate(filename, pagesize=letter,
                           rightMargin=72, leftMargin=72,
                           topMargin=72, bottomMargin=72)
    
    story = []
    styles = getSampleStyleSheet()
    
    # Custom styles
    title_style = ParagraphStyle(
        'CustomTitle',
        parent=styles['Heading1'],
        fontSize=24,
        textColor=colors.HexColor('#1a1a1a'),
        spaceAfter=30,
        alignment=TA_CENTER
    )
    
    heading_style = ParagraphStyle(
        'CustomHeading',
        parent=styles['Heading2'],
        fontSize=16,
        textColor=colors.HexColor('#2c3e50'),
        spaceBefore=20,
        spaceAfter=12
    )
    
    body_style = ParagraphStyle(
        'CustomBody',
        parent=styles['Normal'],
        fontSize=11,
        leading=16,
        alignment=TA_JUSTIFY
    )
    
    # Build document content
    for section in content_data:
        if section['type'] == 'title':
            story.append(Paragraph(section['text'], title_style))
        elif section['type'] == 'heading':
            story.append(Paragraph(section['text'], heading_style))
        elif section['type'] == 'paragraph':
            story.append(Paragraph(section['text'], body_style))
            story.append(Spacer(1, 12))
        elif section['type'] == 'table':
            table = Table(section['data'], colWidths=section.get('col_widths'))
            table.setStyle(TableStyle([
                ('BACKGROUND', (0, 0), (-1, 0), colors.grey),
                ('TEXTCOLOR', (0, 0), (-1, 0), colors.whitesmoke),
                ('ALIGN', (0, 0), (-1, -1), 'CENTER'),
                ('FONTNAME', (0, 0), (-1, 0), 'Helvetica-Bold'),
                ('FONTSIZE', (0, 0), (-1, 0), 12),
                ('BOTTOMPADDING', (0, 0), (-1, 0), 12),
                ('BACKGROUND', (0, 1), (-1, -1), colors.beige),
                ('GRID', (0, 0), (-1, -1), 1, colors.black),
            ]))
            story.append(table)
            story.append(Spacer(1, 20))
        elif section['type'] == 'pagebreak':
            story.append(PageBreak())
    
    doc.build(story)

Read the full file on GitHub · 195 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 195 lines · 29 tokens per session scan A b185f70c7752

Subscribe to this mod's changes

direct-reportlab-pdf-generation is a skill published in the GitHub repository HKUDS/OpenSpace (8,146 stars, last pushed 18d ago), licensed MIT. It adds 29 tokens to every session and 1,493 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

direct-reportlab-pdf-generation compared with skills from other repositories

direct-reportlab-pdf-generation next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
direct-reportlab-pdf-generationHKUDS/OpenSpaceSkill8.1k18d agoMITA29Claude Code, Codex
apify-youtube-transcript-scrapersickn33/agentic-awesome-skillsSkill51kyesterdayMITA48Claude Code
report-to-pdfasgeirtj/system_prompts_leaksSkill74kyesterdayCC0-1.0A17Claude Code, Codex
skill-doc-deliverynyldn/claude-octopusSkill4.5ktodayMITA29Claude Code
meta-web-to-pdf-briefingopensquilla/opensquillaSkill7.2k4d agoApache-2.0A45Claude Code, Codex
chat-complex-documentsvellum-ai/vellum-assistantSkill1.5k5d agoMITA90Claude Code, Codex
byted-las-pdf-parse-doubaobytedance/agentkit-samplesSkill4965d agoApache-2.0A57Claude Code, Codex