跳到正文
cccskills
免费在 GitHub 公开

docx

Create Word reports, memos, letters, and proposals with headings, tables, lists, and a table of contents. Also supports targeted edits to existing .docx files and reading or summarizing their text and tables.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Use this skill whenever the user asks for a Word document, a .docx file, or a report/memo/letter/proposal delivered as one — creating a new document from scratch, editing an existing .docx, or reading/summarizing the contents of one. Covers page layout, headings, tables, numbered/bulleted lists, page breaks, and a table of contents. Does not cover converting a .docx to PDF or .doc to .docx (see file-conversion for what conversions ARE supported in this environment).

集成工具Google DocsWord
查看安装方法

适用场景

  • Create a Word report or proposal
  • Edit selected passages in an existing document
  • Read and summarize document text and tables
  • Format headings, lists, and a table of contents

包含的文件(1)

  • SKILL.md5.2 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Word documents (.docx)

Quick Reference

TaskApproach
Create a new .docx from scratchdocx (docx-js) — write a TypeScript program (packages: ["docx"]) and run it via your coding tool
Edit an existing .docxoffice-utils: unpack → edit XML → pack (see that skill)
Read / extract text from a .docxpython-docx or docx2python (Python, already installed — no pandoc needed)

Always CREATE documents with docx (docx-js) in TypeScript — never with python-docx. python-docx is in this environment for reading existing documents only. Run the TypeScript program via whatever coding surface you have: the run_code tool directly (language="typescript", packages=["docx"]), or the coding_agent delegate — in that case restate these library/language requirements in its goal. The library is pre-installed in the standard sandbox image, so the install step is an instant no-op there.

Creating a new document (docx-js)

docx-js (npm package docx) builds a document as a tree of JS objects, then serializes it. The hard-won pitfalls below are the difference between a .docx that opens cleanly in Word/Google Docs and one that shows a repair prompt or renders with the wrong layout — verify your generated file against every one of these before considering the task done.

  1. Page size and margins are in DXA units (twentieths of a point), not inches or pixels. A US Letter page (8.5in x 11in) is { width: 12240, height: 15840 } DXA. Always set Document.sections[0].properties.page.size explicitly — don't rely on the library default, which may not match what the user expects.
  2. Table column widths must use WidthType.DXA, not WidthType.PERCENTAGE, for predictable rendering. Percentage widths compute inconsistently across renderers (Word vs. Google Docs vs. LibreOffice) when the table has merged cells or nested tables. Compute explicit DXA widths that sum to the usable page width (page width minus left+right margins).
  3. Numbered/bulleted lists need a LevelFormat numbering config registered on the document, not literal unicode bullet characters (•, -) typed into a text run. A literal bullet character is not a list to Word — it can't be renumbered, indented, or styled as one. Define a numbering.config with LevelFormat.BULLET (or LevelFormat.DECIMAL for numbered lists) and reference it from each paragraph's numbering property.
  4. A page break is a property of a Paragraph, not a standalone element. Use new Paragraph({ children: [new PageBreak()] }) — inserting a bare PageBreak() outside a paragraph will fail to serialize correctly in some docx-js versions.
  5. A table of contents (TableOfContents) only picks up paragraphs styled with a real Heading style (HeadingLevel.HEADING_1 etc.), never plain bold text. If the user wants a working, clickable/updatable ToC, every section title must use a heading style — and the ToC itself needs a "right-click → Update Field" note in your response, since docx-js writes the ToC's field code but cannot pre-compute the resulting page numbers without a real layout engine.
  6. Always set explicit size (half-points) on any TextRun where the default (usually 11pt/22 half-points) doesn't match the user's request — half-points, not points: 12pt text is size: 24.

Editing an existing .docx

Use the office-utils skill's unpack → edit → pack cycle: the document body lives in word/document.xml inside the unpacked tree. Locate the <w:p> (paragraph) or <w:tbl> (table) you need to change, make the smallest edit that achieves the goal, and repack. Do not attempt to regenerate the whole document via docx-js just to change one paragraph — you will lose any formatting/styles the original author applied that aren't represented in your regenerated version.

Reading a .docx

  • python-docx: Document(path).paragraphs / .tables for structured access (paragraph text + style, table cell grids).
  • docx2python: better for a fast, structure-preserving plain-text dump when you just need the content, not to manipulate specific elements.

Both are already installed in the sandbox — no install_packages call needed.

Not supported in this environment

  • .doc → .docx conversion, and .docx → PDF rendering — both require LibreOffice, which is not installed in the sandbox yet. Tell the user this rather than attempting a workaround that will silently produce a wrong result.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Build or extend a PipesHub connector, an integration that syncs content from an external service or database. The skill guides API research, design decisions, permission mapping, implementation, testing, and documentation of what was actually verified.

中文简介正在准备中。当前显示英语简介。

  • Build a connector for an external service
  • Add a new content type to an existing connector
  • Review how source permissions map to PipesHub
pipeshub-ai/pipeshub-ai38432026年10月22日 更新

Load, clean, summarize, and join tabular data from CSV, Excel, JSON, or database exports using pandas. Check missing values, data types, and row counts, then independently verify key figures before reporting numbers printed by the code.

中文简介正在准备中。当前显示英语简介。

  • Summarizing revenue by region
  • Cleaning missing values and duplicate rows
  • Joining files by customer ID
pipeshub-ai/pipeshub-ai38432026年10月22日 更新

Turn data into charts suited to comparisons, trends, distributions, relationships, or shares. Add clear titles, units, and accessible colors, then export a static PNG or interactive HTML with hover details and zoom controls.

中文简介正在准备中。当前显示英语简介。

  • Charting monthly revenue trends
  • Comparing totals across regions or categories
  • Examining order-size distributions
pipeshub-ai/pipeshub-ai38432026年10月22日 更新

Choose suitable libraries for converting spreadsheet data and image files, or extracting text and tables from documents. Covers supported format pairs and identifies conversions unavailable in the described environment before work begins.

中文简介正在准备中。当前显示英语简介。

  • Convert tabular data between CSV, Excel, and JSON
  • Change image formats or resize images
  • Extract text from Word documents
pipeshub-ai/pipeshub-ai38432026年10月22日 更新

Unpack Word and PowerPoint files to inspect and edit their internal XML, the markup that stores document content. Repack targeted changes with XML syntax checks while preserving the original archive entry order.

中文简介正在准备中。当前显示英语简介。

  • Make a small edit inside a Word or PowerPoint file
  • Investigate errors in generated document XML
  • Inspect internal document parts and image references
pipeshub-ai/pipeshub-ai38432026年10月22日 更新

pdf

免费

Create PDF reports, invoices, and letters, extract text or tables from existing PDFs, and fill interactive form fields. The skill also guides table layout, text wrapping, and page breaks so generated documents fit their pages.

中文简介正在准备中。当前显示英语简介。

  • Create a PDF report or invoice
  • Extract text and tables from an existing PDF
  • Fill fields in a PDF form
pipeshub-ai/pipeshub-ai38432026年10月22日 更新

查看 pipeshub-ai 的全部技能

报告此技能的问题