Community코딩 & 개발github.com

docx

Word 문서(.docx/.dotx)를 생성, 읽기, 편집 및 조작합니다. 보고서, 메모, 편지, 서식이 있는 문서 작업 시 사용합니다.

docx란 무엇인가요?

이 스킬은 Word 문서(.docx) 및 템플릿(.dotx) 파일의 전체 라이프사이클을 다룹니다. 새 문서 생성에는 미리 설치된 `docx` npm 패키지를 사용하며, 기존 문서 편집은 ZIP 해제 → XML 직접 편집 → 재압축 방식을 사용합니다. 내용 읽기에는 `pandoc`을 활용하여 마크다운으로 변환합니다. 템플릿 기반 문서, 서식 있는 보고서, 메모, 편지 작성 등에 적합합니다. 주요 주의사항으로는 페이지 크기 기본값이 A4이므로 US Letter 사용 시 명시적 설정이 필요하며, 표, 목록, 이미지, 페이지 나누기 등 다양한 요소를 올바르게 처리하기 위한 상세한 가이드라인을 제공합니다. 또한 편집 기존 문서에서 변경 내용 추적(redlining), 주석 추가, 출력 검증을 위한 PDF 변환 및 이미지 확인 프로세스를 지원합니다. XML 수준의 직접 조작이 필요하므로 `merge_runs.py` 스크립트로 조각난 텍스트 실행을 병합하여 검색 가능하게 만드는 등의 고급 기능을 제공합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/anthropics/skills/tree/main/skills/docx

Installed? Explore more 코딩 & 개발 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

DOCX 생성, 편집 및 분석

.docx 파일은 XML 파일들의 ZIP 아카이브입니다. 작업에 따라 적합한 방식을 선택하세요:

작업방식
새 문서 생성docx (npm) 스크립트 작성 — 아래 주의사항 참고
기존 문서 편집unzip → word/document.xml 편집 → zip (docx-js는 기존 파일을 열 수 없음)
내용 읽기pandoc -t markdown file.docx

아래 스크립트 경로는 이 스킬의 디렉터리를 기준으로 합니다.

docx-js로 생성하기 — 주의사항

docx는 미리 설치되어 있습니다. npm install을 실행하지 말고 스크립트를 작성하여 require('docx')를 직접 사용하세요. require가 실패하는 경우에만 npm install docx를 실행하세요. 모델은 API를 알고 있습니다. 다음은 주의해야 할 함정들입니다:

  • 페이지 크기 기본값은 A4입니다. US Letter를 사용하려면 page: { size: { width: 12240, height: 15840 } }로 설정하세요 (DXA 단위; 1440 = 1인치).
  • 가로 방향: 세로 방향 치수와 orientation: PageOrientation.LANDSCAPE를 전달하세요. docx-js가 내부적으로 너비/높이를 바꿉니다.
  • 표에는 이중 너비 설정이 필요합니다. 표에 columnWidths를 설정하고 모든 셀에 width를 설정하세요. 둘 다 WidthType.DXA를 사용해야 합니다 (PERCENTAGE는 Google Docs에서 깨집니다). 열 너비의 합은 표 너비와 같아야 합니다.
  • 표 음영: ShadingType.CLEAR를 사용하고 SOLID는 절대 사용하지 마세요 (검정색으로 렌더링됨).
  • 목록: •를 문자 그대로 삽입하지 말고 LevelFormat.BULLET을 사용한 numbering 구성을 사용하세요.
  • ImageRun에는 type:이 필요합니다 ("png", "jpg", ...).
  • PageBreak는 Paragraph 내부에 있어야 합니다.
  • \n을 절대 사용하지 마세요 — 별도의 Paragraph 요소를 사용하세요.
  • 목차(TOC): 제목은 내장 HeadingLevel.*을 사용해야 합니다. 사용자 지정 제목 스타일은 outlineLevel을 설정해야 목차에 나타납니다.
  • 가로선으로 표를 사용하지 마세요 — 대신 단락 아래쪽 테두리를 사용하세요.
  • 점선 안내선 / 같은 줄 오른쪽 정렬: TextRun 내부에 PositionalTab (alignment: PositionalTabAlignment.RIGHT, leader: PositionalTabLeader.DOT)을 사용하고, 문자 그대로 .이나 공백 패딩을 사용하지 마세요.

출력 확인

.docx를 작성한 후 렌더링하여 확인하세요:

python scripts/office/soffice.py --headless --convert-to pdf output.docx
pdftoppm -jpeg -r 100 output.pdf page
ls page-*.jpg   # 그런 다음 이미지를 읽으세요

pdftoppm은 페이지 번호를 페이지 수의 너비에 맞춰 0으로 채웁니다 (page-01.jpg…page-12.jpg).

기존 문서 편집

레거시 .doc 파일은 먼저 변환해야 합니다: python scripts/office/soffice.py --headless --convert-to docx file.doc.

unzip -q doc.docx -d unpacked/
find unpacked -type l -delete   # 심볼릭 링크 항목 제거 — 외부에서 가져온 docx는 신뢰할 수 없음
python scripts/merge_runs.py unpacked/   # 조각난 실행을 병합하여 텍스트를 검색 가능하게 만듦
# unpacked/word/document.xml을 그 자리에서 편집 — 재포맷하거나 예쁘게 출력하지 마세요
(cd unpacked && rm -f ../out.docx && zip -Xr ../out.docx .)
python scripts/office/validate.py out.docx --original doc.docx   # XSD 검사; --auto-repair로 일반적인 문제 수정
# 변경 내용 추적 중인가요? --author "<변경 내용을 추적한 이름>"을 추가하여 모든 편집이 추적되는지 확인하세요

Word는 텍스트를 여러 <w:r> 실행(수정 ID, 맞춤법 검사 표시)으로 나누므로 문서에서 보이는 구문이 XML에서 연속된 문자열로 존재하지 않는 경우가 많습니다. merge_runs.py는 word/document.xml에서 인접하고 동일하게 서식이 지정된 실행을 내용이나 렌더링을 변경하지 않고 병합합니다. 또한 .docx 파일을 직접 받을 수도 있습니다 (python scripts/merge_runs.py doc.docx -o merged.docx).

변경 내용 추적: 변경 내용을 추적할 때 --author "<변경 내용을 추적한 이름>" ( --original 필요) 으로 검증하세요. 이 옵션은 <w:ins>/<w:del>로 감싸지 않고 변경한 텍스트를 보고합니다. 이러한 변경은 실수로 쉽게 발생할 수 있으며 수락된 보기에서는 보이지 않습니다. 실행을 <w:ins>/<w:del>로 감싸고 w:id, w:author, w:date 속성을 포함하세요. <w:del> 내부의 텍스트 요소는 <w:delText>이며 <w:t>가 아닙니다. 삭제된 단락 표시(<w:pPr><w:rPr><w:del w:id=".." w:author=".." w:date=".."/></w:rPr></w:pPr>)는 "이 단락을 다음 단락에 병합"을 의미합니다. 따라서 단락을 완전히 삭제하려면 이 작업과 모든 실행 주위에 <w:del>을 추가하면 됩니다. <w:del/>은 rPr의 다른 자식보다 먼저 와야 합니다. 순서는 스키마에 의해 강제됩니다.

모든 변경 내용을 수락한 깨끗한 복사본을 생성하려면: python scripts/accept_changes.py in.docx out.docx.

삭제된 단락 표시를 수락하면 해당 단락이 아래 단락에 병합되어야 하므로 모든 실행이 삭제된 단락은 사라집니다. Word는 이렇게 합니다. accept_changes.py와 pandoc --track-changes=accept는 항상 그렇지는 않습니다. 둘 다 같은 방식으로 실패합니다. 삭제된 텍스트를 제거하지만 빈 단락을 남겨둡니다. 이는 자동 번호가 매겨진 경우 잘못된 빈 글머리 기호로 읽힙니다:

  • pandoc --track-changes=accept는 단락을 병합하지 않습니다.
  • accept_changes.py (LibreOffice)는 삭제된 단락 뒤에 빈 공백 단락이 오는 경우를 제외하고 올바르게 병합합니다.

어느 보기에서든 빈 글머리 기호는 해당 보기의 인공물일 뿐 문서 자체의 결함이 아닙니다. XML에서 단락 삭제를 확인하세요.

주석

주석에는 6개의 상호 연결된 파일이 필요합니다. 헬퍼를 사용하세요. document.xml도 편집할 때는 디렉터리 모드(unzip/rezip 주기 절약), 그렇지 않으면 .docx 직접 모드를 사용하세요:

# 이미 압축이 풀린 디렉터리 대상 (표식을 배치할 때 선호)
python scripts/comment.py unpacked/ "수수료 및 비용 상한선이 너무 낮습니다"
python scripts/comment.py unpacked/ "동의함" --parent 0

# .docx 파일 직접 대상
python scripts/comment.py contract.docx "이 상한선이 너무 낮습니다" -o annotated.docx

스크립트는 comments.xml, commentsExtended.xml, commentsIds.xml, commentsExtensible.xml, 관계 파일, 콘텐츠 형식 재정의를 작성합니다. 주석 ID는 자동으로 할당됩니다. 그런 다음 word/document.xml에 추가할 <w:commentRangeStart>/<w:commentRangeEnd>/<w:commentReference> 스니펫을 출력하여 주석이 특정 텍스트에 고정되도록 합니다. 해당 표식을 배치할 때까지 주석은 존재하지만 표시되지 않습니다.

종속성

docx (npm, 미리 설치됨 — require('docx')가 실패하는 경우에만 설치) · pandoc · LibreOffice (soffice) · pdftoppm (Poppler)

Individual skills in this repo

This repo contains 19 individual skills — each has its own dedicated page.

academy-guide

Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content.

algorithmic-art

Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists

anthropics/template-skill

Replace with description of the skill and when Claude should use it.

brand-guidelines

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

canvas-design

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists

claude-api

|-

discernment-nudge

After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals, or emails, estimates or projections, analysis or interpretation of data, factual claims they may rely on, or a multi-step argument — invoke this skill BEFORE finalizing your reply and then, if it applies, append 2-3 short follow-up questions, each tied to something specific in what you just produced, that help the user check key facts, probe the reasoning or assumptions, and notice missing context. Do this at most once per conversation. Skip it when the user asked a trivial how-to or simple lookup, wants a purely educational explanation, asked you only to format, convert, or assemble a file from content they provided, is writing code they will run, is doing creative writing or casual chat, or already asked you to double-check, cite, or review — the skill file explains these boundaries and the exact output format.

doc-coauthoring

Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.

frontend-design

Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.

internal-comms

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

mcp-builder

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

pdf

Use 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 PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.

pptx

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 presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.

skill-creator

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill

slack-gif-creator

Knowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like

theme-factory

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

web-artifacts-builder

Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.

xlsx

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 .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.

관련 스킬