一键导入
docx
Use this skill when you need to create, edit, or analyze Word documents (.docx), work with tracked changes and comments, or convert DOCX to other formats.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use this skill when you need to create, edit, or analyze Word documents (.docx), work with tracked changes and comments, or convert DOCX to other formats.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Notion CLI tool for managing pages, databases, and content. Use when working with Notion data, creating/updating pages, querying databases, or syncing content.
ISO/IEC/IEEE 15288に基づき、ヒアリング資料から要求ドキュメント(1〜7)を順次生成します。既存ドキュメントがあれば差分更新します。
agent-browser CLIを使ってローカルアプリのUIをテストする。
GitHub Issueを作成する前に、BDD形式で要件を整理します:
- 未コミットの変更やunpushの状態があれば、Skill ツールを使って `/ok` コマンドを先に呼び出してください
Clarify ambiguities in plans with structured questions
基于 SOC 职业分类
| name | docx |
| description | Use this skill when you need to create, edit, or analyze Word documents (.docx), work with tracked changes and comments, or convert DOCX to other formats. |
Word文書(.docx)の作成・編集・分析・変更履歴管理。
brew install pandoc
brew install --cask libreoffice
pip install python-docx defusedxml
pandoc input.docx -o output.md
pandoc input.docx -t plain -o output.txt
from docx import Document
from docx.shared import Pt, Inches
doc = Document()
# タイトル
doc.add_heading("Document Title", level=0)
# 段落
p = doc.add_paragraph("This is the first paragraph.")
# 箇条書き
doc.add_paragraph("Item 1", style="List Bullet")
doc.add_paragraph("Item 2", style="List Bullet")
# 表
table = doc.add_table(rows=3, cols=3)
table.style = "Light Grid Accent 1"
for i, row in enumerate(table.rows):
for j, cell in enumerate(row.cells):
cell.text = f"Row {i+1}, Col {j+1}"
# 画像
doc.add_picture("image.png", width=Inches(4))
doc.save("output.docx")
from docx import Document
doc = Document("input.docx")
# 全段落のテキスト
for para in doc.paragraphs:
print(para.text)
# 表の内容
for table in doc.tables:
for row in table.rows:
for cell in row.cells:
print(cell.text, end="\t")
print()
DOCXは実際にはZIPファイル:
# 解凍
unzip input.docx -d docx_contents
# コメント確認
cat docx_contents/word/comments.xml
# メタデータ
cat docx_contents/docProps/core.xml
Python経由:
import zipfile
from defusedxml import ElementTree as ET
with zipfile.ZipFile("input.docx") as zf:
# コメント
if "word/comments.xml" in zf.namelist():
comments_xml = zf.read("word/comments.xml")
tree = ET.fromstring(comments_xml)
# 名前空間を考慮して解析
for comment in tree.findall(".//{*}comment"):
print(comment.attrib, comment.text)
from docx import Document
doc = Document("input.docx")
doc.settings.track_revisions = True
doc.save("output.docx")
# 解凍してXMLを確認
unzip input.docx -d docx_contents
cat docx_contents/word/document.xml | grep -i "ins\|del"
python-docxは変更履歴の高度な操作をサポートしていないため、LibreOffice CLIを使用:
# すべての変更を承認
libreoffice --headless --convert-to docx --outdir . input.docx
from docx import Document
from docx.shared import Pt, RGBColor
from docx.enum.text import WD_PARAGRAPH_ALIGNMENT
doc = Document()
p = doc.add_paragraph("Custom Style Text")
# フォント設定
run = p.runs[0]
run.font.name = "Arial"
run.font.size = Pt(14)
run.font.bold = True
run.font.color.rgb = RGBColor(255, 0, 0)
# 段落設定
p.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER
doc.save("styled.docx")
from docx import Document
doc = Document()
section = doc.sections[0]
# ヘッダー
header = section.header
header_para = header.paragraphs[0]
header_para.text = "Document Header"
# フッター
footer = section.footer
footer_para = footer.paragraphs[0]
footer_para.text = "Page Footer"
doc.save("with_header_footer.docx")
libreoffice --headless --convert-to pdf input.docx --outdir .
# DOCX → PDF → JPEG
libreoffice --headless --convert-to pdf input.docx --outdir .
pdftoppm -jpeg -r 150 input.pdf output
# → output-1.jpg, output-2.jpg, ...
→ システムにフォントをインストール、run.font.nameに正確な名前を指定
→ table.autofit = Falseで自動調整を無効化
→ Word側で「変更履歴の記録」が有効か確認
→ --extract-media=./mediaオプションで画像を抽出