npx skills add ...
npx skills add thvroyal/kimi-skills --skill kimi-pdf
Professional PDF solution. Create PDFs using HTML+Paged.js (academic papers, reports, documents). Process existing PDFs using Python (read, extract, merge, split, fill forms). Supports KaTeX math formulas, Mermaid diagrams, three-line tables, citations, and other academic elements. Also use this skill when user explicitly requests LaTeX (.tex) or native LaTeX compilation.
npx skills add thvroyal/kimi-skills --skill kimi-pdf
| Route | Trigger | Route File |
|---|---|---|
| HTML (default) | All PDF creation requests | routes/html.md |
| LaTeX | User explicitly requests LaTeX, .tex, or Tectonic | routes/latex.md |
| Process | Work with existing PDFs (extract, merge, fill forms, etc.) | routes/process.md |
Default to HTML. Only use LaTeX route when user explicitly requests it.
Before implementation, you MUST:
routes/html.md, routes/latex.md, or routes/process.md)This file (SKILL.md) contains constraints and principles. Route files contain how-to details.
| User Says | Route |
|---|---|
| "Create a PDF", "Make a report", "Write a paper" | HTML |
| "Use LaTeX", "Compile .tex", "Use Tectonic" | LaTeX |
| "Extract text from PDF", "Merge these PDFs", "Fill this form" | Process |
| Context | Style |
|---|---|
| Academic paper, thesis, formal coursework | Minimal (white, centered, no decoration) |
| Reports, proposals, professional documents | Designed (choose from style reference in html.md) |
| Uncertain | Default to Designed — plain text cover = mediocre |
Key principle: Cover background separates "acceptable" from "impressive". See html.md for 11 style options.
| Document Language | Format |
|---|---|
| Chinese | GB/T 7714 (use [J][M][D] identifiers) |
| English | APA |
| Mixed | Chinese refs → GB/T 7714, English refs → APA |
Use the unified CLI for all operations:
Exit codes:
0 = success1 = usage error2 = dependency missing (run pdf.sh fix)3 = runtime errorDependencies by route:
Output language must match user's query language.
DO NOT fabricate information. When in doubt, SEARCH.
If content involves ANY of these, you MUST search FIRST before writing:
| Scenario | Search? | Notes |
|---|---|---|
| Statistics, data | Required | e.g., "2024 employment rate" |
| Policies, regulations | Required | e.g., "startup subsidies" |
| Research, papers | Required | e.g., "effectiveness of method X" |
| Time-sensitive content | Required | Information after knowledge cutoff |
| Uncertain facts | Required | If unsure, always search |
| Common knowledge | Not needed | e.g., "water boils at 100°C" |
Search workflow:
Fabricating references is prohibited. All citations must have:
Note: id must be placed at container top (see CSS Counters section in html.md).
Must strictly follow user-specified word or page count requirements:
| User Request | Execution Standard |
|---|---|
| Specific word count (e.g., "3000 words") | Within ±20%, i.e., 2400-3600 words |
| Specific page count (e.g., "5 pages") | Exactly equal, last page may be partial |
| Word count range (e.g., "2000-3000 words") | Must fall within range |
| No explicit requirement | Infer reasonably by document type; prefer thorough over superficial |
| Minimum specified (e.g., "more than 5000 words") | No more than 2x, i.e., 5000-10000 words |
Prohibited behaviors:
Special case - Resume/CV:
margin: 1.5cmWhen user provides outline:
When no user outline:
| Route | Tools | Purpose |
|---|---|---|
| HTML | Playwright + Paged.js | HTML → PDF conversion |
| HTML | KaTeX, Mermaid | Math formulas, diagrams |
| Process | pikepdf | Form filling, page operations, metadata |
| Process | pdfplumber | Text and table extraction |
| Process | LibreOffice | Office → PDF conversion |
| LaTeX | Tectonic | LaTeX → PDF compilation |
As shown in <a href="#fig-1-1">Figure 1-1</a>...
From <a href="#eq-2-1">Equation (2-1)</a>...
See <a href="#sec3">Section 3</a>...