← 返回列表
全部 Skill›内容与媒体 Content & Media›docx

docx

作者 @asgeirtj · 语言 en
Complete DOCX document creation, editing, and analysis capabilities with support for revisions, comments, formatting preservation, and text extraction. Also handles Word format conversion: legacy .doc → .docx, DOCX → PDF, DOCX → images (PNG/JPG) for visual review or previews, and DOCX → Markdown/plain text extraction. Use for creating new documents, modifying content, handling revisions, adding comments, other professional Word document tasks, or when the user asks to convert, export, or render a Word document to another format (e.g. 'Word转PDF', 'doc转docx', 'export this docx as PDF/images').
内容与媒体 Content & Media文档处理通用执行命令访问网络读写文件待翻译
最近源活动
—
检测 SKILL.md 语言
en
星标 ★
72,578
分支 Fork
0
安装选项
提示
指令
使用 AI 助手安装
将下面的提示复制到你正在使用的 AI 助手中。
下载完整 Skill 目录(含全部配套文件)。 下载压缩包 ↓
SKILL.md 原文预览

DOCX Creation, Editing, and Analysis

Quick Setup

bash "$SKILL_DIR/setup.sh"    # Interactive environment check + install
Local-font-first. Inspect fonts available in the user's local environment and prefer a suitable
installed font. Use bundled or downloaded fonts only as fallbacks; do not install fonts without the
user's confirmation.

Overview

A .docx file is a ZIP archive containing XML files. This skill provides tools for creating, editing, reading, and reviewing Word documents.

Original File Preserved

User-provided input files are read-only by default. Deliverables go to new files

(<stem>_updated.docx next to the input); edit an original in place only when the user explicitly

asks — and then copy it to <stem>_backup.docx next to it (never /tmp) first. See

routes/edit.md for the full workflow.

Quick Route — Read This First

Step 1: Determine task type → load the corresponding route file

Step 2: Determine business scene → load the corresponding scene file (if applicable)

Step 3: Load references/design-system.md for cover recipes, palettes, and chart colors

Step 4: Load references/common-rules.md for shared layout, font, and quality rules

Step 5: Execute per route instructions

Step 6: Run the post-generation checklist

⚠️ MANDATORY — Cover Recipe Enforcement (Step 3):

When creating a document that needs a cover page, you MUST use one of the 7 validated cover recipes (R1–R7) from design-system.md. Free-form cover code is FORBIDDEN. The recipe provides the wrapper table, background, layout structure, border settings, and spacing — do not reinvent any of these.

Workflow: (1) Call selectCoverRecipe(docType, industry) to get recipe + palette → (2) Use the corresponding buildCoverRX() function code from design-system.md → (3) Pass your config (title, subtitle, metaLines, etc.) into the recipe builder. If you skip this and write cover code from scratch, the cover WILL have compatibility issues (blank pages in MS Office, missing borders, overflow, etc.).

Script Path Setup (MANDATORY before any script call)

All CLI tools live in scripts/ relative to this skill's directory. Before calling any script, resolve the absolute path once:

DOCX_SCRIPTS="<skill_directory>/scripts"   # ← parent directory of this SKILL.md

# Then all commands use $DOCX_SCRIPTS:
python3 "$DOCX_SCRIPTS/postcheck.py" output.docx
python3 "$DOCX_SCRIPTS/add_toc_placeholders.py" output.docx --auto

For Python imports (when generation code needs to import skill modules):

import sys, os
DOCX_SCRIPTS = os.path.join("<skill_directory>", "scripts")
if DOCX_SCRIPTS not in sys.path:
    sys.path.insert(0, DOCX_SCRIPTS)

⚠️ NEVER use bare python3 scripts/... — it only works if cwd happens to be the skill directory. Always use the absolute $DOCX_SCRIPTS path.

Task Router

| User Intent | Route | Files to Load |

|-------------|-------|---------------|

| Create/write/generate (no attachment) | Create | routes/create.md + references/docx-js-core.md |

| Edit/modify/revise (has attachment) | Edit | routes/edit.md + references/ooxml.md |

| Format/layout/font/margin | Format | routes/format.md |

| Comment/annotate/review | Comment | routes/comment.md |

| Read/analyze/extract | Read | routes/read.md |

Scene Router (Optional — load after route)

| User Keywords | Scene | File |

|---------------|-------|------|

| thesis, academic, research, paper, dissertation, abstract, journal | Academic | scenes/academic.md |

| report, analysis, experiment, testing, survey, review, summary, proposal, feasibility, competitor, industry, operations | Report | scenes/report.md |

| contract, agreement, terms, transfer, NDA, confidential, framework, cooperation, service terms, user agreement, procurement | Contract | scenes/contract.md |

| resume, CV, job application | Resume | scenes/resume.md |

| exam, test, quiz, paper (exam context), lesson plan | Exam | scenes/exam.md |

| official document, notice, letter, reply, minutes, red header, government, issuance | Official | scenes/official-doc.md |

| broadcast script, product copy, livestream, speech, presentation script, video script | Copywriting | scenes/copywriting.md |

| plan, proposal (if not report context) | Report | scenes/report.md |

| policy, regulation, standard, management rules | Official | scenes/official-doc.md |

If no scene matches, use default design rules from references/design-system.md and references/common-rules.md.

Formatting Standards (Always Apply)

→ See references/common-rules.md for full font profiles, spacing, indent, and layout rules.

Key rules (quick reference):

  • Line spacing: 1.3x (line: 312) — MANDATORY. Exceptions: resume 1.15x, official doc 28pt fixed, copywriting 400, contract 1.5x
  • CJK body: Justified + 2-char indent (firstLine: 480 SimSun / 420 YaHei)
  • Tables: margins set, ShadingType.CLEAR, tableHeader: true, cantSplit: true, title keepNext: true
  • Images: type parameter required, preserve aspect ratio via image-size, PageBreak inside Paragraph
  • Full-page Table row: `rule: "exact"
评论
Aasgeirtj
asgeirtj
asgeirtj/system_prompts_leaks
查看 GitHub 仓库 查看作者的其他 Skill
来源信息
作者@asgeirtj
所属大类内容与媒体 Content & Media / 文档处理
国内可用性通用
最近源活动—
风险提示执行命令、访问网络、读写文件
提示:风险标签为程序静态扫描结果,仅作提示,不代表安全认证。安装前请阅读 SKILL.md 及其引用的脚本、权限,自行判断是否可信。