docx
하는 일
이 스킬은 Microsoft Word 파일을 다룹니다. 구조를 읽는 것부터 편집하고 새로 만드는 것까지 포함합니다. 스타일을 유지하면서 Word 문서를 바꾸거나 새로 만들어야 하는 사람을 위한 스킬입니다.
사용하는 경우
- ✓Word 파일의 텍스트나 구조를 뽑아내야 할 때.
- ✓스타일과 레이아웃을 유지하면서 Word 문서를 편집해야 할 때.
- ✓요청서를 바탕으로 새 Word 문서를 만들고 싶을 때.
스킬 링크
https://github.com/TokenRhythm/opensquilla/blob/main/src/opensquilla/skills/bundled/docx/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 Word 계약서의 가격을 업데이트해 주세요. 서식은 그대로 유지해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 먼저 파일의 구조를 살펴 내부에 무엇이 있는지 확인한 다음, 스타일과 레이아웃이 그대로 남도록 내용을 제자리에서 편집합니다. 새 문서라면 요청 내용을 바탕으로 파일을 만듭니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
docx
Work with Microsoft Word .docx files. The format is OOXML — a zip container
holding XML parts (word/document.xml, styles.xml, numbering.xml, headers,
footers, relationships). Treat structure as primary; rendered text is a view.
Decide the path first
Pick one path up front. The right path depends only on what is on disk before you start.
| You have | Goal | Path |
|---|---|---|
Existing .docx |
Read text/structure | A. Inspect |
Existing .docx |
Modify content while keeping styles | B. Edit-in-place |
| Nothing or a brief | Build a new doc | C. Create from scratch |
If the user hands you a doc and asks for changes, default to path B and treat the input as the visual style baseline. Only choose path C when the user says "start fresh" or there is no input.
Path A: Inspect
Dump structure as JSON for inspection without mutating anything.
python {baseDir}/scripts/inspect_docx.py /path/to/doc.docx
Output schema:
{
"paragraphs": [{"index": 0, "text": "...", "style": "Heading 1"}, ...],
"tables": [[["row0,col0", "row0,col1"], ...], ...],
"sections": 1,
"has_tracked_changes": false
}
Use this whenever you need to see what is in the doc before deciding how to edit. The output is stable and machine-readable — diff two inspect outputs to verify a round-trip preserved everything you intended.
Path B: Edit in place
Two sub-strategies; pick by how invasive the edit is.
B1. Run-level text replacement (preferred)
When the change is "swap this string" or "fill these placeholders": mutate runs in place. This preserves all theme/style/font settings.
python {baseDir}/scripts/edit_docx.py input.docx ops.json --out output.docx
ops.json is a list of operations:
[
{"op": "replace_run", "para": 0, "run": 0, "text": "Q3 Review"},
{"op": "replace_text", "find": "{{CLIENT}}", "with": "Acme Corp"}
]
Edit at the run level, not the paragraph level — replacing whole paragraph text drops formatting. If a placeholder spans multiple runs (often happens when the original template applied bold/italic mid-word), the helper script collapses runs into the first one and clears the rest.
B2. Structural edits (sections / page layout / numbering)
python-docx exposes paragraphs, tables, and runs but has limited support for
page layout, numbering definitions, and tracked changes. For those, unzip the
.docx, patch word/document.xml and adjacent parts, and repack:
mkdir _unpacked && (cd _unpacked && unzip -q ../input.docx)
# edit _unpacked/word/document.xml
(cd _unpacked && zip -q -r ../output.docx . -x "*.DS_Store")
Rules when patching XML:
- Use
defusedxml.ElementTreeorlxml, not stdlibxml.etree.ElementTree. ET drops or rewrites namespace prefixes (w:,r:) in ways Word refuses to load. - Preserve
xml:space="preserve"on<w:t>elements that hold leading or trailing whitespace. [Content_Types].xmlmust list every part type. Removing a header without also removing its override entry yields a "repair" prompt in Word.- Numbering definitions live in
numbering.xml; bullet/number changes must patch the numbering ID, not just the visible text.
When done, validate by opening in LibreOffice headless before declaring success — silent failures are common.
Path C: Create from scratch
For a simple Markdown source, run the export script with the Markdown on stdin:
python {baseDir}/scripts/export_markdown_docx.py --out out.docx < draft.md
For structured content, use a JSON specification:
python {baseDir}/scripts/create_docx.py spec.json --out out.docx
spec.json describes content declaratively:
{
"metadata": {"title": "Q3 Review", "author": "Wei E."},
"body": [
{"kind": "heading", "level": 1, "text": "Q3 Review"},
{"kind": "paragraph", "text": "Revenue +18% YoY."},
{"kind": "table", "rows": [["Metric", "Value"], ["Revenue", "$2.1M"]]}
]
}
For programmatic use call python-docx directly:
from docx import Document
doc = Document()
doc.add_heading("Q3 Review", level=1)
doc.add_paragraph("Revenue +18% YoY.")
table = doc.add_table(rows=2, cols=2)
table.rows[0].cells[0].text = "Metric"
doc.save("out.docx")
See references/python_docx.md for paragraphs, styles, numbering, tables, headers/footers, and section breaks.
Tracked changes
Tracked changes are stored in `word/document
자주 묻는 질문
서식이 유지되나요?
네. 편집할 때 이 스킬은 기존 파일을 스타일 기준으로 삼고 그대로 유지합니다.
변경 내용 추적도 처리하나요?
네. 이 스킬은 Word 파일의 변경 내용 추적을 검토하는 것도 다룹니다.
새 파일을 원하면 어떻게 하나요?
처음부터 다시 시작하라고 하거나 입력 파일이 없으면, 이 스킬은 새 문서를 만듭니다.
상세 정보
작성자의 원본 설명
Read, inspect, edit, or create Microsoft Word `.docx` documents, including structured text extraction, style-preserving edits, tracked-change review, and generation from a brief.
repo: TokenRhythm/opensquilla
인기도
- GitHub 스타
- 7.1k
- 순위
- #13588
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
browser-use
7.1k에이전트가 OpenSquilla Desktop의 사이드바 브라우저에서 웹 페이지를 열고 읽고 조작하도록 돕습니다. 양식 입력과 화면 확인도 포함합니다.
deep-research
7.1k에이전트가 저장된 계획, 추적되는 출처, 인용이 달린 긴 보고서를 갖춘 다단계 조사를 하도록 가르칩니다.
html-coder
7.1k에이전트가 접근성 있는 양식과 미디어를 갖춘 깔끔한 HTML 페이지를 쓰고 웹 미리보기로 열도록 돕습니다.
pdf-toolkit
7.1k에이전트가 PDF에서 텍스트와 표를 뽑고, 합치거나 나누고, 양식 필드를 채우고, 데이터로 새 PDF를 만들도록 돕습니다.
비슷한 스킬
feishu-doc
394k에이전트가 문서 도구를 사용해 텍스트, 이미지, 표를 포함한 Feishu 클라우드 문서를 읽고, 만들고, 편집하도록 돕습니다.
feishu-drive
394k에이전트가 봇과 공유된 Feishu 클라우드 폴더의 파일을 찾아보고, 정리하고, 댓글을 달도록 돕습니다.
feishu-perm
394k에이전트가 요청을 충족하는 가장 작은 권한을 골라, Feishu 파일에 누가 접근할 수 있는지 확인하고 바꾸도록 돕습니다.