office-docx

GitHub

使用 python-docx 库创建、读取、编辑和验证 Word 文档。支持文本修改、样式应用及复杂表格处理,强调保留原有设计并正确处理东亚字体。提供文件生成与内容校验流程,确保输出符合用户要求。

packages/skill/skill-office/assets/office-docx/SKILL.md deepseek-ai/deepseek-harness

Trigger Scenarios

需要生成或编辑 .docx 文件 批量处理 Word 文档内容 自动化报告生成

Install

npx skills add deepseek-ai/deepseek-harness --skill office-docx -g -y
More Options

Non-standard path

npx skills add https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/skill/skill-office/assets/office-docx -g -y

Use without installing

npx skills use deepseek-ai/deepseek-harness@office-docx

指定 Agent (Claude Code)

npx skills add deepseek-ai/deepseek-harness --skill office-docx -a claude-code -g -y

安装 repo 全部 skill

npx skills add deepseek-ai/deepseek-harness --all -g -y

预览 repo 内 skill

npx skills add deepseek-ai/deepseek-harness --list

SKILL.md

Frontmatter
{
    "name": "office-docx",
    "description": "Create, read, edit, and validate Word documents (.docx)."
}

Word documents

Use python-docx for DOCX creation and ordinary edits. Follow an explicit user or applicable AGENTS.md requirement for a project environment or another library. Otherwise call load_workspace_dependencies and execute the returned Python path with its bundled libraries. Do not install packages or discover a system Python for the default workflow. If the tool is unavailable, use an already configured environment and report a missing dependency only when it prevents the requested operation.

Keep source scripts, intermediate files, and final documents in the task workspace; the runtime and this skill directory are read-only resources. Use the user's requested language and preserve an existing document's design unless a redesign is requested.

Name Python scripts for their task, such as edit_docx.py; avoid module names such as inspect.py, docx.py, or zipfile.py that shadow imported libraries.

Create and edit

For text edits, locate the target by its text or position and inspect only its runs and formatting. A title can be an ordinary paragraph without a Title style or document-property title. Update the relevant runs; assigning paragraph .text destroys run formatting. Save a new file unless an in-place edit is requested. For ordinary text edits, do not unzip the document, enumerate ZIP members, dump raw XML, or inspect core properties, headers, or footers unrelated to the target. Investigate these only for a concrete failure, an ambiguous target, an unsupported feature, or an explicit user requirement. Rebuilding a document can lose unsupported features.

Use paragraph styles for headings and body text. Size tables for the section that contains them, and account for merged cells and nested tables. Chinese, Japanese, and Korean text may need an explicit w:eastAsia font assignment in addition to run.font.name; font names alone do not establish glyph availability or rendered appearance.

For a new document, use the selected Python executable:

from docx import Document

document = Document()
document.add_heading("Project report", level=0)
document.add_paragraph("Summary", style="Heading 1")
document.add_paragraph("The requested findings go here.")
document.save("report.docx")

python-docx does not paginate or render documents. Do not represent ordinary replacement, colored text, or comments as tracked changes. When real revisions or unsupported OOXML features matter, preserve their package parts and verify the requested operation rather than silently discarding them. When writing package parts directly, create a new ZIP and copy each unchanged member once; appending a replacement member duplicates its name and corrupts the package.

Check and deliver

Reopen the saved document with python-docx and verify the requested content, related formatting, and unchanged content that must be preserved. When these checks pass, stop validation and deliver the file. Do not add ZIP integrity checks, package inventories, or metadata inspection as routine final verification.

Creating a file or changing content with incidental basic formatting does not require additional operations. Load office-render for requested images or visual inspection. When styling, font color, spacing, sizing, or text alignment is the requested edit, load office-render and inspect the changed page even without a separate visual-check request, unless the user explicitly skips rendering. For PDF output load office-export-pdf.

Call present({"files":[{"path":"report.docx"}]}) with the actual final DOCX path. It exposes the current source file without copying or preserving its bytes, so keep that file in place and do not present temporary QA reports unless requested. If present is unavailable, provide the final workspace path using the session's supported file delivery method.

Version History

  • ce7073d Current 2026-11-02 10:36
  • 687f282 2026-10-18 17:47

    恢复 Word 创建指导并修复直接包写入问题;移除捆绑的结构检查器;限制内容验证范围至已编辑部分;移除命令启动器和 shell 兼容性变更。

  • 477b4f4 2026-09-27 12:00

    修复并统一跨部署环境使用捆绑版LibreOffice Kit CLI,升级Kit版本以增强渲染预览兼容性,优化Excel视觉QA逻辑。

  • ddefc45 2026-09-22 01:11

Same Skill Collection

.agents/skills/agent-experience/SKILL.md
.agents/skills/cordis-styling-nitpicking/SKILL.md
.agents/skills/dsh-archive-agent-notes/SKILL.md
.agents/skills/dsh-ci-test-reliability/SKILL.md
.agents/skills/dsh-client-ui-ux/SKILL.md
.agents/skills/dsh-code-review/SKILL.md
.agents/skills/dsh-create-upgrade-guide/SKILL.md
.agents/skills/dsh-cua-macos-signing/SKILL.md
.agents/skills/dsh-doc-site-sync/SKILL.md
.agents/skills/dsh-doc-standards/SKILL.md
.agents/skills/dsh-error-handling/SKILL.md
.agents/skills/dsh-find-simplifications/SKILL.md
.agents/skills/dsh-merging-stacked-prs/SKILL.md
.agents/skills/dsh-official-plugin-artwork/SKILL.md
.agents/skills/dsh-pr-description/SKILL.md
.agents/skills/dsh-pre-push-checks/SKILL.md
.agents/skills/dsh-prose-standard/SKILL.md
.agents/skills/dsh-responsive-ui/SKILL.md
.agents/skills/dsh-session-projection/SKILL.md
.agents/skills/dsh-speed-up-perf/SKILL.md
.agents/skills/dsh-translate-docs/SKILL.md
.agents/skills/dsh-trim-cot-leakage/SKILL.md
packages/preset/agent-preset/skills/agent-experience/SKILL.md
packages/preset/agent-preset/skills/cordis-composition-reference/SKILL.md
packages/preset/agent-preset/skills/cordis-plugin-development/SKILL.md
packages/preset/agent-preset/skills/editing-cordis-compositions/SKILL.md
packages/sandbox/sandbox-windows-acl/assets/diagnose-windows-sandbox-acl/SKILL.md
packages/skill/skill-office/assets/office-export-pdf/SKILL.md
packages/skill/skill-office/assets/office-pptx/SKILL.md
packages/skill/skill-office/assets/office-recalculate/SKILL.md
packages/skill/skill-office/assets/office-render/SKILL.md
packages/skill/skill-office/assets/office-xlsx/SKILL.md
packages/skill/skill-office/assets/office/SKILL.md
.agents/skills/dsh-doc/SKILL.md
.agents/skills/record-browser-gif/SKILL.md

Metadata

Files
0
Version
fcc0ad4
Hash
e5496516
Indexed
2026-09-22 01:11

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-08 10:55
浙ICP备14020137号-1