docx
하는 일
이 스킬은 AI 에이전트가 Microsoft Word 파일을 다루도록 합니다. 워드 문서를 만들거나 바꾸거나 읽어야 하는 사람을 위한 스킬입니다.
사용하는 경우
- ✓제목, 표, 페이지 번호가 있는 새 워드 문서가 필요할 때.
- ✓docx 파일을 편집하거나 그 안의 내용을 추출해야 할 때.
- ✓워드 파일의 변경 내용 추적이나 댓글을 다뤄야 하는 경우.
스킬 링크
https://github.com/agentscope-ai/QwenPaw/blob/main/src/qwenpaw/agents/skills/docx-en/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 회의록을 목차가 있는 형식을 갖춘 워드 문서로 만들어 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 워드 파일을 XML 부분들의 묶음으로 읽고 직접 편집하거나, 문서 빌더로 새 파일을 만듭니다. 또한 이전 형식의 파일을 변환하고, 일반 도구로 텍스트나 PDF를 내보낼 수 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Important: All
scripts/paths are relative to this skill directory. Run with:cd {this_skill_dir} && python scripts/...Or use thecwdparameter ofexecute_shell_command.
DOCX creation, editing, and analysis
Prerequisites
- docx (
npm install -g docx): new document creation - LibreOffice (
soffice):.doc->.docxconversion, tracked-changes acceptance, and PDF export - pandoc: text extraction
- pdftoppm (poppler-utils): document-to-image workflows
- If
pdftoppmis unavailable, a Python fallback path may usepdf2image. - On Windows, dependencies must be installed and available in
PATH; if missing, report the dependency issue and stop (do not keep retrying).
Overview
A .docx file is a ZIP archive containing XML files.
Quick Reference
| Task | Approach |
|---|---|
| Read/analyze content | pandoc or unpack for raw XML |
| Create new document | Use docx-js - see Creating New Documents below |
| Edit existing document | Unpack → edit XML → repack - see Editing Existing Documents below |
Converting .doc to .docx
Legacy .doc files must be converted before editing:
python scripts/office/soffice.py --headless --convert-to docx document.doc
Reading Content
# Text extraction with tracked changes
pandoc --track-changes=all document.docx -o output.md
# Raw XML access
python scripts/office/unpack.py document.docx unpacked/
Converting to Images
python scripts/office/soffice.py --headless --convert-to pdf document.docx
pdftoppm -jpeg -r 150 document.pdf page
Accepting Tracked Changes
To produce a clean document with all tracked changes accepted (requires LibreOffice):
python scripts/accept_changes.py input.docx output.docx
Creating New Documents
Generate .docx files with JavaScript, then validate. Install: npm install -g docx
Setup
const { Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell, ImageRun,
Header, Footer, AlignmentType, PageOrientation, LevelFormat, ExternalHyperlink,
TableOfContents, HeadingLevel, BorderStyle, WidthType, ShadingType,
VerticalAlign, PageNumber, PageBreak } = require('docx');
const doc = new Document({ sections: [{ children: [/* content */] }] });
Packer.toBuffer(doc).then(buffer => fs.writeFileSync("doc.docx", buffer));
Validation
After creating the file, validate it. If validation fails, unpack, fix the XML, and repack.
python scripts/office/validate.py doc.docx
Page Size
// CRITICAL: docx-js defaults to A4, not US Letter
// Always set page size explicitly for consistent results
sections: [{
properties: {
page: {
size: {
width: 12240, // 8.5 inches in DXA
height: 15840 // 11 inches in DXA
},
margin: { top: 1440, right: 1440, bottom: 1440, left: 1440 } // 1 inch margins
}
},
children: [/* content */]
}]
Common page sizes (DXA units, 1440 DXA = 1 inch):
| Paper | Width | Height | Content Width (1" margins) |
|---|---|---|---|
| US Letter | 12,240 | 15,840 | 9,360 |
| A4 (default) | 11,906 | 16,838 | 9,026 |
Landscape orientation: docx-js swaps width/height internally, so pass portrait dimensions and let it handle the swap:
size: {
width: 12240, // Pass SHORT edge as width
height: 15840, // Pass LONG edge as height
orientation: PageOrientation.LANDSCAPE // docx-js swaps them in the XML
},
// Content width = 15840 - left margin - right margin (uses the long edge)
Styles (Override Built-in Headings)
Use Arial as the default font (universally supported). Keep titles black for readability.
const doc = new Document({
styles: {
default: { document: { run: { font: "Arial", size: 24 } } }, // 12pt default
paragraphStyles: [
// IMPORTANT: Use exact IDs to override built-in styles
{ id: "Heading1", name: "Heading 1", basedOn: "Normal", next: "Normal", quickFormat: true,
run: { size: 32, bold: true, font: "Arial" },
paragraph: { spacing: { before: 240, after: 240 }, outlineLevel: 0 } }, // outlineLevel required for TOC
{ id: "Heading2", name: "Heading 2", basedOn: "Normal", next: "Normal", quickFormat: true,
run: { size: 28, bold: true, font: "Arial" },
paragraph: { spacing: { before: 180, after: 180 }, outlineLevel: 1 } },
]
},
sections: [{
자주 묻는 질문
추가 소프트웨어가 필요한가요?
네. docx, LibreOffice, pandoc 같은 도구를 설치하고 시스템 경로에서 쓸 수 있어야 합니다.
옛날 .doc 파일도 다룰 수 있나요?
네. 이전 형식의 .doc 파일은 먼저 LibreOffice로 .docx로 변환됩니다.
PDF도 다루나요?
아닙니다. PDF 작업은 별도의 스킬이 처리합니다.
상세 정보
작성자의 원본 설명
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of \"Word doc\", \"word document\", \".docx\", or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a \"report\", \"memo
repo: agentscope-ai/QwenPaw
인기도
- GitHub 스타
- 37k
- 순위
- #7576
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
terraform-skill
37k에이전트가 모듈, CI/CD, 보안 검사, 상태 문제를 포함해 Terraform이나 OpenTofu 인프라 코드를 작성, 시험, 검토하도록 돕습니다.
computer_use
37k직접 쓸 수 있는 도구가 없을 때, 에이전트가 화면을 관찰하고 클릭하며 각 결과를 확인해 살아 있는 Windows 또는 macOS 앱을 조작하도록 돕습니다.
browser
37kQwenPaw Browser SDK로 에이전트가 실제 웹 브라우저를 조작해, 페이지를 읽고 행동하며 성공을 주장하기 전에 결과를 확인하도록 돕습니다.
channel_message
37k에이전트가 적절한 목적지를 찾은 뒤, 작업 완료 알림 같은 단방향 메시지를 특정 채팅 채널이나 세션에 보내도록 돕습니다.
비슷한 스킬
feishu-doc
394k에이전트가 문서 도구를 사용해 텍스트, 이미지, 표를 포함한 Feishu 클라우드 문서를 읽고, 만들고, 편집하도록 돕습니다.
feishu-drive
394k에이전트가 봇과 공유된 Feishu 클라우드 폴더의 파일을 찾아보고, 정리하고, 댓글을 달도록 돕습니다.
feishu-perm
394k에이전트가 요청을 충족하는 가장 작은 권한을 골라, Feishu 파일에 누가 접근할 수 있는지 확인하고 바꾸도록 돕습니다.