← 返回 Skills 市场
flywhale-666

Doc

作者 flywhale · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
720
总下载
0
收藏
12
当前安装
1
版本数
在 OpenClaw 中安装
/install doc
功能描述
Use when the task involves reading, creating, or editing `.docx` documents, especially when formatting or layout fidelity matters; prefer `python-docx` plus...
使用说明 (SKILL.md)

DOCX Skill

When to use

  • Read or review DOCX content where layout matters (tables, diagrams, pagination).
  • Create or edit DOCX files with professional formatting.
  • Validate visual layout before delivery.

Workflow

  1. Prefer visual review (layout, tables, diagrams).
    • If soffice and pdftoppm are available, convert DOCX -> PDF -> PNGs.
    • Or use scripts/render_docx.py (requires pdf2image and Poppler).
    • If these tools are missing, install them or ask the user to review rendered pages locally.
  2. Use python-docx for edits and structured creation (headings, styles, tables, lists).
  3. After each meaningful change, re-render and inspect the pages.
  4. If visual review is not possible, extract text with python-docx as a fallback and call out layout risk.
  5. Keep intermediate outputs organized and clean up after final approval.

Temp and output conventions

  • Use tmp/docs/ for intermediate files; delete when done.
  • Write final artifacts under output/doc/ when working in this repo.
  • Keep filenames stable and descriptive.

Dependencies (install if missing)

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.

Environment

No required environment variables.

Rendering commands

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

Quality expectations

  • Deliver a client-ready document: consistent typography, spacing, margins, and clear hierarchy.
  • Avoid formatting defects: clipped/overlapping text, broken tables, unreadable characters, or default-template styling.
  • Charts, tables, and visuals must be legible in rendered pages with correct alignment.
  • Use ASCII hyphens only. Avoid U+2011 (non-breaking hyphen) and other Unicode dashes.
  • Citations and references must be human-readable; never leave tool tokens or placeholder strings.

Final checks

  • Re-render and inspect every page at 100% zoom before final delivery.
  • Fix any spacing, alignment, or pagination issues and repeat the render loop.
  • Confirm there are no leftovers (temp files, duplicate renders) unless the user asks to keep them.
安全使用建议
This skill is coherent and generally safe for working with DOCX files, but take ordinary cautions: run it in an isolated environment for untrusted documents (DOCM files can contain macros) and avoid opening unknown attachments with macros enabled. Install LibreOffice and Poppler from official repositories (brew/apt or vendor websites). The helper script invokes local commands (soffice, pdftoppm) and will write output files (it can overwrite existing output files), so review output paths and run on copies of originals if you need to preserve source files. If you cannot install the system tools in this environment, the skill will fall back to extracting text only — the SKILL.md explains how to proceed. Finally, the SKILL.md mentions a tool called "uv" for dependency management; if unfamiliar, ignore that line and use pip directly as shown.
功能分析
Type: OpenClaw Skill Name: doc Version: 1.0.0 The skill is classified as suspicious primarily due to the explicit instruction in `SKILL.md` to use `sudo apt-get install -y libreoffice poppler-utils` for dependency installation. While the intent is to install legitimate tools, directly instructing an AI agent to execute commands with `sudo` introduces a significant privilege escalation vulnerability if the agent's execution environment is not adequately sandboxed or if the agent is compromised. This allows the skill to perform privileged operations without explicit user confirmation, which is a high-risk capability. The `scripts/render_docx.py` Python code, however, appears to handle subprocess calls safely by using lists of arguments, mitigating direct shell injection within the script itself.
能力评估
Purpose & Capability
Name and description (DOCX editing and visual fidelity) match the included SKILL.md and the bundled scripts. The script's use of python-docx, LibreOffice (soffice), Poppler (pdftoppm), and pdf2image is expected for rendering and layout checks.
Instruction Scope
SKILL.md stays on task: it describes installing python packages and system tools, running the bundled render_docx.py, converting DOCX→PDF→PNG, and cleaning up temp files. The instructions reference only the input DOCX, temporary and output dirs, and required render tools; they do not ask for unrelated files, environment variables, or external endpoints.
Install Mechanism
There is no automated install spec or remote download; the skill is instruction-only with a bundled helper script. Recommended system packages are installed via standard package managers (brew or apt) and Python packages via pip — no obscure or remote install URLs are used.
Credentials
The skill declares no environment variables or credentials. The runtime accesses only local tools (soffice, pdftoppm) and local filesystem paths described in the SKILL.md; this is proportional to the stated functionality.
Persistence & Privilege
always is false and the skill is user-invocable. The included script operates on user-supplied files and temporary/output directories; it does not attempt to persist configuration, modify other skills, or change system-wide agent settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install doc
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /doc 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of the doc skill for DOCX document handling. - Provides guidance for reading, creating, and editing DOCX files with emphasis on formatting and layout fidelity. - Recommends workflows and tools for visual rendering and review (using soffice, pdftoppm, or scripts/render_docx.py). - Lists conventions for intermediate and output file management. - Details required dependencies and installation steps. - Outlines quality and delivery expectations for client-ready documents. - Includes troubleshooting steps and fallback approaches for environments with missing dependencies.
元数据
Slug doc
版本 1.0.0
许可证
累计安装 14
当前安装数 12
历史版本数 1
常见问题

Doc 是什么?

Use when the task involves reading, creating, or editing `.docx` documents, especially when formatting or layout fidelity matters; prefer `python-docx` plus... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 720 次。

如何安装 Doc?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install doc」即可一键安装,无需额外配置。

Doc 是免费的吗?

是的,Doc 完全免费(开源免费),可自由下载、安装和使用。

Doc 支持哪些平台?

Doc 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Doc?

由 flywhale(@flywhale-666)开发并维护,当前版本 v1.0.0。

💬 留言讨论