返回顶部
d

doc处理文档

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.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
607
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

doc

DOCX 技能

使用时机

  • - 阅读或审阅对布局有要求的DOCX内容(表格、图表、分页)。
  • 创建或编辑具有专业格式的DOCX文件。
  • 在交付前验证视觉布局。

工作流程

  1. 1. 优先进行视觉审阅(布局、表格、图表)。
- 如果soffice和pdftoppm可用,将DOCX转换为PDF,再转换为PNG图片。 - 或使用scripts/render_docx.py(需要pdf2image和Poppler)。 - 如果缺少这些工具,请安装它们,或要求用户在本地审阅渲染后的页面。
  1. 2. 使用python-docx进行编辑和结构化创建(标题、样式、表格、列表)。
  2. 每次有意义的更改后,重新渲染并检查页面。
  3. 如果无法进行视觉审阅,使用python-docx提取文本作为备选方案,并指出布局风险。
  4. 保持中间输出文件有序,并在最终确认后清理。

临时文件和输出规范

  • - 使用tmp/docs/存放中间文件;完成后删除。
  • 在此仓库中工作时,将最终产物写入output/doc/目录。
  • 保持文件名稳定且具有描述性。

依赖项(如缺失请安装)

推荐使用uv进行依赖管理。

Python包:

uv pip install python-docx pdf2image

如果uv不可用:

python3 -m pip install python-docx pdf2image

系统工具(用于渲染):

macOS(Homebrew)

brew install libreoffice poppler

Ubuntu/Debian

sudo apt-get install -y libreoffice poppler-utils

如果在此环境中无法安装,请告知用户缺少哪个依赖项以及如何在本地安装。

环境

无需设置环境变量。

渲染命令

DOCX转PDF:

soffice -env:UserInstallation=file:///tmp/loprofile$$ --headless --convert-to pdf --outdir $OUTDIR $INPUT_DOCX

PDF转PNG图片:

pdftoppm -png $OUTDIR/$BASENAME.pdf $OUTDIR/$BASENAME

集成辅助脚本:

python3 scripts/renderdocx.py /path/to/file.docx --outputdir /tmp/docx_pages

质量标准

  • - 交付可直接使用的文档:一致的排版、间距、页边距和清晰的层级结构。
  • 避免格式缺陷:文字被裁剪/重叠、表格损坏、字符无法阅读或使用默认模板样式。
  • 图表、表格和视觉元素在渲染页面中必须清晰可辨,对齐正确。
  • 仅使用ASCII连字符。避免使用U+2011(不间断连字符)和其他Unicode破折号。
  • 引文和参考文献必须可读;不得保留工具标记或占位符字符串。

最终检查

  • - 在最终交付前,以100%缩放比例重新渲染并检查每一页。
  • 修复任何间距、对齐或分页问题,并重复渲染循环。
  • 确认没有遗留文件(临时文件、重复渲染文件),除非用户要求保留。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 doc-1776062582 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 doc-1776062582 技能

通过命令行安装

skillhub install doc-1776062582

下载

⬇ 下载 doc v1.0.0(免费)

文件大小: 10.18 KB | 发布时间: 2026-4-14 13:41

v1.0.0 最新 2026-4-14 13:41
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.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部