hwpx-editing
为处理韩文官方/学术文件提供专用且谨慎的编辑流程与验证脚本。
需运行外部打包/校验脚本并修改压缩/XML 内容,操作前请备份。
安全读取与编辑 HWPX(한글)文件的工具与流程,避免损坏文件。
用 Python + lxml 安全地读取与编辑 .hwpx(한글)文档,避免因随意解包/重打包或修改 ID 导致 한글 无法打开文件。只要任务牵涉 .hwpx、한글 文档或韩国产学术/政府文件就触发,用来改段落、表格、图片、公式或修版面。重点是遵循 repack 与验证流程,别用肉眼或手工重压缩,否则文件会被损坏。
▸ 展开 SKILL.md 英文原文
Safely read and edit HWPX (Hangul / 한글 .hwpx) word-processor files with Python + lxml without corrupting them. Use this whenever the task involves a .hwpx file, a 한글/Hangul document, HWPML, or Korean government/academic documents — including reading or extracting text/tables, editing paragraphs, tables, images, equations, footnotes/endnotes, or memos, fixing layout (orphaned headings, blank pages, columns), building a table of contents, or repackaging the zip. Trigger this even if the user only says "edit this 한글 file" or ".hwpx" and doesn't mention the internals, because naive edits (re-zipping, stale line caches, cloned ids) make 한글 refuse to open the file.
帮我安装这个 skill:https://raw.githubusercontent.com/kangdacool/hwpx-editing-skill/main/skills/hwpx-editing/SKILL.mdcurl -fsSL "https://raw.githubusercontent.com/kangdacool/hwpx-editing-skill/main/skills/hwpx-editing/SKILL.md"# HWPX Editing HWPX is a **zip of XML (HWPML)**. The traps that corrupt a file aren't obvious from the outside, so **read the relevant section of `references/hwpx-guide.md` before editing**, and **run the scripts in `scripts/` to repack and verify** — don't hand-roll the zip or eyeball correctness. > **HWPX only.** This handles `.hwpx` (zip + XML) exclusively. A legacy `.hwp` > (OLE binary, signature `D0CF11E0`) must first be converted in 한글 via > **다른 이름으로 저장 → HWPX(.hwpx)**. The scripts detect `.hwp` and say so. ## The one rule that matters most **Never re-zip an HWPX with a normal zip writer.** 한글 rejects a file whose unchanged entries were re-deflated. Use the raw-preserving repacker