with one click
docx
创建和编辑 Word 文档(.docx)。不用于:PDF、纯文本、Markdown
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
创建和编辑 Word 文档(.docx)。不用于:PDF、纯文本、Markdown
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Use when the user asks to create, edit, improve, redesign, beautify, inspect, or export PowerPoint decks, PPT files, slide decks, keynotes, or .pptx deliverables. Prefer this skill for presentation work that must produce a real PPTX file, especially when visual quality, editable text, brand assets, charts, or export verification matter. Do not use for Word documents or PDFs.
Markdown 转微信公众号排版并发布草稿。Use this whenever the user asks to convert Markdown to WeChat Official Account HTML, inspect publish readiness, preview local WeChat layout, or create a WeChat draft. 不用于:写文章内容、其他平台发布。
视频字幕提取、翻译、双语合并、烧录。不用于:纯音频转文字、翻译文本文件、视频剪辑
下载视频/音频(YouTube、B站、Twitter等)。不用于:网页抓取(用 web_fetch)、直播录制
AI图片生成(文生图、图生图、去背景、放大),需本地 ComfyUI。不用于:截图、网页抓图、非AI图片处理
创建自定义技能(SKILL.md)。不用于:执行已有技能、修改代码、一次性脚本
| name | docx |
| description | 创建和编辑 Word 文档(.docx)。不用于:PDF、纯文本、Markdown |
All output files go to the working directory (工作目录). Use file_write to create the Python script, then shell to execute it.
{"command": "pip install python-docx", "timeout": 60000}
# file_write: {WORKDIR}/_script.py
from docx import Document
from docx.shared import Pt, Inches, Cm, RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.enum.table import WD_TABLE_ALIGNMENT
doc = Document()
# --- Title ---
title = doc.add_heading("文档标题", level=0)
title.alignment = WD_ALIGN_PARAGRAPH.CENTER
# --- Paragraph with formatting ---
p = doc.add_paragraph()
run = p.add_run("加粗文本")
run.bold = True
run.font.size = Pt(14)
run.font.color.rgb = RGBColor(0x00, 0x00, 0xFF)
p.add_run(" 普通文本,").font.size = Pt(12)
run2 = p.add_run("斜体文本")
run2.italic = True
# --- Heading levels ---
doc.add_heading("一级标题", level=1)
doc.add_heading("二级标题", level=2)
# --- Bullet list ---
doc.add_paragraph("第一项", style="List Bullet")
doc.add_paragraph("第二项", style="List Bullet")
doc.add_paragraph("第三项", style="List Bullet")
# --- Numbered list ---
doc.add_paragraph("步骤一", style="List Number")
doc.add_paragraph("步骤二", style="List Number")
# --- Table ---
table = doc.add_table(rows=3, cols=3, style="Table Grid")
table.alignment = WD_TABLE_ALIGNMENT.CENTER
# Header row
for i, text in enumerate(["姓名", "年龄", "城市"]):
table.rows[0].cells[i].text = text
# Data rows
data = [["张三", "28", "北京"], ["李四", "32", "上海"]]
for r, row_data in enumerate(data, 1):
for c, val in enumerate(row_data):
table.rows[r].cells[c].text = val
# --- Insert image (if available) ---
# doc.add_picture("{WORKDIR}/image.png", width=Inches(4))
# --- Page break ---
doc.add_page_break()
doc.add_heading("第二页内容", level=1)
doc.add_paragraph("这是第二页的内容。")
doc.save("{WORKDIR}/output.docx")
print("OK: {WORKDIR}/output.docx")
Then execute:
{"command": "python {WORKDIR}/_script.py", "timeout": 30000}
# file_write: {WORKDIR}/_script.py
from docx import Document
doc = Document("{WORKDIR}/input.docx") # <-- replace with actual path
# Print all paragraphs
for i, para in enumerate(doc.paragraphs):
print(f"[{i}] ({para.style.name}) {para.text}")
# Print all tables
for t_idx, table in enumerate(doc.tables):
print(f"\n--- Table {t_idx} ---")
for row in table.rows:
print(" | ".join(cell.text for cell in row.cells))
# file_write: {WORKDIR}/_script.py
from docx import Document
doc = Document("{WORKDIR}/existing.docx") # <-- replace with actual path
doc.add_heading("新增章节", level=1)
doc.add_paragraph("这段内容是后来添加的。")
doc.save("{WORKDIR}/existing_updated.docx")
print("OK: {WORKDIR}/existing_updated.docx")
from docx import Document
from docx.shared import Cm
from docx.enum.section import WD_ORIENT
doc = Document()
section = doc.sections[0]
section.orientation = WD_ORIENT.LANDSCAPE # 横向
section.page_width, section.page_height = section.page_height, section.page_width
section.top_margin = Cm(2)
section.bottom_margin = Cm(2)
section.left_margin = Cm(2.5)
section.right_margin = Cm(2.5)
{WORKDIR}/xxx.docx. Use descriptive filenames, not just "output.docx".send_file to deliver it to the user.