
Rhwp Edit
Programmatically edit Korean Hangul (.hwp) documents from your coding agent when GUI copy-paste or manual table edits would break formatting.
Overview
rhwp-edit is an agent skill for the Build phase that edits Korean .hwp documents via the k-skill-rhwp CLI (insert, delete, replace-all, tables, and cell text) with round-trip-safe output to a new file.
Install
npx skills add https://github.com/nomadamas/k-skill --skill rhwp-editWhat is this skill?
- Round-trip edits via k-skill-rhwp CLI on @rhwp/core (Rust + WASM), always saving to a new .hwp file
- Subcommands: insertText, deleteText, replaceAll, createTable, and setCellText for body and table content
- Preserves existing formatting while replacing text or restructuring tables—avoid retyping in Hangul Word Processor
- Creates blank HWP files and performs bulk find-replace (e.g. year roll-forward) without opening the desktop app
- Explicit handoff: use hwp for Markdown/JSON extraction and rhwp-advanced for layout/IR debugging—not this skill
- 5 editing subcommands: insertText, deleteText, replaceAll, createTable, setCellText
- Requires Node.js 18+
- rhwp v0.7.3 upstream blocks HWPX save (#196)—output is HWP 5.x binary only
Adoption & trust: 1.3k installs on skills.sh; 5.4k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need to change HWP body text or tables programmatically without breaking 서식 or re-opening Hangul Word Processor for every small edit.
Who is it for?
Solo builders automating Korean government, legal, or corporate HWP templates where CLI edits must preserve formatting and avoid GUI automation.
Skip if: HWP→Markdown/JSON conversion (use hwp), HWPX round-trip output (upstream blocked—use kordoc markdownToHwpx), page/SVG layout debugging (rhwp-advanced), or Hancom Office GUI/security-module automation.
When should I use this skill?
User asks to add/delete HWP body text, replace-all with formatting preserved, insert or edit tables/cells, or create a blank .hwp file.
What do I get? / Deliverables
You get an updated .hwp saved as a new file with the requested text and table changes applied; for extraction or layout debugging, switch to the hwp or rhwp-advanced skills respectively.
- New .hwp file with applied text and table edits
- CLI command log the agent can replay for the same edit pattern
Recommended Skills
Journey fit
Document production and automation for HWP binaries fits the Build phase where solo builders wire agent tooling around deliverables they still ship as office files. The skill is editor-side document manipulation (text, tables, cells), not app UI or infra—canonical shelf is docs under build.
How it compares
Binary HWP editor via WASM CLI—not the hwp conversion skill and not an MCP server for office automation.
Common Questions / FAQ
Who is rhwp-edit for?
Indie and solo developers using AI coding agents who work with Korean .hwp files and need reliable programmatic edits instead of manual Hangul Word Processor steps.
When should I use rhwp-edit?
Use it during Build/docs work when you must insert or delete HWP text, replace-all while keeping formatting, create tables, set cell text, or create a blank HWP—especially when the user phrases the task in Korean office-file terms.
Is rhwp-edit safe to install?
It runs a local Node CLI over WASM that reads and writes document files on disk; review the Security Audits panel on this Prism page and inspect nomadamas/k-skill before granting filesystem access in untrusted repos.
Workflow Chain
Then invoke: hwp, rhwp advanced
SKILL.md
READMESKILL.md - Rhwp Edit
# rhwp-edit ## What this skill does `k-skill-rhwp` CLI로 `.hwp` 문서의 **본문 텍스트**, **표 구조**, **셀 내용**을 round-trip 안전하게 수정한다. CLI는 `@rhwp/core`(Rust + WebAssembly) 위에 얇은 Node 래퍼를 씌워 `insertText`, `deleteText`, `replaceAll`, `createTable`, `setCellText` 같은 편집 동작을 서브커맨드로 노출한다. 결과는 항상 새 파일로 저장한다. 이 스킬은 **편집 전용**이다. 문서를 Markdown/JSON으로 변환하거나 필드만 추출하려면 [`hwp`](../hwp/SKILL.md) 스킬을 사용한다. 페이지 렌더링 디버깅이나 IR 비교가 필요하면 [`rhwp-advanced`](../rhwp-advanced/SKILL.md) 스킬을 사용한다. ## When to use - "HWP 본문에 한 줄 추가해줘" - "서식은 유지한 채로 2025를 2026으로 일괄 치환해줘" - "3행 4열짜리 표를 HWP에 넣어줘" - "표의 특정 셀 내용을 바꿔줘" - "빈 HWP 새 파일을 만들어줘" ## When not to use - **HWP → Markdown / JSON 변환** → `hwp` 스킬(kordoc)을 쓴다. rhwp-edit은 바이너리 편집 전용이다. - **HWPX 원본을 다시 HWPX로 저장** → rhwp v0.7.3 기준 업스트림이 `#196`으로 HWPX 저장 경로를 막아둔 상태다. HWPX를 입력으로 주면 내부적으로 HWP IR로 올라온 뒤 **HWP 5.x 바이너리로만** 저장된다. HWPX 출력이 꼭 필요하면 kordoc `markdownToHwpx`를 쓴다. - **레이아웃(페이지네이션·SVG 렌더) 디버깅** → `rhwp-advanced` 스킬로 업스트림 `rhwp` CLI(`export-svg --debug-overlay`, `dump-pages`, `ir-diff`)를 사용한다. - **배포용(읽기전용) 잠금 해제 · IR 구조 덤프 · 썸네일 추출 등 고급 검사 명령** → `rhwp-advanced` 스킬 참조. - **한컴 오피스 GUI 자동화, 보안모듈 통과, Windows 전용 서식** → 범위 밖이다. `rhwp`는 파일 포맷 엔진이지 GUI 제어가 아니다. ## Prerequisites - Node.js 18+ - 쓰기 권한이 있는 출력 경로 - `k-skill-rhwp` 설치(셋 중 하나): - 일회성: `npx --yes k-skill-rhwp --help` - 전역: `npm install -g k-skill-rhwp` - 로컬: `npm install k-skill-rhwp` - `k-skill-rhwp`는 `@rhwp/core@^0.7.3`을 peer 없이 dependency로 끌어온다. 별도 설치 불필요. - Rust/Cargo toolchain 불필요. 업스트림 `rhwp` CLI를 같이 쓰고 싶으면 `rhwp-advanced` 스킬로. ## Inputs - 입력 HWP / HWPX 경로 (절대 또는 상대) - 출력 HWP 경로 (항상 별도 파일. 원본을 덮어쓰지 않는다.) - 편집 좌표: `--section N --paragraph N --offset N` - 표 좌표: `--section N --parent-paragraph N --control N --cell N [--cell-paragraph N]` - 텍스트/쿼리: `--text "..."`, `--query "..."`, `--replacement "..."` - `create-table`: `--rows N --cols N` - 선택 플래그: `--case-sensitive`, `--no-replace` (`set-cell-text` 에서 기존 셀 내용 보존), `--format svg|html` (`render`) ## Routing policy | 작업 | 기본 경로 | | --- | --- | | 본문 문단에 텍스트 삽입 | `k-skill-rhwp insert-text` | | 본문 문단에서 텍스트 삭제 | `k-skill-rhwp delete-text` | | 단순 전체 치환(같은 서식 유지, **본문 문단만**) | `k-skill-rhwp replace-all --query ... --replacement ...` | | 치환 대상 위치 사전 조회(**본문 문단만**) | `k-skill-rhwp search --query ... --from-section N --from-paragraph N` | | 표 셀 안의 텍스트 확인 | `k-skill-rhwp list-paragraphs` + 셀 좌표 확인 후 `k-skill-rhwp set-cell-text` 로 직접 쓰기 | | 빈 표 삽입 | `k-skill-rhwp create-table --rows N --cols N` | | 표 셀 내용 교체/채우기 | `k-skill-rhwp set-cell-text --control N --cell N --text "..."` | | 빈 HWP 생성 | `k-skill-rhwp create-blank <output.hwp>` | | 구조 파악(섹션/문단 수·길이) | `k-skill-rhwp info <file>` / `list-paragraphs` | | 페이지 SVG/HTML 미리보기 | `k-skill-rhwp render <file> --page N --format svg` | 모든 편집 서브커맨드는 결과를 JSON 한 줄(CLI에서는 pretty-print)로 돌려준다. `ok: true`, 새 커서 위치(`charOffset`, `paraIdx`, `controlIdx`), 저장된 바이트 수(`bytesWritten`), 출력 경로(`outputPath`) 를 포함한다. ## Workflow 1. **입력 점검**: `k-skill-rhwp info <input>` 로 `sourceFormat`(hwp/hwpx), `sectionCount`, 섹션별 `paragraphCount`, 문단별 `length` 를 먼저 확인한다. 편집 좌표는 이 결과에서 뽑는다. 2. **검색이 필요한 경우**: `k-skill-rhwp search <input> --query "2025"` 로 섹션/문단/문자 오프셋을 먼저 얻고, 편집 명령에 그대로 넣는다. 3. **편집**: 아래 예시 중 해당하는 서브커맨드 하나로 실행한다. `--output` 은 항상 원본과 다른 경로를 지정한다. ```bash # 빈 문서 만들기 npx k-skill-rhwp create-blank ./out/blank.hwp # 본문 첫 문단 앞에 제목 삽입 npx k-skill-rhwp insert-text ./in.hwp ./out/with-title.hwp \ --section 0 --paragraph 0 --offset 0 \ --text "2026년 오픈소스 AI·SW 지원사업 신청서" # 2025 → 2026 일괄 치환 npx k-skill-rhwp replace-all ./in.hwp ./out/2026.hwp \ --query 2025 --replacement 2026 # 3행 4열 표 삽입(본문 2번째 문단 끝) npx k-skill-rhwp create-table ./in.hwp ./out/with-table.hwp \