docx
БесплатноБез исполняемых скриптовНе проверенCreate and edit Word documents (.docx): headings, styled paragraphs, tables, images, headers/footers, and page formatting. Use whenever the user asks to…
от phuetz★ 53 звезды на GitHubОб этом скилле
Create & edit Word documents with python-docx
Build real .docx files with the open-source python-docx library
(python3 -c "import docx"). Work in visible steps; verify before reporting done.
Workflow
- Outline the document: title, sections (headings), body, tables, images.
- Write a Python script (heredoc via the
bashtool) that assembles the document with python-docx and saves it. - Verify: reopen with
Document(path)and assert key paragraphs/headings exist;print(path). - Report the saved path + a one-line summary.
Quality conventions
- Use real heading styles (
doc.add_heading('Title', level=0),level=1/2) so the document has a proper outline — not just bold text. - Tables:
doc.add_table(rows, cols, style='Light Grid Accent 1'); bold the header row. - Embed images with
doc.add_picture(path, width=Inches(5)); add a caption paragraph. - Set page size/margins via
doc.sections[0]when the user specifies them. - Keep styling consistent; when editing an existing file, match its conventions.
Example
python3 - <<'PY'
from docx import Document
from docx.shared import Pt, Inches
doc = Document()
doc.add_heading('Q2 Robotics Budget', level=0)
doc.add_heading('Overview', level=1)
doc.add_paragraph('Funding target: 120k EUR — status: on track.')
doc.add_heading('Line items', level=1)
t = doc.add_table(rows=1, cols=3); t.style = 'Light Grid Accent 1'
hdr = t.rows[0].cells
for i, h in enumerate(['Item', 'Cost', 'Status']):
hdr[i].text = h; hdr[i].paragraphs[0].runs[0].font.bold = True
for item, cost, status in [('Actuators', '8000', 'ordered'), ('Compute', '3500', 'done')]:
c = t.add_row().cells; c[0].text = item; c[1].text = cost; c[2].text = status
doc.save('report.docx')
assert Document('report.docx').paragraphs[0].text == 'Q2 Robotics Budget'
print('report.docx')
PY
Reading / editing existing files
- Read text: iterate
Document(path).paragraphs/.tables, orpython3 -m markitdown file.docxif available. - Edit in place: load, modify runs/paragraphs/tables,
save()back; preserve tracked changes and comments where present.
Установить docx в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл docx?
Create and edit Word documents (.docx): headings, styled paragraphs, tables, images, headers/footers, and page formatting. Use whenever the user asks to write, format, or modify a Word/.docx document.
Как установить скилл docx?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл docx запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic