---
name: htmlvspec
description: Creates a visual engineering implementation plan as a single self-contained HTML page saved to specs/.html — the plan authored directly in styled HTML, with one AI-generated diagram image per section (hero + per major H2) generated in parallel and embedded inline, plus a freeform HTML zone for custom HTML/CSS/SVG/JS that aids comprehension. Images are always generated. Use when the user says "htmlvspec", wants a visual/illustrated HTML implementation plan, a browser-openable spec with per-section diagrams, or any HTML plan where images are required.
argument-hint: "[user prompt]"
---
# htmlvspec
## Purpose
Produce a **visual** engineering implementation plan as **one self-contained HTML page** —
`specs/.html` — that you can open directly in a browser. The plan is authored
**directly in HTML** using the template below, with **one AI-generated diagram image per
section** (hero + per major H2) generated in parallel and embedded inline, and a dedicated
**Freeform** zone that lets you author any HTML you want (interactive toggles, animated SVG
flows, comparison matrices, decision trees, etc.) to make the plan clearer and richer than
prose could.
Phases, in order:
1. **Plan phase** — analyze, explore, design (same thinking as a normal spec).
2. **HTML authoring phase** — write the plan into the **HTML Plan Template**.
3. **Image phase** — generate one diagram per section in **parallel** and embed them inline.
4. **Freeform phase** — enrich the page with custom HTML per the **Freeform Instruction Set**.
## Variables
USER_PROMPT: $1
ALL_ARGUMENTS: $ARGUMENTS
PLAN_OUTPUT_DIRECTORY: `specs/`
PLAN_SLUG: kebab-case name derived from the plan topic (e.g. `in-memory-ttl-lru-cache`)
HTML_OUTPUT: `specs/htmlvspec-.html` — **the filename MUST always begin with the `htmlvspec-` prefix**
IMAGE_DIR: `specs/htmlvspec-/` — sibling directory matching the HTML filename (same `htmlvspec-` prefix)
IMAGE_GENERATOR: `~/.claude/skills/htmlvspec/scripts/generate_image.py`
IMAGE_SIZE: `2048x1152` (wide 16:9 by default)
IMAGE_QUALITY: `high`
HERO_IMAGE_NAME: `00-hero.png`
MAX_TEXT_LABELS_PER_IMAGE: 10
MAX_TOTAL_IMAGES: 10
## Instructions
### Plan phase
- IMPORTANT: If no `USER_PROMPT` is provided, stop and ask the user to provide it.
- Carefully analyze the USER_PROMPT. Determine task type (chore|feature|refactor|fix|enhancement) and complexity (simple|medium|complex).
- Think deeply (ultrathink) about the best implementation approach.
- Explore the codebase to understand existing patterns and architecture.
- Decide which sections from the HTML Plan Template apply (include the conditional sections only when task type/complexity warrants them, exactly like a normal spec).
- Generate a descriptive kebab-case PLAN_SLUG from the topic.
### HTML authoring phase
- Author the plan **directly in HTML** using the **HTML Plan Template** below — do not write a markdown file. The output is a single `specs/htmlvspec-.html`.
- Keep the page **self-contained**: all CSS inline in `