Agent skill

Kagen

by EliasOulkadi in EliasOulkadi/shokunin

Convert Kami HTML templates to production-grade PDF via Chromium/Playwright.

MITAuto-check passedDocuments & Office

Install Kagen

skills CLI
$ npx skills add EliasOulkadi/shokunin --skill kagen -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install EliasOulkadi/shokunin kagen --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/EliasOulkadi/shokunin.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.pack/skills/kagen .claude/skills/kagen && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
kagen
GitHub stars
114
Token cost
~6.4k tokens
SKILL.md length
2,224 words
Files
1
Skills in repo
49
Repo updated
First seen
Licence
MIT

At a glance

Convert Kami HTML templates to production-grade PDF via Chromium/Playwright.

  • Works in 6 steps: Validate HTML template → Configure render settings → Render PDF → …
  • User asks to generate PDF files
  • SKILL.md covers Why Kagen, Prerequisites, Quick start and Production settings (from…, plus 7 more sections
  • Calls npx and black

What it does

Kagen is an agent skill from EliasOulkadi/shokunin. Convert Kami HTML templates to production-grade PDF via Chromium/Playwright. Complements Kami (design) with PDF rendering. Use when user asks to generate PDF files, render HTML to PDF, or export documents.

Its SKILL.md is about 6.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: opencode

It sits in Documents & Office, covering PDF and Browser testing. It works with Playwright. The repository describes itself as: 職人 Shokunin 62 AI agent skills for OpenCode, Claude Code, Cursor, Windsurf. ChromaDB memory, MCP servers, declarative self-updates. Multi-model, open source, zero cost. The licence is MIT.

When your agent uses it

  • User asks to generate PDF files
  • Render HTML to PDF
  • Export documents

Example prompts

  • “/kagen”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): opencode

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Validate HTML template
  2. Configure render settings
  3. Render PDF
  4. Validate output PDF
  5. Apply visual patterns by document type
  6. Run self-review protocol

What it can do on your machine

Read from SKILL.md and the folder at commit 4c68e5b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx
    • black

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • playwright.dev
    • pdf4.dev
    • browserstack.com
    • print-css.rocks
    • docupotion.com
    • w3.org
    • blog.rasc.ch
    • news.ycombinator.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    opencode

    From compatibility in the SKILL.md frontmatter.

Context cost

Kagen loads about 6.4k tokens when it runs. Until then it costs about 53 tokens; SKILL.md has 2,224 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~53
When it runs · the whole SKILL.md, loaded when a task matches
~6.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from EliasOulkadi/shokunin at commit 4c68e5b, republished under its MIT licence (© EliasOulkadi). 2,224 words, ~6,368 tokens.

Download SKILL.mdSave it as .claude/skills/kagen/SKILL.md (or your agent's skills folder).
name
kagen
description
Convert Kami HTML templates to production-grade PDF via Chromium/Playwright. Complements Kami (design) with PDF rendering. Use when user asks to generate PDF files, render HTML to PDF, or export documents.
compatibility
opencode
triggers
- "render PDF" - "convert HTML to PDF" - "PDF from template" - "Kami render" - "Kagen" - "HTML to PDF" - "Playwright PDF" - "PDF generation" - "Chromium PDF"
negatives
- "design PDF" - "create template" - "HTML design" - "CSS styling" - "branding" - "document design" - "PDF design template" -> use kami
license
MIT
metadata
version: "1.0.0" workflow: documents audience: developers

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

ProblemSolution
WeasyPrint doesn't work on Windows (no GTK)Kagen uses Playwright/Chromium — works everywhere
WeasyPrint cold-start ~630ms per renderPlaywright warm ~13ms per render
WeasyPrint can't execute JSChromium renders fully (charts, dynamic content)
wkhtmltopdf is deprecated and unmaintainedPlaywright 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

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

Or from Node.js:

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
js
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
css
/* 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;
}
Visual patterns by document type

Each document type needs its own set of visual patterns. Apply accordingly:

TypeRequired patternsOptional patterns
Pentest / Security reportSeverity badges (red/orange/green), risk bar, code blocks with left border, impact/remediation boxesFinding-header with metadata, findings table with badges
One-pager / Executive summaryGlance grid (4 metrics), lead paragraph, takeaway box, cover with large title + decorative lineCallout for key data point, footer with contact
White paper / Long docChapter breaks in dense sections, table of contents, callouts, keep-together on critical blocksQuotes, diagrams, appendix
LetterWide margins (25mm), formal greeting and closing, no columns, no tablesLetterhead, signature
ResumeDense body (9.2pt), metric row, project bullets with action + resultTimeline, skills grid
SlidesAssertion-evidence titles, one idea per slide, one-line bullets, pinned calloutCode cards, 2x2 table

Rule: if the document type isn't in the table, choose the closest one and adapt.

Near-empty pages prevention

Nothing looks more amateur than a page with 2 lines. Causes and solutions:

CauseSolutionAuto-detection
Heading with 1 short paragraph at the endMerge with previous sectionIf a chapter has only 1 h2 + 1 p, it doesn't deserve its own page
break-before: page on every sectionOnly use on chapters with >1/3 page of contentCount paragraphs + tables + lists. If they add up to less than 5 elements, don't force a break
break-inside: avoid on large block that doesn't fitRelax break-inside or split the blockIf a keep-together measures more than 1 page, don't force it
Source list at the end spilling onto a separate pageMove to consolidated sources chapterSources go in one place, not repeated in each chapter
AI anti-patterns in documents

Validate that content inherited from Kami doesn't have these marks:

Anti-patternProblemFix
Repeated em dash — as label/value separatorBlack Box — no credentials, multiple lines in a rowParentheses, comma, colon. The dash is for genuine asides, not for separating labels
Uniform tables without colorAll rows identical, no visual indication of severity or priorityColor badges, subtle zebra rows, highlighted first column
Code blocks without contrastThey blend with the body, don't look like codeLeft blue border, ivory background, monospace, generous padding
Same structure on every pageEvery page is title + table or title + listVary: finding box, risk bar, flowchart, callout. Alternate rhythm
Claims without source"LLMs hallucinate 15-20%" without attribution"According to Vectara HHEM 2026, LLMs..."
Best practices from professionals
PracticeSourceWhy
Always set printBackground: trueBrowserStack, Playwright docsKami uses parchment bg #f5f4ed — Chromium strips it by default
Use file:// protocolStack Overflow, DocuPotionAvoids auth/CORS issues with local files
Set waitUntil: 'networkidle'BrowserStackEnsures fonts, CSS fully loaded
Lock browser version in CIBrowserStack, blog.rasc.chChromium updates can change rendering
Use @page margins, not Playwright marginsprint-css.rocks, CSS Paged Media specCSS margins are more predictable for paged media
-webkit-print-color-adjust: exactMDN, Chromium docsCritical for parchment backgrounds and brand colors
Reuse browser instance (warm)pdf4.dev benchmark42ms → 3ms speedup (14x)
Validate PDF visually in CIBrowserStackPage count, whitespace, font check

Warm mode (production pipeline)

js
const { chromium } = require('playwright');

class PDFRenderer {
  constructor() {
    this.browser = null;
  }

  async start() {
    this.browser = await chromium.launch();
  }

  async render(htmlPath, outputPath) {
    const page = await this.browser.newPage();
    await page.goto('file:///' + htmlPath.replace(/\\/g, '/'), {
      waitUntil: 'networkidle'
    });
    await page.pdf({
      path: outputPath,
      format: 'A4',
      printBackground: true,
      margin: { top: '0', bottom: '0', left: '0', right: '0' }
    });
    await page.close();
  }

  async stop() {
    await this.browser.close();
  }
}

Font embedding

Chromium embeds system fonts by default. For custom fonts (like TsangerJinKai02 in Kami):

css
@font-face {
  font-family: "CustomFont";
  src: url("fonts/CustomFont.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
}

Place font files relative to the HTML and use relative src paths. Chromium resolves them from the HTML file's directory.

Troubleshooting

ProblemFix
White background instead of parchmentAdd printColorAdjust: exact in CSS and printBackground: true in JS
Fonts not renderingUse relative paths in @font-face, check font file exists
Page breaks wrongCheck break-inside: avoid on tables, pre, callout
Near-empty page (2 lines alone)Merge short section with previous; avoid break-before: page on light chapters
Content overflowUse page-break-inside: avoid on large blocks
Chinese chars as boxesInclude CJK font in @font-face or use system CJK fallback
PDF too largeRemove unnecessary images, compress embedded fonts
Slow first renderKeep browser instance alive (warm mode)
CSS visual pattern snippets

Concrete patterns to include in the HTML by document type:

css
/* Severity badges (pentest, security) */
.badge-high { background: #f5e8e8; color: #a83030; display: inline-block; padding: 2pt 7pt; border-radius: 3pt; font-size: 8pt; font-weight: 500; text-transform: uppercase; }
.badge-medium { background: #f5ede2; color: #b86a25; display: inline-block; padding: 2pt 7pt; border-radius: 3pt; font-size: 8pt; font-weight: 500; text-transform: uppercase; }
.badge-ok { background: #e8f2ec; color: #2a7a4a; display: inline-block; padding: 2pt 7pt; border-radius: 3pt; font-size: 8pt; font-weight: 500; text-transform: uppercase; }

/* Risk bar (pentest exec summary) */
.risk-bar { display: flex; gap: 2pt; margin: 8pt 0 14pt 0; height: 12pt; }
.risk-bar .seg { border-radius: 2pt; display: flex; align-items: center; justify-content: center; font-size: 7pt; color: #fff; font-weight: 500; }

/* Code blocks with left border (pentest, technical) */
pre { border-left: 2.5pt solid #1B365D; border-radius: 3pt; background: #faf9f5; padding: 10pt 14pt; font-family: Consolas, monospace; font-size: 9pt; line-height: 1.5; break-inside: avoid; }

/* Impact/Remediation boxes (pentest) */
.impact-box, .remediation-box { border-left: 2pt solid #e8e6dc; padding-left: 12pt; margin: 10pt 0 14pt 0; break-inside: avoid; }
.impact-box .label, .remediation-box .label { font-size: 8.5pt; letter-spacing: 0.8pt; text-transform: uppercase; font-weight: 500; color: #1B365D; margin-bottom: 4pt; }

/* Cover accent line */
.cover-line { width: 60pt; height: 2pt; background: #1B365D; margin: 20pt 0; border-radius: 1pt; }

/* Pipeline flow (4 step horizontal) */
.pipeline-flow { display: flex; gap: 0; margin: 18pt 0; break-inside: avoid; }
.pipeline-step { flex: 1; text-align: center; padding: 10pt 8pt; }
.pipeline-step .dot { width: 6pt; height: 6pt; border-radius: 50%; background: #1B365D; margin: 0 auto 5pt auto; }
.pipeline-step + .pipeline-step { border-left: 0.5pt dotted #e8e6dc; }
.pipeline-step .name { font-size: 9pt; font-weight: 500; color: #141413; margin-bottom: 3pt; }
.pipeline-step .desc { font-size: 7.5pt; color: #6b6a64; line-height: 1.35; }

/* Keep-together wrapper */
.keep-together { break-inside: avoid; }
Self-review protocol (mandatory)

Don't generate the PDF without passing this checklist. Each item is a real failure documented in previous iterations.

Structural (blocking)
  • Each chapter has enough content to fill >1/3 of a page
  • No sections with just heading + 1 short paragraph (merge)
  • No near-empty pages (2 lines alone)
  • break-before: page only on chapters with dense content
Visual (high priority)
  • Visual elements match the document type (badges, risk bars, code blocks, etc.)
  • Tables have proper styling (optional zebra, padding, clear headers)
  • Code blocks are distinguishable from body (border, background, monospace)
  • No repeated em dashes — used as label/value separators
  • There's variety in visual rhythm (not all pages the same)
Content (high priority)
  • Every categorical claim has its visible source ("according to X...")
  • Internal methodology is distinguished from verified fact (disclaimer if applicable)
  • No redundant content between chapters (sources, repeated lists)
  • Every paragraph is necessary (if it can be removed without loss, remove it)
Technical (blocking)
  • printBackground: true in Playwright configuration
  • -webkit-print-color-adjust: exact in CSS
  • widows: 4; orphans: 4 in @page and body
  • break-inside: avoid on pre, table, blockquote, callout
  • table tr { break-inside: avoid } so tables don't split rows

Complete HTML example

Minimum functional template that includes all essential patterns. Copy and adapt:

html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document Title</title>
<style>
  @page { size: A4; margin: 24mm 26mm 26mm 26mm; background: #f5f4ed; widows: 4; orphans: 4; }
  * { box-sizing: border-box; margin: 0; padding: 0; -webkit-print-color-adjust: exact; }
  :root {
    --parchment: #f5f4ed; --ivory: #faf9f5; --near-black: #141413;
    --dark-warm: #3d3d3a; --olive: #504e49; --stone: #6b6a64;
    --brand: #1B365D; --border: #e8e6dc; --border-soft: #e5e3d8;
    --serif: Charter, Georgia, Palatino, "Times New Roman", serif;
    --mono: Consolas, "Courier New", monospace;
  }
  body { font-family: var(--serif); font-size: 10.5pt; line-height: 1.65; color: var(--near-black); background: var(--parchment); widows: 4; orphans: 4; }
  h1 { font-size: 24pt; border-left: 2.5pt solid var(--brand); padding-left: 8pt; margin: 0 0 10pt 0; break-after: avoid; }
  h2 { font-size: 16pt; margin: 24pt 0 8pt 0; break-after: avoid; }
  p { margin: 0 0 10pt 0; widows: 3; orphans: 3; }
  table { width: 100%; border-collapse: collapse; font-size: 9.5pt; margin: 12pt 0; break-inside: avoid; }
  table th { text-align: left; padding: 6pt 8pt; border-bottom: 1pt solid var(--border); background: var(--ivory); }
  table td { padding: 5pt 8pt; border-bottom: 0.3pt solid var(--border-soft); }
  table tr { break-inside: avoid; }
  pre { border-left: 2.5pt solid var(--brand); border-radius: 3pt; background: var(--ivory); padding: 10pt 14pt; font-size: 9pt; font-family: var(--mono); break-inside: avoid; margin: 6pt 0 10pt 0; }
  .callout { background: var(--ivory); border-left: 2pt solid var(--brand); padding: 10pt 14pt; border-radius: 3pt; margin: 12pt 0; break-inside: avoid; }
  .keep-together { break-inside: avoid; }
  .break { break-before: page; }
  /* Add visual patterns by document type (badges, risk bar, etc.) */
</style>
</head>
<body>
<!-- Cover -->
<section style="min-height:240mm;display:flex;flex-direction:column;justify-content:space-between;padding:40mm 0 0 0;break-after:page;">
  <div>
    <div style="font-size:10pt;color:var(--brand);letter-spacing:2pt;text-transform:uppercase;margin-bottom:18pt;">Document Type</div>
    <div style="font-size:40pt;font-weight:500;line-height:1.12;margin-bottom:16pt;">Main Title</div>
    <div style="width:60pt;height:2pt;background:var(--brand);margin:20pt 0;border-radius:1pt;"></div>
    <div style="font-size:14pt;color:var(--olive);max-width:85%;">Subtitle or description</div>
  </div>
  <div style="font-size:10pt;color:var(--stone);">Author · Date</div>
</section>
<!-- Chapter -->
<section class="break">
  <h1>Chapter Title</h1>
  <p>Document content. Verify sources (research), humanize text (humanize), design with Kami.</p>
  <!-- Tables, lists, callouts as needed -->
</section>
</body>
</html>

Integration with Kami

powershell
# One-liner from Kami HTML to PDF
npx playwright pdf "file:///path/to/kami-output.html" "final.pdf"

Sources

Workflow

Step 1: Validate HTML template

Before rendering, verify the template is production-ready:

  1. Open the HTML in a browser first: confirm fonts load, CSS applies, layout renders correctly at print size
  2. Check that @page rules specify explicit size (A4, Letter) and margins
  3. Verify -webkit-print-color-adjust: exact and print-color-adjust: exact are set on *
  4. Confirm all @font-face declarations use relative paths, not absolute filesystem paths
Step 2: Configure render settings
  1. Set format (A4, Letter, A3) to match the template's @page { size: } declaration
  2. Set printBackground: true — always. Never skip this. Chromium strips backgrounds by default
  3. Set Playwright margin: { top: '0', bottom: '0', left: '0', right: '0' } — use CSS @page margins instead
  4. Use waitUntil: 'networkidle' to ensure fonts, CSS, and images are fully loaded before rendering
Step 3: Render PDF
  1. Launch browser once (warm mode) — reuse for all documents in batch
  2. Navigate with file:// protocol to avoid CORS and authentication issues with local files
  3. Await page.pdf() with configured options
  4. Close page after each render but keep browser alive for next document
Step 4: Validate output PDF
  1. Open PDF and check: parchment/tinted background rendered (not white), fonts embedded correctly, page breaks occur at logical points
  2. Scan every page for near-empty pages (2 lines or less floating at page top)
  3. Verify code blocks, callouts, and tables are not split across page boundaries
  4. Check CJK characters render correctly if document contains Chinese, Japanese, or Korean text
Step 5: Apply visual patterns by document type
  1. Pentest/security report: severity badges, risk bars, finding headers, styled code blocks, impact/remediation boxes
  2. One-pager/executive summary: glance grid (4 metrics), lead paragraph, takeaway box, cover with decorative accent line
  3. White paper/long document: chapter breaks on dense sections, callouts, keep-together wrappers on critical blocks
  4. Letter: wide margins (25mm), formal greeting/closing, single-column, no unnecessary breaks
  5. Resume: dense body (9.2pt), metric row, project bullets with action + result format
Show full SKILL.md (856 more words)Show less
Step 6: Run self-review protocol

Complete ALL four checklist categories before final output: Structural (blocking), Visual (high priority), Content (high priority), Technical (blocking). Every item in the self-review protocol is a real failure mode documented from previous iterations.

Error Handling

CauseFix
PDF renders with stark white background instead of parchment (#f5f4ed)Chromium strips all backgrounds in print mode. Ensure BOTH printBackground: true in Playwright JS config AND -webkit-print-color-adjust: exact on * in CSS
Custom fonts render as fallback system serif in the PDF outputUse relative paths in @font-face src: url("fonts/CustomFont.woff2"). Place font files in same directory as HTML or a subdirectory. Chromium resolves relative to the HTML file's location
CJK characters (Chinese, Japanese, Korean) render as empty boxes or tofuInclude a CJK-capable font via @font-face or add system CJK fallback stack: font-family: "TsangerJinKai02", "SimSun", "MS Mincho", serif. Test before batch rendering
Near-empty page at end of section (2 lines of text floating alone)Merge the short section with the previous one. Only apply break-before: page to chapters with > 1/3 page of content. Count elements: if heading + paragraph count < 5 total, don't force a page break
Table rows split awkwardly across consecutive pagesAdd table tr { break-inside: avoid; } in CSS. For large spanning tables, add table { break-inside: avoid; } so the entire table moves as a block
Page break leaves an isolated heading at the very bottom of a pageAdd h1, h2, h3, h4 { break-after: avoid; } to ensure at least the first content element after a heading stays with it on the same page
PDF file size is excessive (10MB+ for a text-heavy document)Remove unnecessary raster images. Subset and compress embedded fonts to only used glyphs. Reduce DPI of any embedded raster content. Check for duplicated embedded resources
page.pdf() call hangs indefinitely on networkidle with dynamic/JS-rendered contentSwitch to waitUntil: 'load' or add explicit page.waitForTimeout(3000). For charts and JS-rendered content, use waitForSelector() on a known rendered element
Chromium version mismatch between local dev and CI causes visual output differencesLock Chromium version explicitly: note the version npx playwright install chromium installs. Document it in CI config. Re-baseline visual checks on every Chromium version bump
Multiple documents rendered in bulk — browser crashes after N documents due to memoryImplement page pooling: close and reopen pages every 10-20 documents. Or restart browser every 50 documents. Memory leak in Chromium PDF rendering is a known issue

Anti-Patterns

PatternProblemFix
Setting margins via Playwright margin parameter instead of CSS @pagePlaywright margin rendering is inconsistent across Chromium versions. CSS @page margins produce predictable, standards-compliant outputAlways use @page { margin: 24mm 26mm 26mm 26mm; } in CSS. Set Playwright margin: { top: '0', bottom: '0', left: '0', right: '0' }
break-before: page applied to every section/chapter unconditionallyCreates near-empty pages when a section has little content. Reader sees a page with 2 lines. Looks unprofessional and amateurOnly force page breaks on chapters with > 1/3 page of content. Count paragraph + table + list elements. If < 5 total content elements, skip the forced break
All pages share identical visual structure (title → table → title → table)Monotonous reading experience. Reader disengages after page 3. Document fails to sustain attention through key findingsVary rhythm: finding box, then risk bar, then callout, then table, then narrative paragraph. Alternate between data-dense and commentary pages
Repeated em dashes used as label/value separator in tables and lists"Black Box — no credentials" repeated 15 times in a pentest report. Jarring, lazy, reads like raw data dumpUse colon separator (Black Box: no credentials), parentheses, or proper table columns with distinct header and value styling
Code blocks visually indistinguishable from surrounding body textReader skims past code assuming it's prose. Reduces document credibility. Technical content loses all impactStyle every code block: 2.5pt left border, ivory/tinted background, monospace font (Consolas/Courier), generous padding (10-14pt), slight border-radius
printBackground: false anywhere in the production rendering pipelineChrome strips all background colors, including parchment. Document renders on stark white default. Destroys the Kami visual designAlways printBackground: true. Add CI assertion: if PDF renders with white background, fail the build
Launching a new browser instance per PDF documentCold start ~630ms vs warm ~13ms. 48x slower per document. Wastes CI minutes on multi-document projectsUse warm mode (PDFRenderer class pattern): launch browser once, render all documents, close browser once. Keep-alive between renders
Font files referenced with absolute Windows paths (C:\Users\swagger\fonts\...)PDF generated on a different machine or in CI won't find fonts. Paths break across environments. Not portableAlways use relative paths in @font-face: src: url("fonts/CustomFont.woff2"). Place font files in same directory or subdirectory as the HTML template
Skipping the self-review protocol because "it looks fine in the browser"Browser rendering != PDF output. Chrome applies different print stylesheet rules. Many issues only visible in the final PDFAlways open the actual PDF output and run through all 4 checklist categories. Visual inspection is mandatory, not optional

Checklist

  • Skill loads without errors in the AI agent
  • YAML frontmatter is valid (description, compatibility, audience)
  • Workflow section provides clear step-by-step instructions
  • Error handling section covers common failure modes
  • All referenced files (references/, scripts/, assets/) exist
  • Skill triggers correctly for intended use cases
  • No broken links or missing resources

© EliasOulkadi, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .pack/skills/kagen of EliasOulkadi/shokunin.

Open the folder on GitHubat commit 4c68e5b

Compare with similar skills

Kagen next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Kagen compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Kagen this skillEliasOulkadi/shokunin114—~6.4kAutomated safety check: PassMIT
Sn Ppt DoctorOpenSenseNova/SenseNova-Skills5.7k—~884Automated safety check: NotesMIT
Browser Automationynulihao/AgentSkillOS618—~2.2kAutomated safety check: PassNone
Cloudflare Browser Renderingeinverne/dotfiles121—~4.9kAutomated safety check: PassGPL-3.0
Playwright CLImizchi/skills360—~625Automated safety check: PassNone
Publish Zsxq Articlesugarforever/01coder-agent-skills137—~3.2kAutomated safety check: PassMIT

Similar skills

  • Sn Ppt Doctor

    OpenSenseNova/SenseNova-Skills

    A skill your agent uses when diagnosing PPT Skill setup or failures involving source parsing, Playwright or Chromium rendering, HTML-to-PPTX export, Workbench startup, or bundled search and…

    5.7k GitHub stars~884 tokensUpdated 2 days ago
    Documents & OfficeAuto-check: notes
  • Browser Automation

    ynulihao/AgentSkillOS

    Non-testing browser automation - web scraping, form filling, screenshot capture, PDF generation, workflow automation.

    618 GitHub stars~2.2k tokensUpdated 7 mo ago
    Productivity & AutomationAuto-check passed
  • Guide for implementing Cloudflare Browser Rendering - a headless browser automation API for screenshots, PDFs, web scraping, and testing.

    121 GitHub stars~4.9k tokensUpdated 1 mo ago
    Productivity & AutomationAuto-check passed
  • Playwright CLI

    mizchi/skills

    A skill your agent uses when running Playwright via terminal CLI — npx playwright test (test runner), codegen (interactive recording), screenshot / pdf (one-off captures), and CI sharding.

    360 GitHub stars~625 tokensUpdated 9 days ago
    Testing & QAAuto-check passed
  • Publish Zsxq Article

    sugarforever/01coder-agent-skills

    Publish Markdown articles to Zsxq (知识星球) as drafts. An agent skill from sugarforever/01coder-agent-skills.

    137 GitHub stars~3.2k tokensUpdated 3 mo ago
    Documents & OfficeAuto-check passed
  • Playwright CLI

    sanity-io/sanity

    Official

    Automates browser interactions for web testing, form filling, screenshots, and data extraction.

    6.4k GitHub starsUsed in 18 repos~1.9k tokens
    Testing & QAAuto-check passed

More from EliasOulkadi/shokunin

All 49 skills in this repo
  • CI CD

    EliasOulkadi/shokunin

    Design CI/CD pipelines for GitHub Actions, GitLab CI, and CircleCI with matrix builds, test sharding, caching, Docker layer caching, OIDC auth, deployment strategies (rolling, blue-green, canary)…

    114 GitHub stars~3.4k tokensUpdated 6 days ago
    Auto-check: notes
  • Component Forge

    EliasOulkadi/shokunin

    Build production-grade components for React, Vue 3, and Svelte 5 with all states (loading, empty, error, success, idle), TypeScript strict, WCAG 2.2 accessibility, server components (RSC), and…

    114 GitHub stars~3.6k tokensUpdated 6 days ago
    Auto-check: notes
  • DB Admin

    EliasOulkadi/shokunin

    PostgreSQL database administration — backup/restore (pgdump, PITR, WAL archiving), health monitoring (connections, bloat, cache hit ratio, dead tuples), connection pooling (PgBouncer), replication…

    114 GitHub stars~2k tokensUpdated 6 days ago
    Auto-check: notes
  • DB Sculptor

    EliasOulkadi/shokunin

    Design database schemas with Prisma/Drizzle, PostgreSQL index strategy (B-tree, GIN, GiST, BRIN, Hash), query optimization (EXPLAIN ANALYZE), migration safety (expand/contract, zero-downtime), and…

    114 GitHub stars~3.1k tokensUpdated 6 days ago
    Auto-check: notes
  • Docker

    EliasOulkadi/shokunin

    Optimize Docker images with multi-stage builds, distroless bases, BuildKit cache mounts, multi-arch builds, compose watch, security hardening (non-root, seccomp, capabilities drop), and…

    114 GitHub stars~3.8k tokensUpdated 6 days ago
    Auto-check: notes
  • Error Handler

    EliasOulkadi/shokunin

    Design error handling, structured logging, and observability with OpenTelemetry (traces, metrics, logs), error classification, recovery patterns (retry with jitter, circuit breaker, bulkhead…

    114 GitHub stars~3.6k tokensUpdated 6 days ago
    Auto-check: notes

Works with

Questions about Kagen

What does Kagen do?

Convert Kami HTML templates to production-grade PDF via Chromium/Playwright. Kagen is an agent skill from EliasOulkadi/shokunin. Convert Kami HTML templates to production-grade PDF via Chromium/Playwright.

When should I use Kagen?

Kagen fits situations like: user asks to generate PDF files; render HTML to PDF; export documents.

How do I install Kagen in Claude Code?

Run `npx skills add EliasOulkadi/shokunin --skill kagen -a claude-code`. Or copy the skill folder (.pack/skills/kagen in EliasOulkadi/shokunin) into .claude/skills/kagen in your project. Claude Code loads it when a task matches its description.

How do I install Kagen in Codex?

Run `npx skills add EliasOulkadi/shokunin --skill kagen -a codex`. Or copy the skill folder (.pack/skills/kagen in EliasOulkadi/shokunin) into .agents/skills/kagen in your project. Codex loads it when a task matches its description.

Can I use Kagen in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add EliasOulkadi/shokunin --skill kagen -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/kagen, .gemini/skills/kagen, .github/skills/kagen and .opencode/skills/kagen in your project.

What does Kagen need to run?

Going by SKILL.md and its folder, Kagen needs the command-line tools its instructions call (npx and black). Our summary lists: Node.js. Compatibility (from SKILL.md): opencode.

Does Kagen access the network?

SKILL.md names 8 domains. As links in the text: playwright.dev, pdf4.dev, browserstack.com, print-css.rocks, docupotion.com, w3.org, blog.rasc.ch and news.ycombinator.com. This is read from the text; nothing was executed.

Is Kagen safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Kagen use?

Kagen is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Kagen use?

About 6.4k tokens (SKILL.md is roughly 25k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Kagen?

Skills that share tags, products or a category with Kagen: Sn Ppt Doctor (OpenSenseNova/SenseNova-Skills, 5.7k stars), Browser Automation (ynulihao/AgentSkillOS, 618 stars), Cloudflare Browser Rendering (einverne/dotfiles, 121 stars) and Playwright CLI (mizchi/skills, 360 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Kagen?

EliasOulkadi (a GitHub user) maintains it in EliasOulkadi/shokunin, which has 114 GitHub stars. The repository holds 49 skills in this directory. The repository was last updated on October 5, 2026.

Source: EliasOulkadi/shokunin on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.