Oma hwp

From gracefullight/krds · View interactive version

Oma hwp is an AI agent skill from the GitHub repository gracefullight/krds. Convert Hangul HWP, HWPX, or HWPML documents to Markdown with kordoc. Use for text, table, and image extraction from these formats.

How to use this skill

Skill file

HWP Skill - HWP / HWPX / HWPML to Markdown Conversion

Scheduling

Goal

Convert Korean HWP-family documents into readable Markdown or structured JSON while preserving document structure for LLM context, RAG, government-document review, or enterprise document processing.

Intent signature

When to use

When NOT to use

Expected inputs

Expected outputs

Dependencies

Control-flow features

Structural Flow

Entry

  1. Confirm the input path exists.
  2. Confirm the extension is .hwp, .hwpx, or .hwpml.
  3. Resolve output path or directory and default filename.
  4. Check that bun is available.

Scenes

  1. PREPARE: Validate path, extension, size, output target, and requested format.
  2. ACQUIRE: Detect source format and runtime availability.
  3. ACT: Run kordoc with explicit output target and requested options.
  4. VERIFY: Post-process Markdown and inspect structure for headings, tables, lists, images, and footnotes.
  5. FINALIZE: Report output path, source format, and any conversion limitations.

Transitions

Failure and recovery

| Failure | Recovery |

|---------|----------|

| bun or bunx unavailable | Ask user to install Bun |

| Unsupported or mismatched format | Check extension and magic bytes, then route or stop |

| Encrypted or DRM-locked document | Report limitation and request an accessible copy when needed |

| Empty Markdown output | Treat as possible scanned-image content and recommend OCR outside this skill |

| Complex merged tables | Accept flattened Markdown or HTML fallback as best effort |

| Stale kordoc cache | Use bunx kordoc@latest or configured pinned version |

| Cannot find module "turndown" from flatten-tables.ts | Run bun install in this skill's resources/ directory (its node_modules is gitignored and absent on fresh clones) |

Exit

Logical Operations

Actions

| Action | SSL primitive | Evidence |

|--------|---------------|----------|

| Validate file path and extension | VALIDATE | Input preflight in execution protocol |

| Check runtime availability | VALIDATE | bun --version |

| Select output target and format | SELECT | Output behavior and config |

| Run converter | CALL_TOOL | bunx kordoc@latest |

| Write output artifact | WRITE | Markdown or JSON output |

| Flatten tables and strip PUA glyphs | CALL_TOOL | resources/flatten-tables.ts |

| Inspect extraction quality | VALIDATE | Verification step |

| Report result | NOTIFY | Final user-facing summary |

Tools and instruments

Canonical command path

bunx kordoc@latest "{input_path}" -o "{output_path}"
# fresh clone: run `bun install` in {skill_dir}/resources/ first (node_modules is gitignored)
bun "{skill_dir}/resources/flatten-tables.ts" "{output_path}"
# {skill_dir} = this skill's directory: .agents/skills/oma-hwp (project mode) or ~/.agents/skills/oma-hwp (global mode)

For batch conversion, use an explicit output directory:

bunx kordoc@latest "{input_pattern}" -d "{output_dir}"

Resource scope

| Scope | Resource target |

|-------|-----------------|

| LOCAL_FS | Input HWP-family files and generated outputs |

| PROCESS | bunx kordoc and bun run subprocesses |

| MEMORY | Format decisions, validation notes, and final report |

Preconditions

Effects and side effects

Guardrails

  1. Always pass @latest or an explicit pinned version to avoid stale bunx cache.
  2. Always pass an explicit output target when the user expects a file.
  3. Do not add custom security defenses around kordoc's ZIP, XML, SSRF, or XSS defenses.
  4. Report missing tables, garbled text, empty output, encrypted segments, and best-effort DRM extraction.
  5. Keep full CLI details in resources/execution-protocol.md and troubleshooting branches in resources/troubleshooting.md.

Supported Formats

| Format | Extension | Notes |

|--------|-----------|-------|

| HWP 5.x binary | .hwp | Full support (incl. DRM-locked via kordoc's rhwp-algorithm port) |

| HWPX | .hwpx | Full support incl. nested tables, merged cells |

| HWPML | .hwp (XML variant) | Auto-detected by signature |

kordoc also parses PDF / XLSX / DOCX and offers document-authoring subcommands (generate, fill, seal, patch, redact, lint, validate, render). All of those are intentionally outside this skill's scope; see "When NOT to use". Conversion-quality flags (--dedupe-headers, --keep-empty-cols, --inline-images) and the chunks format are documented in resources/execution-protocol.md.

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.