kimi-pdf by thvroyal/kimi-skills
npx skills add https://github.com/thvroyal/kimi-skills --skill kimi-pdf| 路由 | 触发条件 | 路由文件 |
|---|---|---|
| HTML (默认) | 所有 PDF 创建请求 | routes/html.md |
| LaTeX | 用户明确请求 LaTeX、.tex 或 Tectonic | routes/latex.md |
| Process | 处理现有 PDF(提取、合并、填写表单等) | routes/process.md |
默认使用 HTML。 仅当用户明确请求时才使用 LaTeX 路由。
实施前,您必须:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
routes/html.md、routes/latex.md 或 routes/process.md)此文件 (SKILL.md) 包含约束和原则。路由文件包含操作细节。
| 用户表述 | 路由 |
|---|---|
| "创建 PDF"、"制作报告"、"撰写论文" | HTML |
| "使用 LaTeX"、"编译 .tex"、"使用 Tectonic" | LaTeX |
| "从 PDF 提取文本"、"合并这些 PDF"、"填写此表单" | Process |
| 上下文 | 样式 |
|---|---|
| 学术论文、学位论文、正式课程作业 | 极简(白色、居中、无装饰) |
| 报告、提案、专业文档 | 设计版(从 html.md 中的样式参考中选择) |
| 不确定 | 默认使用设计版 — 纯文本封面 = 平庸 |
关键原则:封面背景区分了"可接受"和"令人印象深刻"。参见 html.md 中的 11 种样式选项。
| 文档语言 | 格式 |
|---|---|
| 中文 | GB/T 7714(使用 [J][M][D] 标识符) |
| 英文 | APA |
| 混合 | 中文参考文献 → GB/T 7714,英文参考文献 → APA |
对所有操作使用统一的 CLI:
# 检查环境(JSON 输出,退出码 0=正常,2=缺少依赖)
/app/.kimi/skills/kimi-pdf/scripts/pdf.sh check
# 自动修复缺失的依赖(幂等,可安全多次运行)
/app/.kimi/skills/kimi-pdf/scripts/pdf.sh fix
# 将 HTML 转换为 PDF
/app/.kimi/skills/kimi-pdf/scripts/pdf.sh html input.html
# 编译 LaTeX 为 PDF
/app/.kimi/skills/kimi-pdf/scripts/pdf.sh latex input.tex
退出码:
0 = 成功1 = 用法错误2 = 依赖缺失(运行 pdf.sh fix)3 = 运行时错误各路由的依赖:
输出语言必须与用户的查询语言匹配。
请勿捏造信息。如有疑问,先搜索。
如果内容涉及以下任何一项,您必须在写作前先搜索:
| 场景 | 需要搜索? | 备注 |
|---|---|---|
| 统计数据、数据 | 必需 | 例如:"2024 年就业率" |
| 政策、法规 | 必需 | 例如:"创业补贴" |
| 研究、论文 | 必需 | 例如:"方法 X 的有效性" |
| 时效性内容 | 必需 | 知识截止日期后的信息 |
| 不确定的事实 | 必需 | 如果不确定,总是搜索 |
| 常识 | 不需要 | 例如:"水在 100°C 沸腾" |
搜索工作流程:
禁止捏造参考文献。所有引用必须包含:
如 <a href="#fig-1-1">图 1-1</a> 所示...
根据 <a href="#eq-2-1">公式 (2-1)</a>...
参见 <a href="#sec3">第 3 节</a>...
注意:id 必须放在容器顶部(参见 html.md 中的 CSS 计数器部分)。
必须严格遵守用户指定的字数或页数要求:
| 用户请求 | 执行标准 |
|---|---|
| 特定字数(例如:"3000 字") | 在 ±20% 范围内,即 2400-3600 字 |
| 特定页数(例如:"5 页") | 完全相等,最后一页可以是部分页 |
| 字数范围(例如:"2000-3000 字") | 必须落在范围内 |
| 无明确要求 | 根据文档类型合理推断;宁详勿略 |
| 指定最小值(例如:"超过 5000 字") | 不超过 2 倍,即 5000-10000 字 |
禁止行为:
特殊情况 - 简历/CV:
margin: 1.5cm当用户提供大纲时:
当用户未提供大纲时:
| 路由 | 工具 | 用途 |
|---|---|---|
| HTML | Playwright + Paged.js | HTML → PDF 转换 |
| HTML | KaTeX, Mermaid | 数学公式、图表 |
| Process | pikepdf | 表单填写、页面操作、元数据 |
| Process | pdfplumber | 文本和表格提取 |
| Process | LibreOffice | Office → PDF 转换 |
| LaTeX | Tectonic | LaTeX → PDF 编译 |
每周安装量
79
代码库
GitHub 星标数
93
首次出现
2026 年 2 月 4 日
安全审计
安装于
gemini-cli74
codex74
amp73
github-copilot73
kimi-cli73
opencode73
| 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:
# Check environment (JSON output, exit code 0=ok, 2=missing deps)
/app/.kimi/skills/kimi-pdf/scripts/pdf.sh check
# Auto-fix missing dependencies (idempotent, safe to run multiple times)
/app/.kimi/skills/kimi-pdf/scripts/pdf.sh fix
# Convert HTML to PDF
/app/.kimi/skills/kimi-pdf/scripts/pdf.sh html input.html
# Compile LaTeX to PDF
/app/.kimi/skills/kimi-pdf/scripts/pdf.sh latex input.tex
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:
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>...
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 |
Weekly Installs
79
Repository
GitHub Stars
93
First Seen
Feb 4, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykWarn
Installed on
gemini-cli74
codex74
amp73
github-copilot73
kimi-cli73
opencode73
GitHub Actions 官方文档查询助手 - 精准解答 CI/CD 工作流问题
45,200 周安装