Agent skill

DOCX

by guyi-a in guyi-a/pi-ling

Word 文档(.docx)的日常处理:md → docx(生成简历/报告)、docx → PDF/图片(分享预览)、.doc → .docx(老格式升级)。触发场景:用户说"生成 Word 版" / "做份 Word 简历" / "把这份报告转 Word" / "这份 .doc 打不开" / "docx 转 PDF" 等。读 docx 内容走 agent 已有的…

MITAuto-check passedDocuments & Office

Install DOCX

skills CLI
$ npx skills add guyi-a/pi-ling --skill docx -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install guyi-a/pi-ling docx --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/guyi-a/pi-ling.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/docx .claude/skills/docx && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
docx
GitHub stars
106
Token cost
~1.1k tokens
SKILL.md length
347 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Word 文档(.docx)的日常处理:md → docx(生成简历/报告)、docx → PDF/图片(分享预览)、.doc → .docx(老格式升级)。触发场景:用户说"生成 Word 版" / "做份 Word 简历" / "把这份报告转 Word" / "这份 .doc 打不开" / "docx 转 PDF" 等。读 docx 内容走 agent 已有的…

  • Works in 2 steps: 让用户提供一份现有的 .docx 作为样式模板(比如公司的简历模板),或者从零造一份 → pandoc a.md -o a.docx…
  • Tasks that involve Word documents
  • SKILL.md covers 定位, 路径 A:md → docx(99% 场景), 路径 B:docx → PDF(分享/归档) and 路径 C:docx → 图片(预览用), plus 6 more sections
  • Calls pandoc, soffice and pdftoppm

What it does

DOCX is an agent skill from guyi-a/pi-ling. Word 文档(.docx)的日常处理:md → docx(生成简历/报告)、docx → PDF/图片(分享预览)、.doc → .docx(老格式升级)。触发场景:用户说"生成 Word 版" / "做份 Word 简历" / "把这份报告转 Word" / "这份 .doc 打不开" / "docx 转 PDF" 等。读 docx 内容走 agent 已有的 extractdocumenttext 工具,不走本 skill。编辑现有 docx / 修订跟踪 / 批注这些重工作流本 skill 不支持。

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Documents & Office, covering Word documents. It works with Microsoft Word, LibreOffice, Pandoc and LaTeX. The licence is MIT.

When your agent uses it

  • Tasks that involve Word documents

Example prompts

  • “生成 Word 版”
  • “做份 Word 简历”
  • “把这份报告转 Word”
  • “/docx”

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. 让用户提供一份现有的 .docx 作为样式模板(比如公司的简历模板),或者从零造一份
  2. pandoc a.md -o a.docx --reference-doc=/path/to/template.docx

What it can do on your machine

Read from SKILL.md and the folder at commit 17a71f6. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    Shell commands in SKILL.md call:

    • pandoc
    • soffice
    • pdftoppm
    • brew

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

DOCX loads about 1.1k tokens when it runs. Until then it costs about 66 tokens; SKILL.md has 347 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~66
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

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.

Safety

Auto-check passed

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from guyi-a/pi-ling at commit 17a71f6, republished under its MIT licence (© guyi-a). 347 words, ~1,106 tokens.

Download SKILL.mdSave it as .claude/skills/docx/SKILL.md (or your agent's skills folder).
name
docx
description
Word 文档(.docx)的日常处理:md → docx(生成简历/报告)、docx → PDF/图片(分享预览)、.doc → .docx(老格式升级)。触发场景:用户说"生成 Word 版" / "做份 Word 简历" / "把这份报告转 Word" / "这份 .doc 打不开" / "docx 转 PDF" 等。读 docx 内容走 agent 已有的 extract_document_text 工具,不走本 skill。编辑现有 docx / 修订跟踪 / 批注这些重工作流本 skill 不支持。

Skill: docx(Word 文档轻量工具箱)

定位

面试助手场景里 Word 用得不多,本 skill 只做生成 + 格式转换这两件高频事,不做重型的编辑/修订/批注(那是法务级工作流,跟本产品定位不匹配)。

能力清单:

任务路径依赖
md → docx(生成简历/报告)pandoc a.md -o a.docxpandoc
md → docx(精调样式)pandoc a.md -o a.docx --reference-doc=模板.docxpandoc
docx → PDF(分享/归档)soffice --headless --convert-to pdf a.docxLibreOffice
docx → PDF(兜底:没装 LibreOffice)pandoc a.docx -o a.pdf --pdf-engine=xelatex ...pandoc + xelatex
docx → 图片(预览)docx → PDF 再 pdftoppm -jpeg -r 150 a.pdf pageLibreOffice + poppler
.doc → .docx(老格式升级)soffice --headless --convert-to docx a.docLibreOffice
读 docx 内容用 agent 已有的 extract_document_text 工具不走本 skill
编辑现有 docx / 修订跟踪 / 批注不支持告诉用户在 Word 里手动改

路径 A:md → docx(99% 场景)

默认命令:

pandoc INPUT.md -o OUTPUT.docx

pandoc 默认样式对中文简历/报告已经够用(宋体、A4、标准页边距)。生成后必跑自检 SOP。

精调样式(可选)

用户想要特定字体/间距/边距,走 --reference-doc:

  1. 让用户提供一份现有的 .docx 作为样式模板(比如公司的简历模板),或者从零造一份
  2. pandoc a.md -o a.docx --reference-doc=/path/to/template.docx

pandoc 会继承模板里的样式定义(字体、字号、Heading 样式、页边距),把 md 内容按对应样式渲染进去。用户拿到的 Word 打开就是模板的样式。

造模板的兜底做法(用户没有现成模板时):

# 先让 pandoc 吐一份默认模板出来
pandoc -o template.docx --print-default-data-file reference.docx
# 或者
pandoc -o template.docx /dev/null  # 生成一个空的默认样式 docx

然后告诉用户:用 Word 打开 template.docx,改字体/字号/边距,保存回来,再传给 pandoc --reference-doc 参数。不要 agent 自己去改模板 docx 的 XML —— 那是重工作流,本 skill 不做。

中文场景注意事项
  • pandoc 默认对 CJK 字体支持已经 OK,中文段落不用特意配
  • 如果生成后中文乱码或者变方框:让用户装了 pandoc 但没装 basictex/xelatex 引擎的可能性很大,或者 reference-doc 模板本身字体缺失
  • Word 里中文字体名:宋体、微软雅黑、苹方 SC(macOS)—— 造模板时用这些

路径 B:docx → PDF(分享/归档)

首选(推荐):

soffice --headless --convert-to pdf INPUT.docx --outdir OUT_DIR

macOS 上 soffice 二进制通常在 /Applications/LibreOffice.app/Contents/MacOS/soffice。如果 which soffice 找不到,就用绝对路径调。

首次运行注意:LibreOffice headless 首次会创建 user profile,可能慢 3-5 秒,第二次就快。

兜底路径(用户没装 LibreOffice):

pandoc INPUT.docx -o OUTPUT.pdf \
    --pdf-engine=xelatex \
    -V CJKmainfont='PingFang SC' \
    -V geometry:margin=2cm

pandoc 走 xelatex 时 docx → PDF 支持基础样式,复杂图片/表格可能丢格式。soffice 保真度更高。


路径 C:docx → 图片(预览用)

两步走:

soffice --headless --convert-to pdf INPUT.docx --outdir /tmp
pdftoppm -jpeg -r 150 /tmp/INPUT.pdf /tmp/page
ls /tmp/page-*.jpg
  • -r 150 DPI 够读,太大文件飙升
  • pdftoppm 会 zero-pad 页码到总页数宽度(12 页文档产出 page-01.jpg..page-12.jpg),用 ls 拿真实文件名再读,别硬拼

路径 D:.doc → .docx(老格式升级)

用户上传 .doc(Word 97-2003 老格式)时,extract_document_text 读不了、pandoc 也不认。先升级:

soffice --headless --convert-to docx INPUT.doc --outdir OUT_DIR

升完再走 extract_document_text 或后续处理。


依赖

必需:pandoc(pdf skill 已经要求装过)

推荐:LibreOffice

  • macOS: brew install --cask libreoffice
  • 用户没装时,路径 B 走 pandoc + xelatex 兜底;路径 C、D 直接告诉用户"这个转换需要装 LibreOffice"

推荐:Poppler(pdftoppm)

  • macOS: brew install poppler(pdf skill 已要求过)
  • 只用于路径 C

Never(红线)

  • Never 自己拆 docx 的 ZIP + 手改 XML —— 本 skill 明确不做编辑现有文档
  • Never 用 python-docx 或 docx-js 从零画 docx —— 简历/报告 pandoc + md 够用了,多一层抽象没意义
  • Never 告诉用户"docx 生成好了"而不跑自检
  • Never 假设 soffice 装了就直接调 —— 先 which soffice 或 command -v soffice,没装走 pandoc 兜底或告诉用户装

自检 SOP

生成完必跑:

ls -lh <output.docx> && file <output.docx>
  • ls -lh 看文件存在 + 大小合理(<1KB 是空文件)
  • file 应看到 Microsoft Word 2007+ 或 Zip archive data(.docx 本质是 ZIP)

想更保险,跑一次转 PDF 打开看:

soffice --headless --convert-to pdf <output.docx> --outdir /tmp && open /tmp/<output>.pdf

打得开就交付。


交付时给用户看的内容

  • 产物绝对路径
  • 大小 + 页数(用 soffice 转 PDF 后 pdfinfo 拿)
  • 用到的路径(pandoc / soffice)
  • 如果走了兜底(比如 LibreOffice 没装),明确告诉用户:产物是用什么方式转的,格式保真度可能差点儿

超出本 skill 范围的请求

用户如果要:

  • 编辑现有 docx("把这份简历里的 X 改成 Y")
  • 修订跟踪 / 批注("给这份简历加红字批注告诉我该改哪里")
  • 精细样式操控("表格边框改成蓝色虚线"、"页眉加公司 logo")

告诉用户:本 skill 不覆盖这些场景,建议做法:

  1. 用 extract_document_text 读出简历内容
  2. 让 agent 生成一份修改后的 md(含批注文字 / 修改标记)
  3. pandoc → docx 或直接给用户 md
  4. 具体的 Word 内批注 / 修订跟踪,让用户在 Word 里手动加

这条边界要跟用户说清楚,别硬撑着上重工作流。

© guyi-a, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/docx of guyi-a/pi-ling.

Open the folder on GitHubat commit 17a71f6

Compare with similar skills

DOCX 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.

DOCX compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
DOCX this skillguyi-a/pi-ling106—~1.1kAutomated safety check: PassMIT
DOCX ToolkitXiaomiMiMo/MiMo-Code14k—~2.4kAutomated safety check: PassApache-2.0
Pandic OfficeTeam-Commonly/commonly1.4k—~642Automated safety check: PassApache-2.0
Article Format Adjustmentaipoch/medical-research-skills2k—~2.4kAutomated safety check: PassMIT
Converting Filesoaustegard/claude-skills150—~1.6kAutomated safety check: PassMIT
Office ToolsTai609/NebulaMat100—~1kAutomated safety check: PassCustom licence

Similar skills

  • DOCX Toolkit

    XiaomiMiMo/MiMo-Code

    Produces, edits and reads Microsoft Word files through python-docx and lxml, with a decision table for picking the lightest workflow for a given task.

    14k GitHub stars~2.4k tokensUpdated 4 days ago
    Documents & OfficeAuto-check passed
  • Pandic Office

    Team-Commonly/commonly

    Convert Markdown to PDF (or DOCX/EPUB/HTML) using the pandoc CLI.

    1.4k GitHub stars~642 tokensUpdated today
    Documents & OfficeAuto-check passed
  • Article Format Adjustment

    aipoch/medical-research-skills

    Adjust academic paper formatting and convert between DOCX/LaTeX/Markdown when you need to meet a journal or school template requirement.

    2k GitHub stars~2.4k tokensUpdated 20 days ago
    Documents & OfficeAuto-check passed
  • Converting Files

    oaustegard/claude-skills

    Convert a file from one format to another inside the container — documents, images, audio, video.

    150 GitHub stars~1.6k tokensUpdated 6 days ago
    Documents & OfficeAuto-check passed
  • Office Tools

    Tai609/NebulaMat

    A skill your agent uses when 需要处理 WPS/Office/PDF 文件——"Excel 数据处理"、"转成 Excel"、"提取 PDF 里的图"、"markdown 转 xlsx/docx/pptx"。触发词含 xlsx/docx/pptx/Excel/表格/配图。

    100 GitHub stars~1k tokensUpdated 1 mo ago
    Documents & OfficeAuto-check passed
  • DOCX Creation and Editing

    anthropics/skills

    Official

    Creates, edits and reviews Word documents: new files with docx-js, edits through the underlying XML, plus tracked changes, comments and conversions.

    180k GitHub starsUsed in 6 repos~1.7k tokens
    Documents & OfficeAuto-check passed

More from guyi-a/pi-ling

  • PDF

    guyi-a/pi-ling

    PDF 相关的所有操作:从零生成(reportlab / pypdf)、格式转化(md/html → PDF)、修改(合并 / 拆分 / 旋转 / 加水印 / 提图片 / 元数据)、读内容(pdfplumber / extractdocumenttext)、OCR 扫描件、加密解密。触发场景:用户说"生成 PDF" / "做份 PDF 简历" / "合并这几份 PDF" / "给 PDF…

    106 GitHub stars~3.3k tokensUpdated 21 days ago
    Auto-check passed
  • PPTX

    guyi-a/pi-ling

    PowerPoint 幻灯片(.pptx / .potx)的所有操作:从零生成(pptxgenjs Node 库)、基于模板编辑(unpack XML → 改 → clean → pack)、格式转化(pptx → PDF / 图片、.ppt → .pptx)、读取分析。触发场景:用户说"做份 PPT" / "生成幻灯片" / "演讲 slide" / "培训材料" / "项目汇报" /…

    106 GitHub stars~2.3k tokensUpdated 21 days ago
    Auto-check passed
  • Bosszp

    guyi-a/pi-ling

    Boss 直聘岗位搜索的完整操作手册。触发场景:用户说"找工作"/"看岗位"/"搜招聘"/"投简历"/"跳槽"/"Boss 直聘"/"看看有什么工作"/"帮我看下 XX 岗位"等。前提:必须走 browserbridge(Boss 需要用户 Chrome 登录态;browseruse 独立环境登不上)。包含 URL 模板、城市编码表、Vue data 抽取…

    106 GitHub stars~2.4k tokensUpdated 21 days ago
    Auto-check passed
  • Inline Visualization

    guyi-a/pi-ling

    当回答涉及流程、架构、机制、因果、对比、时间线、状态机、层级关系,或用户明确要求画图 / 图解 / 示意图时使用。把内容画成对话内直接渲染的图(自包含 HTML/SVG),而不是用文字罗列。不承接数值图表(折线/柱状/饼图,当前无图表库)、海报、头像、写实插画、地图。

    106 GitHub stars~555 tokensUpdated 21 days ago
    Auto-check passed

Questions about DOCX

What does DOCX do?

Word 文档(.docx)的日常处理:md → docx(生成简历/报告)、docx → PDF/图片(分享预览)、.doc → .docx(老格式升级)。触发场景:用户说"生成 Word 版" / "做份 Word 简历" / "把这份报告转 Word" / "这份 .doc 打不开" / "docx 转 PDF" 等。读 docx 内容走 agent 已有的…. DOCX is an agent skill from guyi-a/pi-ling.

When should I use DOCX?

DOCX fits situations like: tasks that involve Word documents.

How do I install DOCX in Claude Code?

Run `npx skills add guyi-a/pi-ling --skill docx -a claude-code`. Or copy the skill folder (.agents/skills/docx in guyi-a/pi-ling) into .claude/skills/docx in your project. Claude Code loads it when a task matches its description.

How do I install DOCX in Codex?

Run `npx skills add guyi-a/pi-ling --skill docx -a codex`. Or copy the skill folder (.agents/skills/docx in guyi-a/pi-ling) into .agents/skills/docx in your project. Codex loads it when a task matches its description.

Can I use DOCX in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add guyi-a/pi-ling --skill docx -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/docx, .gemini/skills/docx, .github/skills/docx and .opencode/skills/docx in your project.

What does DOCX need to run?

Going by SKILL.md and its folder, DOCX needs the command-line tools its instructions call (pandoc, soffice, pdftoppm and brew).

Does DOCX access the network?

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.

Is DOCX safe to install?

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. Review the folder before installing.

What licence does DOCX use?

DOCX is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does DOCX use?

About 1.1k tokens (SKILL.md is roughly 4.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to DOCX?

Skills that share tags, products or a category with DOCX: DOCX Toolkit (XiaomiMiMo/MiMo-Code, 14k stars), Pandic Office (Team-Commonly/commonly, 1.4k stars), Article Format Adjustment (aipoch/medical-research-skills, 2k stars) and Converting Files (oaustegard/claude-skills, 150 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains DOCX?

guyi-a (a GitHub user) maintains it in guyi-a/pi-ling, which has 106 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on September 16, 2026.

Source: guyi-a/pi-ling on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.