Skip to content

DoHyun468/claw-hwp / plugins/claw-hwp/skills/hwp

FileKindSize
SKILL.mdskill md101.9 KB
references/README.mdmarkdown834 B
references/equation-syntax.mdmarkdown5.9 KB
references/hwp-internals.mdmarkdown4.9 KB
references/hwp-object-placement.mdmarkdown5.8 KB
references/hwpx-edit-ops.mdmarkdown52.8 KB
references/hwpx-format.mdmarkdown14.8 KB
references/hwpx-object-placement.mdmarkdown7.1 KB
references/hwpx-style-spacing.mdmarkdown10.7 KB
references/rhwp-api.mdmarkdown15.8 KB
scripts/README.mdmarkdown2.4 KB
scripts/cell-inspect.jsscript4.9 KB
scripts/cell-patch.jsscript525.8 KB
scripts/create.jsexecutablebinary235.8 KB
scripts/extract_text.jsexecutablescript12.0 KB
scripts/hwpx-edit.jsscript292.7 KB
scripts/launcher/preview-linux.shexecutablescript2.0 KB
scripts/launcher/preview-mac.commandexecutablescript1.9 KB
scripts/launcher/preview-windows.batscript2.1 KB
scripts/make_seal.pyscript3.4 KB
scripts/pack.pyexecutablescript8.0 KB
scripts/package-lock.jsonmanifest2.0 KB
scripts/package.jsonmanifest298 B
scripts/preview-server.jsscript5.3 KB
scripts/preview-viewer.htmlother11.5 KB
scripts/preview-viewer.jsscript17.2 KB
scripts/references/chart-templates/chart-0.jsonconfig6.4 KB
scripts/references/chart-templates/chart-1.jsonconfig6.4 KB
scripts/references/chart-templates/chart-10.jsonconfig6.3 KB
scripts/references/chart-templates/chart-11.jsonconfig6.3 KB
scripts/references/chart-templates/chart-12.jsonconfig6.5 KB
scripts/references/chart-templates/chart-13.jsonconfig6.5 KB
scripts/references/chart-templates/chart-14.jsonconfig6.5 KB
scripts/references/chart-templates/chart-15.jsonconfig6.5 KB
scripts/references/chart-templates/chart-16.jsonconfig5.9 KB
scripts/references/chart-templates/chart-17.jsonconfig5.9 KB
scripts/references/chart-templates/chart-18.jsonconfig6.3 KB
scripts/references/chart-templates/chart-19.jsonconfig6.3 KB
scripts/references/chart-templates/chart-2.jsonconfig6.4 KB
scripts/references/chart-templates/chart-3.jsonconfig6.4 KB
scripts/references/chart-templates/chart-4.jsonconfig6.4 KB
scripts/references/chart-templates/chart-5.jsonconfig6.3 KB
scripts/references/chart-templates/chart-6.jsonconfig5.9 KB
scripts/references/chart-templates/chart-7.jsonconfig5.9 KB
scripts/references/chart-templates/chart-8.jsonconfig5.9 KB
scripts/references/chart-templates/chart-9.jsonconfig6.3 KB
scripts/secure-fill.mjsscript38.0 KB
scripts/templates/hancom_native_stub.hwpxbinary128.0 KB
scripts/unpack.pyexecutablescript2.5 KB
scripts/validate.pyexecutablescript3.7 KB
themes/arctic-frost.mdmarkdown777 B
themes/botanical-garden.mdmarkdown751 B
themes/desert-rose.mdmarkdown748 B
themes/forest-canopy.mdmarkdown755 B
themes/golden-hour.mdmarkdown778 B
themes/midnight-galaxy.mdmarkdown766 B
themes/modern-minimalist.mdmarkdown766 B
themes/ocean-depths.mdmarkdown758 B
themes/sunset-boulevard.mdmarkdown811 B
themes/tech-innovation.mdmarkdown729 B

references/hwp-internals.md

View on GitHub
# `.hwp` raw-patch internals (developer reference)

> Byte/record-level mechanics behind the `.hwp` in-place ops (`create.js` →
> `cell-patch.js`). **Not needed to USE the ops** — `SKILL.md` documents the
> agent-facing behaviour and constraints. This file is for developers debugging or
> extending the raw-patch path. Moved out of SKILL.md (2026-06-25) to keep the
> agent-facing skill free of internal byte detail.

## Prop-name aliases (apply_text_style / apply_paragraph_style)

The ops accept friendly names and map them to the serializer's internal prop names:
`color` → `textColor`, `size` (pt) → `fontSize` (HWP units), `highlight` → `shadeColor`,
`font_family` → `fontFamilies[7]` (broadcast across all 7 language scripts),
`letter_spacing` → `spacings[7]`, `char_ratio` → `ratios[7]`. Highlight is the
non-obvious one — it is NOT called `highlight`/`background`/`charBgColor` internally.

## apply_text_style — in-place CharShape path (large files)

`applyTextStyleInPlace`: appends a new `CHAR_SHAPE` to DocInfo, bumps the matching
`HWPTAG_ID_MAPPINGS` count, splices the target range into the paragraph's
`PARA_CHAR_SHAPE` entries, and bumps the paragraph header's `num_char_shapes`. For
highlight it also inserts a `PARA_RANGE_TAG` (tag = `(0x02<<24)|BGR`) and bumps
`range_tags_count`. Font: registers the name in DocInfo's `FACE_NAME` table (appended
to all 7 language slots, per-slot `HWPTAG_ID_MAPPINGS` counts bumped) and writes the
7 resolved face-ids into the new `CHAR_SHAPE`. No whitelist — any name is registered;
whether it *renders* depends on the viewer's installed fonts.

## apply_paragraph_style — in-place ParaShape path (large files)

`applyParagraphStyleInPlace`: clones the target paragraph's `PARA_SHAPE`, overlays the
style props (align/indent/margins/line-spacing/spacing), dedupes against existing
entries or appends a new one to DocInfo, bumps the `HWPTAG_ID_MAPPINGS` PARA_SHAPE
count, and rewrites the paragraph header's `paraShapeId`. For `background_color` it
appends a solid-fill `HWPTAG_BORDER_FILL` and sets `ParaShape.border_fill_id` to its
**1-based** ID (HWP BorderFill refs are 1-based, 0 = "no fill").

## set_cell_text — empty-cell / inline-object / nesting mechanics

- **`text:""` clear**: writes Hancom's native empty paragraph (`PARA_HEADER` +
  `CHAR_SHAPE`, **no `PARA_TEXT`**, single `LINE_SEG`). A naive EOP-only `PARA_TEXT`
  makes Hancom Docs reject the file — always clear via the op.
- **inline object**: a paragraph whose anchor char hosts an embedded 그림 is refused;
  `clear_objects:true` drops the anchor char + the whole gso record cluster. The
  image's `BinData` stream is left orphaned (overwrite separately if sensitive).
- **nesting levels**: top-level cell text = PARA_TEXT level 3; a table nested in a
  cell puts its CTRL_HEADER at level 3, its cells (LIST_HEADER) at level 4, that
  cell's text at level 5 — +2 per nesting. `nested:[{control,cell}]` descends one
  step each; `locateCell` tracks `cellLevel` so the cell/para loops generalise.

## delete_object — empty-para + BinData renumber + thumbnail

- The gso paragraph is replaced **in place with an empty paragraph** (Hancom-shaped:
  `PARA_HEADER` + `CHAR_SHAPE`, no `PARA_TEXT`/`LINE_SEG`). Its `nchars` high bit
  `0x80000000` (section last-paragraph marker) is set **only** when the empty para is
  now the last one — setting it on a middle para makes Hancom read a ~2-billion char
  count and stop rendering everything after (clearing it on the last makes Hancom
  reject the file).
- image/chart: removes the `BinData` stream (bytes zeroed + chain freed) and the
  `HWPTAG_BIN_DATA` def, then **renumbers every higher storage id down by 1** (BIN_DATA
  defs + ID_MAPPINGS count + each remaining gso's `binDataID`; each higher `BIN000N`
  stream is **renamed** to close the gap, keeping its bytes/extension/sector-class —
  rotating slot pointers instead breaks Hancom across the mini↔regular boundary).
  Hancom resolves a `binDataID` by position, so a gap renders the *higher* objects as
  broken-image boxes; renumbering keeps them intact. Last/only binary → the empty
  `BinData` folder is removed.
- redaction: the page-1 thumbnail (`PrvImage`) is invalidated (zeroed + emptied) so a
  deleted page-1 object can't linger; Hancom regenerates it on open.
- Multiple deletes are sorted descending so an earlier delete never shifts a later
  target.

## Background-color leak between paragraphs (from-scratch path)

The leak comes from `splitParagraph` copying paragraph N's paraShape (incl. its
BorderFill ref) into N+1. The alternative — explicitly resetting fill on every
paragraph — produces visible 1px stripes (rhwp's auto-generated default BorderFill has
`borderTop/Bottom/Left = type:1 width:0`, which Hancom Docs renders as thin lines). So
the workaround (SKILL) is to reset the next paragraph's `background_color` explicitly,
or apply `background_color` last in the build.
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall