Skip to content
Agentmart
Submit a tool

build-html-to-pdf

Building server-side document generation that renders HTML templates to PDF — request contracts, template registries, deterministic rendering, verification.

Skill by soofi-xyz

IndexedMIT★ 3
Write a review

Chalk Labs

Need help deploying build-html-to-pdf?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/soofi-xyz-build-html-to-pdf

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Building server-side document generation that renders HTML templates to PDF — request contracts, template registries, deterministic rendering, verification.

Use cases: documents, frontend, backend

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/build-html-to-pdf

What's inside

Skill name
build-html-to-pdf
Description
Building server-side document generation that renders HTML templates to PDF — request contracts, template registries, deterministic rendering, verification.
License
MIT
Instructions
108 lines in SKILL.md · view on GitHub

Files (7)

  • SKILL.md
  • _sections.md · rules/
  • architecture-lambda-chromium-boundary.md · rules/
  • delivery-runtime-packaging-and-verification.md · rules/
  • implementation-chromium-pdf-rendering.md · rules/
  • implementation-html-rendering.md · rules/
  • implementation-request-contract.md · rules/

SKILL.md (first lines)

# Building HTML To PDF

Build HTML-first PDF generation workflows on AWS Lambda using Playwright and Chromium.

Follow `apply-engineering-guidelines` for repository-wide standards on TypeScript, CDK, testing, and observability.

## Architecture Boundary

Standardize on one render boundary:

- Lambda is the runtime
- Chromium is the PDF engine
- Playwright is the browser control layer
- HTML is the only layout source

Do NOT expand this skill to support office-document conversion, LibreOffice, Gotenberg, or multiple browser engines.

Read `rules/architecture-lambda-chromium-boundary.md`.

## Workflow: Five Phases

Follow these phases in order. Do NOT skip ahead.

### Phase 1 — Define the Request Contract

Define the generation contract before implementing templates or renderers.

- Require `templateId`, `data`, `pdf`, and `renderer.html`
- Keep output file naming and metadata explicit
- Do not let callers choose arbitrary file paths
- Do not accept raw caller-supplied HTML as renderer input

Read `rules/implementation-request-contract.md`.

### Phase 2 — Validate Before Rendering

Validate the request envelope and template-specific payload before any HTML generation starts.

- Reject malformed requests early
- Fail on missing required print fields
- Forbid unexpected properties where contract stability matters

Read `rules/implementation-request-contract.md`.

### Phase 3 — Render Deterministic HTML

Render HTML from a known template registry, not from ad hoc strings.

- Resolve the template from `templateId`
- Bind validated data only
- Inject print CSS once
- Resolve packaged or embedded assets predictably
- Keep the HTML as a string until browser rendering begins

Read `rules/implementation-html-rendering.md`.

### Phase 4 — Render PDF With Chromium

Keep the Chromium stage focused on browser execution.

- Launch headless Chromium through Playwright
- Create a page and load the HTML
- Wait for a stable ready state
- Call `page.pdf()`

Do not mix template lookup, schema validation, or business formatting rules into the browser layer.

Read `rules/implementation-chromium-pdf-rendering.md`.

### Phase 5 — Apply PDF Policy And Verify Output

Apply post-render PDF rules after Chromium returns bytes.

- Set metadata such as title, language, and keywords
- Run optional PDF validation
- Return warnings only for optional skipped checks
- Verify representative multi-page samples, not just one-page smoke cases

Read `rules/delivery-runtime-packaging-and-verification.md`.

## Non-Negotiables

1. **HTML is the only source of layout truth.** Do not treat office documents as the upstream layout format.
2. **Lambda is the only runtime.** Do not split the core render path across mixed compute patterns.
3. **Chromium is the only PDF engine.** Do not support multiple browser engines in one skill.
4. **Fonts and assets are deployment artifacts.** Do not depend on runtime discovery for critical rendering inputs.
5. **Validation happens before rendering.** Do not let templates consume untyped payloads.

## Output Contract

Return:

- PDF bytes or a stored artifact location
- resolved output file name
- warnings when optional checks were skipped
- enough metadata for downstream tracing and debugging

## Rules Summary

| Rule | File | Impact |
| --- | --- | --- |
| Lambda / Chromium / HTML boundary | `rules/architecture-lambda-chromium-boundary.md` | CRITICAL |
| Request contract and validation | `rules/implementation-request-contract.md` | CRITICAL |
| Deterministic HTML rendering | `rules/implementation-html-rendering.md` | CRITICAL |
| Chromium PDF rendering | `rules/implementation-chromium-pdf-rendering.md` | CRITICAL |
| Runtime packaging and verification | `rules/delivery-runtime-packaging-and-verification.md` | HIGH |

From soofi-xyz/soofi-xyz-team-kit, MIT.

More from soofi-xyz/soofi-xyz-team-kit

Signals

Stars
3
Forks
7
Open issues
0
Last commit (this folder)
Aug 23, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from soofi-xyz

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get build-html-to-pdf running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying build-html-to-pdf?

CallGet help
Cite this page

build-html-to-pdf skill. Agent Mart. https://agentmart.dev/skills/soofi-xyz-build-html-to-pdf (last updated 2026-10-24)