omk-agent
Distill a top-level principle into knowledge/rules.md. Trigger when user says 'add rule', 'new principle', 'enforce this',…
Generate professional PDF documents with correct CJK (Chinese/Japanese/Korean) rendering. Trigger when user says 'generate PDF', 'create PDF', 'export PDF', '生成 PDF', '导出 PDF', '做个 PDF', 'make a PDF', or when any task requires producing a PDF file. Also trigger when user
$ npx -y skills add kaimingwan/oh-my-kiro --skill omk-pdf-gen --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/omk-pdf-genContext preview
The summary Claude sees to decide when to auto-load this skill.
Generate professional PDF documents with correct CJK (Chinese/Japanese/Korean) rendering. Trigger when user says 'generate PDF', 'create PDF', 'export PDF', '生成 PDF', '导出 PDF', '做个 PDF', 'make a PDF', or when any task requires producing a PDF file. Also trigger when user
name: omk-pdf-gen description: > Generate professional PDF documents with correct CJK (Chinese/Japanese/Korean) rendering. Trigger when user says 'generate PDF', 'create PDF', 'export PDF', '生成 PDF', '导出 PDF', '做个 PDF', 'make a PDF', or when any task requires producing a PDF file. Also trigger when user mentions PDF formatting issues, garbled text, or font problems.
Use **HTML + CSS → weasyprint** pipeline. Do NOT use reportlab for documents containing CJK text.
Why:
HTML = """\
<!DOCTYPE html>
<html lang="zh">
<head><meta charset="utf-8">
<style>
@page { size: A4; margin: 2cm 2.2cm; }
body { font-family: "Hiragino Sans GB", "Heiti SC", "Noto Sans CJK SC", sans-serif; ... }
</style></head>
<body>...</body></html>
"""import subprocess, os
html_tmp = output_path.replace('.pdf', '.html')
with open(html_tmp, 'w', encoding='utf-8') as f:
f.write(HTML)
subprocess.run(['weasyprint', html_tmp, output_path], check=True)
os.remove(html_tmp)| Platform | CSS font-family | Notes | |----------|----------------|-------| | macOS | `"Hiragino Sans GB", "Heiti SC"` | Verified via `fc-list :lang=zh` | | Linux | `"Noto Sans CJK SC", "WenQuanYi Micro Hei"` | Install `fonts-noto-cjk` if missing | | Fallback | `sans-serif` | Always include as last resort |
**Never use these in weasyprint CSS:**
**Before generating**, verify CJK fonts are available:
fc-list :lang=zh family | head -10
Use standard HTML elements — weasyprint handles them well:
@page { size: A4; margin: 2cm 2.2cm; }
body { font-family: "Hiragino Sans GB", "Heiti SC", "Noto Sans CJK SC", sans-serif;
font-size: 11pt; color: #1a1a2e; line-height: 1.7; }
h1 { font-size: 22pt; text-align: center; }
h3 { font-size: 13pt; color: #1a73e8; }
table { width: 100%; border-collapse: collapse; font-size: 10pt; }
th { background: #1a73e8; color: #fff; padding: 7pt 10pt; text-align: left; }
td { padding: 6pt 10pt; border-bottom: 1px solid #e5e7eb; }
tr:nth-child(even) td { background: #f8f9fa; }English-only documents where you need precise programmatic layout (charts, diagrams, pixel-perfect positioning). Use `platypus` (SimpleDocTemplate + Paragraph + Table), never raw `canvas` API.
Reference: `tools/gen-73strings-pdfs.py` — good example of reportlab platypus for English PDFs.
| Don't | Why | Do Instead | |-------|-----|-----------| | reportlab + STSong-Light for CJK | `•` → "煉", incomplete glyphs | weasyprint + system fonts | | reportlab `canvas` manual positioning | Fragile coordinates, misaligned text | weasyprint or reportlab `platypus` | | CSS `font-family: -apple-system` | weasyprint can't resolve it | Use `"Hiragino Sans GB"` | | CSS `font-family: "PingFang SC"` | fontconfig often fails to find it | Use `"Hiragino Sans GB"` | | Helvetica-Bold for table headers with CJK | CJK chars render as ■■■ | Use CJK font + `font-weight: bold` | | Hardcode font without checking | Fails on different OS | Run `fc-list :lang=zh` first |
Place generated script in `tools/gen-<name>-pdf.py`. The script should: 1. Define HTML as a string constant 2. Write temp HTML → call weasyprint → remove temp HTML 3. Print the output path on success
Your AI agent forgets everything. Mine doesn't. oh-my-kiro is a framework that gives your AI coding agent persistent memory, deterministic workflows, and self-evolving intelligence. Like oh-my-zsh for Zsh — but for AI agents. Day 1: generic agent.
Distill a top-level principle into knowledge/rules.md. Trigger when user says 'add rule', 'new principle', 'enforce this',…
Enforces coding best practices: deep-read before modify, LSP-first navigation, TDD red-green-refactor, minimal changes,…
Fetch current library/framework documentation via Context7. Trigger when user asks about libraries, frameworks, API references,…
Systematic debugging: reproduce → hypothesize → verify → fix. Trigger when encountering bugs, test failures, errors, crashes,…
Branch completion workflow: verify tests → present 4 options (merge/PR/keep/discard) → execute → cleanup worktree. Trigger when…
Capture knowledge into episodes.md. Trigger when user says 'remember', 'capture this', 'lesson learned', 'note this', '@know', or…