Communitygithub.com

LiChangZheng10086/doyin_ai_video

用于创建、读取、编辑和操作Word文档(.docx)或Word模板(.dotx)文件的技能。如果用户需要生成报告、备忘录、信函、模板或任何格式化的Word文档,请使用此技能。

doyin_ai_video 是什么?

该技能是一个强大的AI辅助工具,专为处理Microsoft Word文档(.docx和.dotx)而设计。它支持文档的创建、编辑、读取(通过pandoc转换为Markdown)和内容分析。创建文档时,它利用预安装的docx(npm)库,并提供了一系列经过验证的“注意事项”,以避免常见陷阱(如页面尺寸默认A4、表格宽度要求、正确的列表格式、页面分隔符和目录生成)。编辑现有文档时,它采用基于XML的处理流程:解压文档、合并碎片化的XML运行(以便文本可搜索)、直接编辑word/document.xml,然后重新压缩。该工具还包含丰富的版本控制功能:支持跟踪修订(redlining),并通过验证脚本确保所有更改都正确包裹在<w:ins>或<w:del>标签内;支持注释的创建和锚定;并提供脚本以接受所有修订并生成清洁副本。输出验证部分允许将生成的.docx转换为PDF,并进行可视化检查。该技能依赖pandoc、LibreOffice和Poppler工具,并包含针对复杂场景(如段落删除导致的空项目符号)的注意事项。它适用于Claude Code、Cursor、Codex等AI代理开发环境。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/LiChangZheng10086/doyin_ai_video/tree/HEAD/.agents/skills/docx

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

DOCX 创建、编辑和分析

.docx 文件是 XML 文件的 ZIP 压缩包。根据任务选择合适的方法:

任务方法
创建新文档编写 docx(npm)脚本 — 请参考下面的注意事项
编辑现有文档unzip → 编辑 word/document.xml → zip(docx-js 无法打开现有文件)
读取内容pandoc -t markdown file.docx

下面的脚本路径相对于本技能目录。

使用 docx-js 创建文档 — 注意事项

docx 已预安装 — 不要先运行 npm install;直接编写脚本并使用 require('docx')。仅当 require('docx') 失败时才运行 npm install docx。模型知道 API;以下是常见的陷阱:

  • 页面尺寸默认为 A4。 若需美国信纸,请设置 page: { size: { width: 12240, height: 15840 } }(单位 DXA;1440 = 1 英寸)。
  • 横向页面: 传入纵向尺寸并同时设置 orientation: PageOrientation.LANDSCAPE — docx-js 内部会自动交换宽/高。
  • 表格需要双重宽度设置: 在表格上设置 columnWidths,同时在每个单元格上设置 width,两者均使用 WidthType.DXA(PERCENTAGE 在 Google Docs 中会出错)。列宽之和必须等于表格宽度。
  • 表格底纹: 使用 ShadingType.CLEAR,切勿使用 SOLID(会导致渲染为黑色)。
  • 列表: 切勿直接插入 •;应使用带有 LevelFormat.BULLET 的 numbering 配置。
  • ImageRun 需要指定 type:(如 "png"、"jpg" 等)。
  • PageBreak 必须放在 Paragraph 内部。
  • 切勿使用 \n — 应使用独立的 Paragraph 元素。
  • 目录: 标题必须使用内置的 HeadingLevel.*;自定义标题样式需要设置 outlineLevel,否则不会出现在目录中。
  • 不要使用表格作为水平线 — 应改用段落底部边框。
  • 点前导 / 同一行右对齐: 在 TextRun 内部使用 PositionalTab(alignment: PositionalTabAlignment.RIGHT、leader: PositionalTabLeader.DOT),不要使用文字上的 . 或空格填充。

验证输出

写入 .docx 后,渲染并查看它:

python scripts/office/soffice.py --headless --convert-to pdf output.docx
pdftoppm -jpeg -r 100 output.pdf page
ls page-*.jpg   # 然后读取这些图片

pdftoppm 会将页码零填充至页码数的宽度(page-01.jpg…page-12.jpg)。

编辑现有文档

旧版 .doc 文件必须先转换:python scripts/office/soffice.py --headless --convert-to docx file.doc。

unzip -q doc.docx -d unpacked/
find unpacked -type l -delete   # 删除符号链接条目 — 来自外部的 docx 文件不可信
python scripts/merge_runs.py unpacked/   # 合并碎片化运行,使文本可查找
# 原地编辑 unpacked/word/document.xml — 不要重新格式化或美化打印
(cd unpacked && rm -f ../out.docx && zip -Xr ../out.docx .)
python scripts/office/validate.py out.docx --original doc.docx   # XSD 检查;--auto-repair 修复常见问题
# 需要修订跟踪?添加 --author "<您的修订者名称>" 以检查每个编辑都被跟踪

Word 会将文本分散到许多 <w:r> 运行中(修订ID、拼写检查标记等),因此您在文档中看到的短语在 XML 中通常不是连续的字符串。merge_runs.py 会合并 word/document.xml 中相邻且格式相同的运行,而不改变内容或渲染;它也接受直接传入 .docx 文件(python scripts/merge_runs.py doc.docx -o merged.docx)。

跟踪更改: 当进行修订时,使用 --author "<您的修订者名称>"(需要 --original)进行验证——它会报告您更改但未用 <w:ins>/<w:del> 包裹的任何文本(这很容易意外发生,且在“接受”视图中不可见)。将运行包裹在带有 w:id、w:author、w:date 属性的 <w:ins>/<w:del> 中。在 <w:del> 内部,文本元素是 <w:delText>,而不是 <w:t>。一个删除的段落标记(<w:pPr><w:rPr><w:del w:id=".." w:author=".." w:date=".."/></w:rPr></w:pPr>)表示“将此段落合并到下一段”——因此彻底删除一个段落就是这样做,再加上对每个运行包裹 <w:del>。<w:del/> 必须出现在 rPr 的其他子元素之前;它们的顺序由 schema 强制要求。

要生成接受所有跟踪更改的清洁副本:python scripts/accept_changes.py in.docx out.docx。

接受一个删除的段落标记应该将该段落与其下面的段落合并,因此所有运行都被删除的段落会消失。Word 能做到这一点;accept_changes.py 和 pandoc --track-changes=accept 并不总是能做到。两者都以相同的方式失败——它们会删除被删除的文本,但会留下清空的段落,当该段落是自动编号时,会显示为一个多余的空项目符号:

  • pandoc --track-changes=accept 从不合并段落。
  • accept_changes.py(LibreOffice)可以正确合并它们,除非被删除的段落后面跟着一个空白的间隔段落。

任一视图中的空项目符号都是该视图的产物,而不是文档的缺陷。请在 XML 中检查段落删除。

注释

注释需要六个交叉链接的文件。在同时编辑 document.xml 时使用目录模式(节省解压/重新压缩的周期),否则使用 .docx 直接模式:

# 针对已解压的目录(在同时放置标记时首选)
python scripts/comment.py unpacked/ "费用与开支上限过低"
python scripts/comment.py unpacked/ "同意" --parent 0

# 直接针对 .docx 文件
python scripts/comment.py contract.docx "此上限过低" -o annotated.docx

该脚本会写入 comments.xml、commentsExtended.xml、commentsIds.xml、commentsExtensible.xml、关系文件以及内容类型覆盖。注释 ID 会自动分配。然后脚本会打印出要添加到 word/document.xml 中的 <w:commentRangeStart>/<w:commentRangeEnd>/<w:commentReference> 代码片段,以便将注释锚定到特定文本——在放置这些标记之前,注释已存在但不可见。

依赖

docx(npm,已预安装——仅当 require('docx') 失败时才安装)· pandoc · LibreOffice (soffice) · pdftoppm (Poppler)

Individual skills in this repo

This repo contains 12 individual skills — each has its own dedicated page.

LiChangZheng10086/doyin_ai_video

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

LiChangZheng10086/doyin_ai_video

Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIR...

LiChangZheng10086/doyin_ai_video

Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.

LiChangZheng10086/doyin_ai_video

Grill me about specs for the workflows I want to build, within this workspace.

LiChangZheng10086/doyin_ai_video

Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.

LiChangZheng10086/doyin_ai_video

智能 PPT 生成器。支持 7 种视觉风格(乐高/波普/黏土/黑白/商务/学术/科技),具备根据内容自动推荐风格、生成大纲、绘制配图并组装成片的全自动能力。

LiChangZheng10086/doyin_ai_video

Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions \"deck,\" \"slides,\" \"presentation,\" or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.

LiChangZheng10086/doyin_ai_video

Diagnose and fix React codebase health issues. Use when reviewing React code, fixing performance problems, auditing security, or improving code quality.

LiChangZheng10086/doyin_ai_video

Sentry error monitoring and performance tracing patterns for Next.js applications.

LiChangZheng10086/doyin_ai_video

Simplify and refine recently modified code for clarity and consistency. Use after writing code to improve readability without changing functionality.

LiChangZheng10086/doyin_ai_video

✅ "你知道今天所有大模型能读懂你的话,全靠一个叫Transformer的架构吗?"

LiChangZheng10086/doyin_ai_video

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like \"the xlsx in my downloads\") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.

相关技能