Huashu Markdown Publishing Pipeline
alchaincyf/huashu-md-html
Converts files and web pages into clean Markdown, then turns Markdown into polished HTML, Word, PDF and EPUB using four templates.
A skill your agent uses when translating PDF documents between languages while strictly preserving original layout, formatting, typography, tables, and signatures.
$ npx skills add lxsssssss/pdf-translate --skill pdf-translate -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install lxsssssss/pdf-translate pdf-translate --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
Claude Code skills documentation · loads skills from .claude/skills/
Install the "pdf-translate" agent skill from https://github.com/lxsssssss/pdf-translate/tree/main into .claude/skills/pdf-translate/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pdf-translate", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add lxsssssss/pdf-translate --skill pdf-translate -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install lxsssssss/pdf-translate pdf-translate --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "pdf-translate" agent skill from https://github.com/lxsssssss/pdf-translate/tree/main into .agents/skills/pdf-translate/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pdf-translate", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add lxsssssss/pdf-translate --skill pdf-translate -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install lxsssssss/pdf-translate pdf-translate --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "pdf-translate" agent skill from https://github.com/lxsssssss/pdf-translate/tree/main into .cursor/skills/pdf-translate/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pdf-translate", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add lxsssssss/pdf-translate --skill pdf-translate -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install lxsssssss/pdf-translate pdf-translate --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "pdf-translate" agent skill from https://github.com/lxsssssss/pdf-translate/tree/main into .gemini/skills/pdf-translate/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pdf-translate", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install lxsssssss/pdf-translate pdf-translateInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add lxsssssss/pdf-translate --skill pdf-translate -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "pdf-translate" agent skill from https://github.com/lxsssssss/pdf-translate/tree/main into .github/skills/pdf-translate/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pdf-translate", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add lxsssssss/pdf-translate --skill pdf-translate -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install lxsssssss/pdf-translate pdf-translate --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "pdf-translate" agent skill from https://github.com/lxsssssss/pdf-translate/tree/main into .opencode/skills/pdf-translate/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pdf-translate", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
pdf-translateA skill your agent uses when translating PDF documents between languages while strictly preserving original layout, formatting, typography, tables, and signatures.
PDF Translate is an agent skill from lxsssssss/pdf-translate. Use when translating PDF documents between languages while strictly preserving original layout, formatting, typography, tables, and signatures. Powered by LLM direct comprehension, two-stage data-contract translation, chunked modular generation, in-browser JS overflow detection, and high-fidelity vector PDF reconstruction. Features zero-hallucination guardrails and automated 1:1 page-by-page audit script (auditpdf.py).
Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 29 other files, including scripts and assets (for example `.github/ISSUE_TEMPLATE/bug_report.md`, `.github/ISSUE_TEMPLATE/feature_request.md` and `.github/workflows/ci.yml`).
It sits in Documents & Office, covering Translation, PDF and Data governance. It works with Playwright. The licence is MIT.
4 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 9669aac. It shows what the files ask for, not the result of running them.
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.
Ships 1 file in scripts/, which the agent can run.
Shell commands in SKILL.md call:
pythonFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
PDF Translate loads about 1.6k tokens when it runs. Until then it costs about 109 tokens; SKILL.md has 309 words of instructions outside code blocks.
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.
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); the scripts in this folder are not scanned.
The full file from lxsssssss/pdf-translate at commit 9669aac, republished under its MIT licence (© lxsssssss). 309 words, ~1,598 tokens.
.claude/skills/pdf-translate/SKILL.md (or your agent's skills folder). This skill also uses 24 other files; get the full folder from GitHub.当用户需要翻译 PDF 文档,且要求必须完整保留原始版面格式、公文表头、目录、双语表格、签章栏、插图物理尺寸并最终输出为高保真矢量 PDF 文件时,使用此 Skill。
[!IMPORTANT] 四大核心铁律(杜绝机翻乱码、长文档幻觉、跨页溢出与图片排版变形):
- 严禁脑补,严格忠实直译 (Strict Faithful Translation & Zero Hallucination):
- 不得压缩或遗漏条款:逐条忠实翻译每一个一级、二级、三级子条款(如法定资质证照清单 2.1.1~2.1.8、年限指标、年产能门槛 150,000 吨、分卷装订规则 Volume 2A/2B 等),坚决禁止主观总结或合并条款;
- 坚决禁止虚构常识:严禁凭常识脑补原文不存在的交付程序、装订份数、银行授信金额或办事流程(例如原文未写具体金额则绝对禁止编造 1,000,000 KWD,无 5.3 节则绝对不可添加 5.3 节);
- 表格格式 1:1 忠实还原:官方附表(如 Appendix-1 至 Appendix-6)的列名、行高、选项框、备注及签字盖章区必须严格对齐原件,严禁用自创的“申报核对清单 (Checklist)”或通用表格粗糙代替。
- 几何探针与视觉锚点测量铁律 (Geometry Probe & Visual Anchor Measurement):
- 绝对禁止经验主义猜度尺寸:严禁在未测量原件几何信息的情况下,随意给插图或表格加上
max-height: 220px等主观限制,导致原图严重缩水变形或比例失调;- 原图物理坐标与尺寸 1:1 提取:提取图片时必须调用
page.get_image_rects(xref)获取原图在页面上的实际width、height以及x0, y0,并在 HTML 中严格以真实物理尺寸呈现(如原件宽 218.9pt、高 322.4pt,HTML 中必须按照该物理尺寸渲染);- 几何线条与装饰框高保真复刻:通过
page.get_drawings()提取所有几何元素(如顶会论文标题框的 4pt 粗黑顶线与 1pt 细底线、长度 143.5pt 的左对齐短横脚注线),严禁用通用单薄的 100% 宽度边框粗暴替代;- 中文信息密度补偿与垂直基线对齐:中文字符信息密度通常比西文高 20%~35%,必须记录关键文字块的垂直基准起点
y0(如摘要标题、正文、章节起始与脚注线位置),通过微调行高(line-height: 1.35~1.45)、段落间距(margin)以及灵活运用网格与绝对定位,确保中文版面的视觉重心与垂直基线与原件严密锚定,杜绝页面下半部分突兀大面积留白;- 首页页眉页脚特殊规则:大部分顶会论文(NIPS/ICML/CVPR 等)或官方公文首页(Page 1)不编排页码,底部通常为会议发表信息或官方备案行,严禁在第一页机械添加页码。
- 两阶段解耦与分块生成 (Schema-First & Chunked Pipeline):
- 数据与排版分离:长文档翻译时,优先提取页面结构化数据(条款清单、参数字典、表格行列),再灌入标准化 HTML 模板,严禁一边长篇自由发挥一边写标签;
- 单批次生成严禁超过 10 页:超过 10 页的文档强制按 10 页为单位拆分为独立模块(如
part1_pages.py,part2_pages.py),避免模型在中后段注意力衰减导致失控。- 生成后对比质检与用户确认关卡 (Mandatory Audit & User Preview Before Commit):
- PDF 渲染生成后,绝不允许直接交付给用户,必须运行技能内置的
scripts/audit_pdf.py执行页码、矢量层、条款差集与敏感词全面扫描;- 渲染生成 1:1 并排对比图(PNG),必须在对话中直接展示关键页面对比效果供用户审阅确认,在获得用户明确许可前严禁擅自 Git Commit 或推送!
当收到翻译 PDF 任务时,Agent 需严格遵循以下 5 步标准化闭环作业流程:
使用 Python (fitz / PyMuPDF) 全面探测文档物理尺寸、插图尺寸、装饰线与关键文本块基线坐标:
import fitz
doc = fitz.open("path/to/document.pdf")
print("Total pages:", len(doc))
for i, page in enumerate(doc):
print(f"\n=== PAGE {i+1} rect: {page.rect} ===")
# 1. 探测图片物理尺寸与位置
for img in page.get_images():
for r in page.get_image_rects(img[0]):
print(f" Image xref {img[0]}: w={r.width:.1f}, h={r.height:.1f}, (x0={r.x0:.1f}, y0={r.y0:.1f})")
# 2. 探测几何线条与装饰边框
for d in page.get_drawings():
r = d['rect']
if r.width > 30:
print(f" Line: w={r.width:.1f}, h={r.height:.1f}, (x0={r.x0:.1f}, y0={r.y0:.1f})")
# 3. 探测核心文本块垂直基准起点 y0
for b in page.get_text("blocks"):
if b[4].strip():
print(f" Block ({b[0]:.1f}, {b[1]:.1f}, {b[2]:.1f}, {b[3]:.1f}): {b[4].strip()[:40]}")
# 若总页数 > 10 页,强制制定分块规划(如 Part 1: P1~10, Part 2: P11~20 ...)利用标准 HTML5 + CSS @page 打印样式进行 1:1 页面映射重构:
@page(如 US Letter size: 8.5in 11in; 或 A4 size: 210mm 297mm;):@page {
size: 8.5in 11in;
margin: 0;
}
.page {
width: 8.5in;
height: 11in;
max-height: 11in;
padding: 72pt 108pt 72pt 108pt;
page-break-after: always;
position: relative;
box-sizing: border-box;
display: flex;
flex-direction: column;
overflow: hidden; /* 严禁内部元素撑爆高度触发打印机额外分页 */
}
.content-area {
flex: 1;
overflow: hidden;
}w 和 h 设定图片的 width 与 height(如 width: 218.9pt; height: 322.4pt;),绝对禁止用经验值限制!调用技能内置渲染脚本直接生成纯矢量 PDF,内置 JavaScript 探针会自动检测是否有任何页面产生高度溢出:
python "e:\antigravity_workspace\univ\.agent\skills\pdf-translate\scripts\render_pdf.py" "path/to/full_doc.html" "path/to/output_full.pdf"生成 PDF 后,必须运行技能内置的 audit_pdf.py 自动化对比工具并生成对比图:
python "e:\antigravity_workspace\univ\.agent\skills\pdf-translate\scripts\audit_pdf.py" --src "path/to/source.pdf" --tgt "path/to/output_full.pdf"该工具全自动执行 4 大流水线:
用户视觉确认门禁 (User Confirmation Gate):
.agent/skills/pdf-translate/scripts/render_pdf.py.page 物理高度,避免跨页溢出。.agent/skills/pdf-translate/scripts/audit_pdf.py© lxsssssss, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 24 other files (scripts, assets) in the repository root of lxsssssss/pdf-translate.
Open the folder on GitHubat commit 9669aac
PDF Translate 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| PDF Translate this skilllxsssssss/pdf-translate | 102 | — | ~1.6k | Automated safety check: Pass | MIT | |
| Huashu Markdown Publishing Pipelinealchaincyf/huashu-md-html | 910 | — | ~4.8k | Automated safety check: Pass | MIT | |
| Translate Bookdeusyu/translate-book | 2.1k | — | ~5.5k | Automated safety check: Notes | MIT | |
| PDF Translatebreslee1707/VI-Translate | 676 | — | ~2k | Automated safety check: Pass | AGPL-3.0-only | |
| Cuimao TranslatorCuimao777/cuimao-translator | 487 | — | ~3.2k | Automated safety check: Pass | None | |
| Paper PDF TranslatorYuan1z0825/nature-skills | 47k | — | ~1k | Automated safety check: Pass | Apache-2.0 |
alchaincyf/huashu-md-html
Converts files and web pages into clean Markdown, then turns Markdown into polished HTML, Word, PDF and EPUB using four templates.
deusyu/translate-book
Translate books (PDF/DOCX/EPUB) into any language using parallel sub-agents.
breslee1707/VI-Translate
Translate local PDFs, including safe prose on image-only scans, into Vietnamese or another supported Latin-script language while preserving layout, formulas, tables, and figures.
Cuimao777/cuimao-translator
Translate English PDF books into natural Chinese with three quality modes.
Yuan1z0825/nature-skills
Translates an English paper PDF, all pages or a chosen range, into a Simplified Chinese image-based PDF that keeps the original layout, figures and formulas.
SaberOnGo/public-domain-books-translation
A skill your agent uses when designing, translating, reviewing, or fixing LifeBook book/page layout, including print-compatible EPUB typography, Chinese title hierarchy, body rhythm, paragraph…
Works with
Categories
A skill your agent uses when translating PDF documents between languages while strictly preserving original layout, formatting, typography, tables, and signatures. PDF Translate is an agent skill from lxsssssss/pdf-translate. Use when translating PDF documents between languages while strictly preserving original layout, formatting, typography, tables, and signatures.
PDF Translate fits situations like: translating PDF documents between languages while strictly preserving original layout; tasks that involve Translation; tasks that involve PDF.
Run `npx skills add lxsssssss/pdf-translate --skill pdf-translate -a claude-code`. Or copy the skill folder (the lxsssssss/pdf-translate repository) into .claude/skills/pdf-translate in your project. Claude Code loads it when a task matches its description.
Run `npx skills add lxsssssss/pdf-translate --skill pdf-translate -a codex`. Or copy the skill folder (the lxsssssss/pdf-translate repository) into .agents/skills/pdf-translate in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add lxsssssss/pdf-translate --skill pdf-translate -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pdf-translate, .gemini/skills/pdf-translate, .github/skills/pdf-translate and .opencode/skills/pdf-translate in your project.
Going by SKILL.md and its folder, PDF Translate needs the command-line tools its instructions call (python). Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
PDF Translate is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.6k tokens (SKILL.md is roughly 6.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with PDF Translate: Huashu Markdown Publishing Pipeline (alchaincyf/huashu-md-html, 910 stars), Translate Book (deusyu/translate-book, 2.1k stars), PDF Translate (breslee1707/VI-Translate, 676 stars) and Cuimao Translator (Cuimao777/cuimao-translator, 487 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
lxsssssss (a GitHub user) maintains it in lxsssssss/pdf-translate, which has 102 GitHub stars. The repository was last updated on October 8, 2026.
Source: lxsssssss/pdf-translate on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.