DoHyun468/claw-hwp / plugins/claw-hwp/skills/hwp
hwp
Unverifiedscripts/README.md
View on GitHub# scripts/
Bundled scripts referenced by `SKILL.md`. Each script is intentionally low-level — Claude does the high-level reasoning and invokes these only for operations it can't do natively (zip handling, WASM calls).
## Status
End-to-end create + edit pipeline working, **zero-config** (deps vendored).
| Script | Status | Notes |
|--------|--------|-------|
| `extract_text.js` | ✅ v0 | Default plaintext, `--format markdown` (skips empty layout tables), `--inspect` for JSON metadata. Handles both `.hwp` and `.hwpx` (in-memory rhwp conversion for binary) |
| `unpack.py` | ✅ v0 | `zipfile` + `xml.dom.minidom` pretty-print. `--no-pretty` flag for raw mode |
| `pack.py` | ✅ v0 | mimetype-first uncompressed entry per OPF spec. Sorted file order for reproducibility |
| `validate.py` | ✅ v0 | Zip integrity + mimetype + required files + XML well-formedness |
| `create.js` | ✅ v0 | stdin-JSON op runner. Op vocabulary in `SKILL.md`. |
| `vendor/` | ✅ v0 | `@rhwp/core` (rhwp.js + rhwp_bg.wasm, ~5 MB), `fflate` (index.mjs, ~80 KB), and `cfb` (cfb.js, ~62 KB) bundled. Each subdir keeps the upstream LICENSE |
## Verified pipeline
End-to-end round-trip tested against rhwp's `samples/`:
1. `validate.py report.hwpx` — sanity check
2. `unpack.py report.hwpx /tmp/u/` — extract pretty-printed XML
3. *Edit XML files in `/tmp/u/Contents/section*.xml` using your `Edit` tool*
4. `pack.py /tmp/u/ output.hwpx` — repackage
5. `validate.py output.hwpx` — confirm structural integrity
6. `extract_text.js output.hwpx` — verify edits propagate
437-paragraph document survives round-trip with edit applied; structural counts preserved.
## End-user setup
**No setup needed.** The Node deps are vendored — scripts run on any machine with Node 18+ and Python 3.9+.
## Maintainer: refreshing vendored deps
`package.json` and `package-lock.json` are kept for maintainers who want to update bundled libraries:
```bash
cd skills/hwp/scripts
npm install # repopulate node_modules with latest matching versions
cp node_modules/@rhwp/core/{rhwp.js,rhwp_bg.wasm,LICENSE} vendor/rhwp/
cp node_modules/fflate/esm/index.mjs vendor/fflate/
cp node_modules/fflate/LICENSE vendor/fflate/
cp node_modules/cfb/{cfb.js,LICENSE} vendor/cfb/
```
After refreshing, smoke-test by moving `node_modules/` aside and running each script — they should still work because they import only from `vendor/`.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 197k | Updated | Claude CodeCodex | Verified | Install |
| 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: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| 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: 194k | Updated | Claude CodeCodex | Verified | Install |