report-generation
Creating structured PDF reports from data, templates, and AI-generated content using professional toolchains
npx skills add cosmicstack-labs/mercury-agent-skills --skill report-generation --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Converts data into polished PDF reports. It supports a full pipeline from data sources and templates to a final PDF, including metadata, tables, charts, and formatted sections. The skill provides a template-driven approach (HTML + CSS) rendered with Jinja2, then converted to PDF with WeasyPrint, producing a professional multi-section document.
How it works
- Defines a standardized report structure and metadata (ReportMetadata) used to render the cover and TOC.
- Uses a Jinja2 + WeasyPrint pipeline: an HTML template (templates/report.html) and a Python generator (Python Report Generator) to render sections.
- Chart generation is handled by a Python method that creates charts with matplotlib and saves them as images, which are embedded in sections.
- Data loading supports CSV, JSON, and XLSX formats via load_data.
- build_sections_from_data constructs a list of sections from a configuration object, handling text, table, chart, and callout blocks.
- generate() orchestrates loading data, building sections, rendering HTML, and producing a PDF via WeasyPrint.
When to use it
Use when you need a structured, data-driven PDF report with a clear layout, executive sections, charts, and tables. Suitable for business reports like quarterly analyses or performance reviews where a branded PDF is required.
What it can touch
- Data sources: CSV, JSON, XLSX (via load_data).
- Template engine: Jinja2 (via the template directory).
- Output: PDF files created by WeasyPrint from rendered HTML.
- Chart images: generated and saved to disk during section construction.
- Template: HTML template at templates/report.html.
Caveats
- Requires external libraries: jinja2, matplotlib, pandas, weasyprint.
- Data formats other than CSV/JSON/XLSX are not supported (raises ValueError).
- Output filename derives from metadata.document_id or defaults to 'report'.
- Code assumes a specific template structure and section/block configuration to render correctly.
# Report Generation Create structured, data-driven PDF reports that communicate insights effectively. This skill covers the full pipeline — from data sources and templates to polished PDF output with charts, tables, and professional formatting. --- ## Report Structure Fundamentals A well-structured report follows a consistent pattern that guides the reader from context to conclusions. ### Standard Report Anatomy ```text ┌────────────────────────────────────────┐ │ Cover Page │ │ Title, subtitle, author, date, │ │ organization branding │ ├────────────────────────────────────────┤ │ Table of Contents │ │ Auto-generated from headings │ ├────────────────────────────────────────┤ │ Executive Summary │ │ Key findings in 1-2 paragraphs │ ├────────────────────────────────────────┤ │ Introduction / Background │ │ Context, objectives, scope │ ├────────────────────────────────────────┤ │ Methodology │ │ How data was collected/analyzed │ ├────────────────────────────────────────┤ │ Findings / Results │ │ Data presentation with charts/tables │ ├────────────────────────────────────────┤ │ Discussion │ │ Interpretation of results │ ├────────────────────────────────────────┤ │ Conclusions │ │ Summ
- Report Structure Fundamentals
- Standard Report Anatomy
- Report Metadata Standards
- 2. Template Engines
- Jinja2 + WeasyPrint Pipeline
- 3. Data Source Integration
- CSV to Report
- SQL Database → Report
- API Data → Report
- 4. Chart Embedding in Reports
- Matplotlib for Report Charts
- Programmatic Chart Generation (Plotly to Static Images)
- 5. Dynamic Tables
- Complex Table Formatting
What does the report-generation skill do?
Creating structured PDF reports from data, templates, and AI-generated content using professional toolchains
How do I install it?
Run `npx skills add cosmicstack-labs/mercury-agent-skills --skill report-generation --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From cosmicstack-labs/mercury-agent-skills, a repository with 364 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.