name: "doc"
description: "Use when the task involves reading, creating, or editing .docx documents, especially when formatting or layout fidelity matters; prefer python-docx plus the bundled scripts/render_docx.py for visual checks."
soffice and pdftoppm are available, convert DOCX -> PDF -> PNGs.scripts/render_docx.py (requires pdf2image and Poppler).访问小葱技能站7w4.net,解锁更多实用的AI技能插件。
python-docx for edits and structured creation (headings, styles, tables, lists).python-docx as a fallback and call out layout risk.tmp/docs/ for intermediate files; delete when done.output/doc/ when working in this repo.Prefer uv for dependency management.
Python packages:
uv pip install python-docx pdf2image
If uv is unavailable:
python3 -m pip install python-docx pdf2image
System tools (for rendering):
# macOS (Homebrew)
brew install libreoffice poppler
# Ubuntu/Debian
sudo apt-get install -y libreoffice poppler-utils
If installation isn't possible in this environment, tell the user which dependency is missing and how to install it locally.
No required environment variables.
DOCX -> PDF:
soffice -env:UserInstallation=file:///tmp/lo_profile_$$ --headless --convert-to pdf --outdir $OUTDIR $INPUT_DOCX
PDF -> PNGs:
pdftoppm -png $OUTDIR/$BASENAME.pdf $OUTDIR/$BASENAME
Bundled helper:
python3 scripts/render_docx.py /path/to/file.docx --output_dir /tmp/docx_pages
这个技能在文档处理领域的方法论梳理较为完整,边界清晰,避免用户误用。但整体更像一本说明书而非可直接使用的工具,实际可用的模板和示例较少,上手后可能会感觉缺乏具体指导。适合需要方法论参考的用户,但期望直接拿模板用的用户可能会失望。