/ccxp-skills:translate-patent <path-to-docx> [--target-lang en] [--cn-only|--en-only] [--no-proofread] [--no-pdf]from ccxp-skills
Use when the user explicitly asks to translate a patent DOCX from Chinese to English (extract, translate, ASCII-diagram the images)
Ships in ccxp-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
<skills-root>= this skill's "Base directory" minus its last component; substitute the literal path (skill-conventions§9).
Translate a Chinese patent DOCX into attorney-ready CN+EN markdown (and PDF) with text-based diagrams on both sides.
$ARGUMENTS contains:
.docx file: /translate-patent confidential/legal/patent/zh/draft.docx--target-lang (default: en): /translate-patent draft.docx --target-lang en--cn-only — produce only the Chinese-side deliverables (CN MD, CN PDF, CN self-consistency proof-read); skip English translation and everything that depends on it (EN MD/PDF, Mode B proof-read). Mutually exclusive with --en-only.--en-only — skip only the CN-side final deliverables (standalone CN PDF, standalone CN proof-read report). CN extraction and CN-side ASCII-figure generation (steps 1-6) still run internally regardless — the English translation's ASCII figures are derived from the CN figures (step 7), so CN generation is a hard prerequisite, not an optional stage. Mutually exclusive with --cn-only.--no-proofread — skip step 9 (/proof-read) entirely.--no-pdf — skip step 10 (/md-to-pdf) entirely.Execute these steps in order. Stop and report if any step fails.
.docx extensionzh/ folder, create a sibling en/ folderen/ folder next to the DOCXen/ folder already has a translated .md file, ask the user before overwriting--cn-only: the en/ sibling-directory check above is skipped (no English output will be written). --en-only: the CN-side directory is still created and used internally — see the --en-only note under ## Argument.cd "<docx-parent-dir>"
pandoc "<filename>.docx" -t markdown --extract-media=media -o "<filename>.md"
.md file and a media/ folder with extracted imagesbrew install pandocFlatten nested media paths (e.g., media/media/image1.png → media/image1.png)
# If media/media/ exists, move files up one level
if [ -d media/media ]; then
mv media/media/* media/
rmdir media/media
fi
Update image references in the .md file to match flattened paths
Remove pandoc artifacts: {width="..." height="..."} attributes from image references
Remove Windows-style absolute paths from image alt text (e.g., C:/Users/...)
Figures are generated CN-first — this is the single source of truth for both languages (see step 7). For each image identified in step 4, replace its ![]() reference in the Chinese .md with a text-based diagram using box-drawing characters.
Box-drawing character set:
┌ ┐ └ ┘ ─ │► ◄ ▲ ▼ ─ │ ┬ ┴ ├ ┤▼ for downward, ► for rightwardRules:
#### heading immediately before the diagram: #### 图 N:<caption> — a real heading, not a bold paragraph. This is required for patent-pdf-extra.css's h4 caption rules (step 10) to have any effect.Example flowchart style:
┌───────────────────────────────┐
│ Step description │ 101
└───────────────┬───────────────┘
│
▼
┌───────────────────────────────┐
│ Next step description │ 102
└───────────────────────────────┘
Example system architecture style:
Input A Input B
│ │
▼ ▼
┌──────────┐ ┌──────────┐
│ Module 1 │──►│ Module 2 │
└──────────┘ └────┬─────┘
│
▼
┌──────────┐
│ Module 3 │
└──────────┘
This is a mandatory review pass. After generating all CN diagrams, go back and check each one:
.md file and visually inspect each diagram in the Read tool output. If any diagram looks broken, fix it.If any issues are found, edit the diagram and re-check. Do not skip this step. The English side (step 7) reuses these figures rather than re-deriving them, so a defect here propagates to both languages — get it right once, here.
Skip this step (and all remaining EN-side work) if --cn-only was passed.
.md file (post steps 5-6)#### Figure N: <english caption> heading (translated from the CN #### 图 N: heading, same heading level)..md to the en/ directory with an English filenameen/media/ as referenceRun <skills-root>/translate-patent/scripts/postprocess.py on the CN .md:
python3 <skills-root>/translate-patent/scripts/postprocess.py "<cn.md>" --lang zh --in-place
Unless --cn-only was passed, also run it on the EN .md:
python3 <skills-root>/translate-patent/scripts/postprocess.py "<en.md>" --lang en --in-place
This applies, per language, in one deterministic pass:
# part headings plus the five ## section headings)/md-to-pdf never severs a box mid-border)1. → 1\., so markdown doesn't renumber the claim set) and claim-continuation dedent (so an escaped, indented continuation line doesn't become an unwrapped code block)--lang is passed explicitly here (rather than relying on the script's auto-detect) since the caller already knows which file is which. The script itself supports omitting --lang and auto-detecting from CJK-vs-Latin character-class majority, for standalone use. The script is idempotent — re-running it on an already-processed file is a no-op — so it is safe to re-run this step alone (e.g. after a manual edit) without re-running the whole skill.
Skip this step entirely if --no-proofread was passed.
/proof-read Mode A on the post-processed CN MD alone (self-consistency), unless --en-only was passed — --en-only skips the standalone CN proof-read report per its definition under ## Argument.--cn-only was passed, invoke /proof-read Mode B on the CN + EN MDs together (cross-language consistency, including the figure-parity and figure-reference-number-diff checks)./proof-read's own contract (proof-read/SKILL.md § Out of scope).Skip this step entirely if --no-pdf was passed.
Invoke /md-to-pdf on the post-processed CN MD (unless --en-only was passed):
/md-to-pdf "<cn.md>" --extra-css translate-patent/patent-pdf-extra.css
And on the post-processed EN MD (unless --cn-only was passed):
/md-to-pdf "<en.md>" --extra-css translate-patent/patent-pdf-extra.css
Each PDF is produced next to its MD: <lang>/<basename>.pdf. /md-to-pdf runs its own font/weasyprint preflight (md-to-pdf/SKILL.md step 7) — do not reimplement that check here.
Report to the user:
<path to original DOCX><path><path> (omit if --cn-only)<count> original images, <count> ASCII diagrams generated (CN-side count; EN reuses the same figures)en/media/ (omit if --cn-only)<ok|skipped>, EN <ok|skipped|n/a — --cn-only>--no-proofread): report path(s), and error/warning/info counts per report--no-pdf or --en-only)--no-pdf or --cn-only)Note: The original images in en/media/ are kept as reference. The translated .md uses ASCII diagrams instead of image references, on both the CN and EN side.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
57 skills in this plugin
/1password-env-setupUse when the user explicitly asks to bootstrap or refresh a repo's 1Password-backed .env — installs the refresh-env helper, generates a hash-checking .envrc, and materializes .env from .env.tpl via op inject/address-prUse when the user explicitly asks to address, verify, or merge a specific open PR (CI, Claude Code review, test plan, tiered merge)/agent-pairingUse when the user explicitly asks to toggle the ccxp-agent main-session agent on/off for this Claude Code profile or check its statusnpx claudepluginhub synx-data-labs/ccxp-skills --plugin ccxp-skills