Add sspdf partner-built plugin — PDF generation#108
Add sspdf partner-built plugin — PDF generation#108hugopalma17 wants to merge 1 commit intoanthropics:mainfrom
Conversation
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.
There was a problem hiding this comment.
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) andsspdf-theme-generator(theme creation). - Added two slash commands:
/generate-pdfand/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',''))") |
There was a problem hiding this comment.
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.
| 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')))") |
| ### 2. Read Documentation | ||
|
|
||
| ```bash | ||
| SSPDF_DIR=$(node -e "console.log(require.resolve('h17-sspdf').replace('/index.js',''))") |
There was a problem hiding this comment.
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.
| 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')))") |
| ```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" }); | ||
| ``` |
There was a problem hiding this comment.
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.
| { | ||
| "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": { |
There was a problem hiding this comment.
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.
| Resolve the package location: | ||
|
|
||
| ```bash | ||
| SSPDF_DIR=$(node -e "console.log(require.resolve('h17-sspdf').replace('/index.js',''))") |
There was a problem hiding this comment.
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.
| 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')))") |
| After rendering, confirm the PDF exists and open it for the user: | ||
|
|
||
| ```bash | ||
| ls -la output/my-doc.pdf | ||
| open output/my-doc.pdf | ||
| ``` |
There was a problem hiding this comment.
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.
| Resolve the package location: | ||
|
|
||
| ```bash | ||
| SSPDF_DIR=$(node -e "console.log(require.resolve('h17-sspdf').replace('/index.js',''))") |
There was a problem hiding this comment.
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.
| 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')))") |
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:
sspdf(document generation) andsspdf-theme-generator(theme creation from brand specs)/generate-pdfand/create-themeWhy this fits the marketplace:
canvas(npm). Works anywhere Node.js runs.Package:
h17-sspdfon npmPlugin structure