kagen

kagen is a skill for Claude Code, Codex from EliasOulkadi/shokunin. It costs 0 tokens per session (6,618 once invoked), scanned A, original, MIT.

A tool that turns HTML templates into PDF files using Chromium, the browser engine behind Chrome, through Playwright.

In plain words
What is it for?
Use it to export valid HTML documents with print styles, charts, or dynamic content as production-ready PDFs from the command line or Node.js.
Why use it?
It can render JavaScript-driven content and avoids setup problems that some other HTML-to-PDF tools have, especially on Windows.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions OpenCode.

Good fit Use it to export valid HTML documents with print styles, charts, or dynamic content as production-ready PDFs from the command line or Node.js.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/eliasoulkadi/shokunin/kagen
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 EliasOulkadi/shokunin --skill kagen
Clone the repo
git clone --depth 1 https://github.com/EliasOulkadi/shokunin

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 kagen

README.md
[![agentmods](https://agentmods.dev/badge/skills/eliasoulkadi/shokunin/kagen/github.svg)](https://agentmods.dev/skills/eliasoulkadi/shokunin/kagen)
Your own site
<a href="https://agentmods.dev/skills/eliasoulkadi/shokunin/kagen"><img src="https://agentmods.dev/badge/skills/eliasoulkadi/shokunin/kagen/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 kagen

Your own site · 80×15
<a href="https://agentmods.dev/skills/eliasoulkadi/shokunin/kagen"><img src="https://agentmods.dev/badge/skills/eliasoulkadi/shokunin/kagen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,618 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 warn 7 Sept 2026
SkillSpector: 5 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 51
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 52
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 58
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 380
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 449
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
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.00000 $0.06618
Opus 5 $0.00000 $0.03309
Sonnet 5 $0.00000 $0.01324
Haiku 4.5 $0.00000 $0.00662

Measured 11d ago against content hash 7f4b0ebbbb45, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

kagen 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 11d 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.

.pack/skills/kagen/SKILL.md · 475 lines

How it starts

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

kagen · 紙源

紙源 · かげん - paper source. PDF generation companion to Kami.

Kami designs, Kagen ships. Converts Kami HTML templates to production-grade PDF using Chromium (Playwright), bypassing WeasyPrint's Windows limitations.

Why Kagen

Problem Solution
WeasyPrint doesn't work on Windows (no GTK) Kagen uses Playwright/Chromium — works everywhere
WeasyPrint cold-start ~630ms per render Playwright warm ~13ms per render
WeasyPrint can't execute JS Chromium renders fully (charts, dynamic content)
wkhtmltopdf is deprecated and unmaintained Playwright is actively maintained by Microsoft

Based on benchmarks (pdf4.dev 2026), engineering discussions (HN, Stack Overflow, BrowserStack), and production experience from DocRaptor, customjs.space, and print-css.rocks.

Prerequisites

  • Node.js 20+
  • Playwright (npx playwright auto-installs on first use)
  • Chromium browser installed (npx playwright install chromium)
  • Kami HTML templates (any valid HTML with print CSS)

Quick start

npx playwright pdf "file:///path/to/doc.html" "output.pdf"

Or from Node.js:

const { chromium } = require('playwright');
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('file:///path/to/doc.html', { waitUntil: 'networkidle' });
await page.pdf({
  path: 'output.pdf',
  format: 'A4',
  printBackground: true,
  margin: { top: '0', bottom: '0', left: '0', right: '0' }
});
await browser.close();

Production settings (from professional research)

Page options

await page.pdf({
  path: 'output.pdf',
  format: 'A4',              // or 'Letter', 'A3'
  printBackground: true,     // always true — renders parchment bg
  margin: { top: '0', bottom: '0', left: '0', right: '0' },
  // For screen media (not print):
  // await page.emulateMedia({ media: 'screen' });
});

Critical CSS rules for reliable PDF output

/* Always include in your HTML template header */

@page {
  size: A4;
  margin: 24mm 26mm 26mm 26mm;
  background: #f5f4ed;
  widows: 4;
  orphans: 4;
}

/* Force background colors in Chromium */
* {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Avoid orphan text lines — high widows/orphans prevents single-line splits */
body { widows: 4; orphans: 4; }
p    { widows: 3; orphans: 3; }
li   { widows: 2; orphans: 2; }

/* Page break control — only on chapters with heavy content */
.chapter { }
.chapter.break { break-before: page; }

/* Never let a heading sit alone at page bottom */
h1, h2, h3, h4 { break-after: avoid; }

/* Keep these blocks intact — never split across pages */
table, pre, figure, .callout, .card,
blockquote, .finding-header, .takeaway {
  break-inside: avoid;
}

/* Avoid code blocks getting orphaned from their preceding paragraph */
pre {
  margin-top: 6pt;
  page-break-before: avoid;
}

/* Tables should not break rows across pages */
table tr {
  break-inside: avoid;
}

Read the full file on GitHub · 475 lines

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. 11d ago First seen · 475 lines · 0 tokens per session scan A 7f4b0ebbbb45

Subscribe to this mod's changes

kagen is a skill published in the GitHub repository EliasOulkadi/shokunin (113 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 6,618 tokens. 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

Other skills, from other repositories

wowerpoint

Turn one document into a kawaii NotebookLM slide-deck PDF. Use for "wowerpoint this", "make a deck about ", "turn this report into slides", or any request to render a single document as shareable narrative slides.

thedotmack/claude-mem · 55 tokens

paper-summarizer

Agents should invoke this skill for academic or technical papers, arXiv/PubMed/IEEE/ACM links, PDFs, methodology review, limitations, practical implications, or extracting findings for engineering decisions.

waybarrios/opencode-power-pack · 46 tokens

deck-ai

Generate modern presentation decks (PDF) from markdown content. Local open-source alternative to Gamma — uses Slidev for layouts and Unsplash for imagery. Invoke when the user asks to "make a deck", "build slides from this", or "turn this into a presentation".

assafkip/kipi-system · 57 tokens

call-prep

Call preparation: research, CRM, talking points, PDF.

aAAaqwq/AGI-Super-Team · 0 tokens

forgetful-files

File binary content into the knowledge base — screenshots, PDFs, diagrams, fonts, assets. Use when a binary artifact is worth keeping alongside knowledge, or when a stored procedure needs a bundled asset. The description is the entire search surface: say what the file shows and when to reach for it.

ScottRBK/forgetful · 63 tokens

pdf-processing

Inspect, extract, OCR, create, merge, split, reorder, rotate, annotate, fill, redact, compress, secure, and verify PDF documents while preserving source files and visual fidelity. Use when working with one or more .pdf files; converting documents to or from PDF; extracting text, tables, images, metadata, forms, or…

seb1n/awesome-ai-agent-skills · 105 tokens