$npx -y skills add bluzir/claude-code-design --skill export-standaloneBundle an HTML artifact into a single self-contained file with all CSS/JS/images inlined as data URLs. Requires monolith CLI (brew install monolith).
| 1 | # Export Standalone |
| 2 | |
| 3 | Produce a single HTML file that works offline (no external dependencies). Uses `monolith` — a Rust CLI that inlines everything. |
| 4 | |
| 5 | ## Preflight |
| 6 | |
| 7 | 1. `Bash(which monolith)` — check installed. If missing: |
| 8 | - Tell user: "`monolith` not found. Install with `brew install monolith` (macOS) and rerun." |
| 9 | - Stop. |
| 10 | |
| 11 | ## Steps |
| 12 | |
| 13 | 1. Resolve paths: |
| 14 | - `$0` = input HTML (required) |
| 15 | - `$1` = output HTML (default: `<input>-standalone.html`) |
| 16 | - `Bash(mkdir -p $(dirname <output>))` if needed |
| 17 | |
| 18 | 2. Run monolith: |
| 19 | ``` |
| 20 | Bash(monolith "<input>" --isolate --no-metadata -o "<output>") |
| 21 | ``` |
| 22 | Flags: |
| 23 | - `--isolate` — CSP to prevent any remote resource loads after bundling |
| 24 | - `--no-metadata` — strip `<!-- saved from ... -->` metadata |
| 25 | |
| 26 | 3. Report: |
| 27 | - `Bash(stat -f%z "<output>")` or `Bash(ls -la "<output>")` for size |
| 28 | - "Bundled `<input>` → `<output>` (`<size>` KB). Works offline." |
| 29 | |
| 30 | ## Tradeoffs |
| 31 | |
| 32 | - Pros: single file, drop in email/chat, no CDN dependency, survives archive |
| 33 | - Cons: larger file size (5-10× original), no HMR, fonts often inlined as base64 (bigger) |
| 34 | - Interactivity preserved (React + Babel still run at load time), but network fetches fail by design |