Skip to content

Add sspdf partner-built plugin — PDF generation#108

Open
hugopalma17 wants to merge 1 commit intoanthropics:mainfrom
hugopalma17:add-plugin/sspdf
Open

Add sspdf partner-built plugin — PDF generation#108
hugopalma17 wants to merge 1 commit intoanthropics:mainfrom
hugopalma17:add-plugin/sspdf

Conversation

@hugopalma17
Copy link

Summary

Adds sspdf to the partner-built plugins directory — a PDF document generation plugin that lets Claude produce finished deliverables directly, not just analyze or summarize data.

What it does: Claude builds a source JSON (content) and picks or creates a theme (styling), then the sspdf engine renders a publication-ready PDF. No LibreOffice, no headless browsers, no intermediate HTML.

What's included:

  • 2 skills: sspdf (document generation) and sspdf-theme-generator (theme creation from brand specs)
  • 2 commands: /generate-pdf and /create-theme
  • README with quick start and capability overview

Why this fits the marketplace:

  • Fills an output gap — the existing plugins cover research, analysis, planning, and communication. This one produces the final deliverable: a formatted PDF document. Reports, invoices, tear sheets, branded materials — the last mile from analysis to output.
  • No OS dependencies — renders via jsPDF. The only native addon is canvas (npm). Works anywhere Node.js runs.
  • Deterministic output — math-first layout engine. Same input, same PDF, every machine.
  • Charts and tables native — table operation with page-break header repetition, alternating row shading. Chart plugin for bar, line, pie, stacked/grouped bar charts as embedded images.
  • Content/style separation — source JSON contains no visual properties. Themes control all styling. Swap themes without touching content.

Package: h17-sspdf on npm

Plugin structure

partner-built/sspdf/
├── .claude-plugin/plugin.json
├── README.md
├── commands/
│   ├── generate-pdf.md
│   └── create-theme.md
└── skills/
    ├── sspdf/SKILL.md
    └── sspdf-theme-generator/SKILL.md

PDF generation plugin for reports, tear sheets, invoices, and branded
deliverables. Renders directly via jsPDF with deterministic math-first
layout — no LibreOffice, no headless browsers.

Includes 2 skills (document generation, theme creation), 2 commands
(/generate-pdf, /create-theme), native tables with page-break header
repetition, and embedded chart rendering.
Copilot AI review requested due to automatic review settings March 11, 2026 00:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new partner-built plugin, sspdf, intended to enable PDF document generation via the h17-sspdf npm package, including end-user workflows for generating documents and creating themes.

Changes:

  • Added two skills: sspdf (PDF generation) and sspdf-theme-generator (theme creation).
  • Added two slash commands: /generate-pdf and /create-theme.
  • Added plugin manifest and README documentation for installation and usage.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
partner-built/sspdf/skills/sspdf/SKILL.md End-to-end workflow/instructions for building source JSON + rendering PDFs via h17-sspdf.
partner-built/sspdf/skills/sspdf-theme-generator/SKILL.md Theme authoring instructions and theme schema guidance.
partner-built/sspdf/commands/generate-pdf.md Slash command workflow for generating a PDF from a description.
partner-built/sspdf/commands/create-theme.md Slash command workflow for generating a custom theme from brand specs.
partner-built/sspdf/README.md Plugin overview, capabilities, requirements, and quick start.
partner-built/sspdf/.claude-plugin/plugin.json Plugin manifest metadata for marketplace/install.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

### 2. Read Documentation

```bash
SSPDF_DIR=$(node -e "console.log(require.resolve('h17-sspdf').replace('/index.js',''))")
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SSPDF_DIR snippet depends on replace('/index.js',''), which is brittle (may not be the module entrypoint) and not Windows-safe. Prefer a path.dirname(require.resolve('h17-sspdf/package.json'))-style approach so the documentation lookup works cross-platform.

Suggested change
SSPDF_DIR=$(node -e "console.log(require.resolve('h17-sspdf').replace('/index.js',''))")
SSPDF_DIR=$(node -e "const path = require('path'); console.log(path.dirname(require.resolve('h17-sspdf/package.json')))")

Copilot uses AI. Check for mistakes.
### 2. Read Documentation

```bash
SSPDF_DIR=$(node -e "console.log(require.resolve('h17-sspdf').replace('/index.js',''))")
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SSPDF_DIR snippet is fragile due to hard-coded '/index.js' replacement and can break on Windows path separators. Consider switching to a path-based require.resolve('h17-sspdf/package.json') approach for a reliable package root path.

Suggested change
SSPDF_DIR=$(node -e "console.log(require.resolve('h17-sspdf').replace('/index.js',''))")
SSPDF_DIR=$(node -e "const path = require('path'); console.log(path.dirname(require.resolve('h17-sspdf/package.json')))")

Copilot uses AI. Check for mistakes.
Comment on lines +49 to +56
```bash
# CLI
npx h17-sspdf -s source.json -t financial -o output/report.pdf

# Programmatic
const { renderDocument } = require("h17-sspdf");
renderDocument({ source, theme, outputPath: "output/report.pdf" });
```
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fenced block is labeled as bash but includes JavaScript (require(...) / renderDocument(...)), which will render with misleading syntax highlighting and may confuse copy/paste. Split into separate bash and js code blocks (or use an untyped fence) to match the actual languages.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +5
{
"name": "sspdf",
"version": "1.0.0",
"description": "Generate publication-ready PDF documents — financial reports, tear sheets, invoices, and branded deliverables — directly from Claude with deterministic, math-first rendering. No LibreOffice, no browser, no pixel nudging.",
"author": {
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This plugin directory is missing a .mcp.json at the root. The repo-level docs describe the standard plugin layout as including .mcp.json alongside .claude-plugin/plugin.json (see README.md:51-59), so consider adding an empty config (e.g., { "mcpServers": {} }) for consistency even if this plugin doesn’t need external tool connections.

Copilot uses AI. Check for mistakes.
Resolve the package location:

```bash
SSPDF_DIR=$(node -e "console.log(require.resolve('h17-sspdf').replace('/index.js',''))")
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command used to derive SSPDF_DIR relies on string-replacing '/index.js', which is brittle (entry point may not be index.js) and will break on Windows paths (backslashes). Prefer resolving the package root via Node's path utilities (e.g., path.dirname(require.resolve('h17-sspdf/package.json'))) to keep the instructions cross-platform and robust.

Suggested change
SSPDF_DIR=$(node -e "console.log(require.resolve('h17-sspdf').replace('/index.js',''))")
SSPDF_DIR=$(node -e "console.log(require('path').dirname(require.resolve('h17-sspdf/package.json')))")

Copilot uses AI. Check for mistakes.
Comment on lines +182 to +187
After rendering, confirm the PDF exists and open it for the user:

```bash
ls -la output/my-doc.pdf
open output/my-doc.pdf
```
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open output/my-doc.pdf is macOS-specific; these verification steps won't work on Windows/Linux as written. Consider either providing OS-specific alternatives (xdg-open, start) or phrasing this as “open the PDF in your viewer” to keep the instructions portable.

Copilot uses AI. Check for mistakes.
Resolve the package location:

```bash
SSPDF_DIR=$(node -e "console.log(require.resolve('h17-sspdf').replace('/index.js',''))")
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SSPDF_DIR derivation uses replace('/index.js',''), which is not robust across package entrypoints and fails on Windows paths. Use a path-based approach (e.g., path.dirname(require.resolve('h17-sspdf/package.json'))) so users can reliably locate DOCUMENTATION.md on all platforms.

Suggested change
SSPDF_DIR=$(node -e "console.log(require.resolve('h17-sspdf').replace('/index.js',''))")
SSPDF_DIR=$(node -e "console.log(require('path').dirname(require.resolve('h17-sspdf/package.json')))")

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants