Claude Code HTML Skill
Use this skill to turn dense agent work into a readable, visual, shareable, and sometimes editable HTML artifact. The model is Anthropic's html-effectiveness examples: HTML is valuable when it reveals shape, comparison, flow, state, risk, or interaction that markdown flattens.
This is not "always make a webpage." It is a routing skill: pick the official-style artifact pattern that matches the user's job.
First Decide The Job
Before writing HTML, name the primary job in one sentence:
- Compare options.
- Explore visual directions.
- Review code or a PR.
- Explain a code path, system, incident, or concept.
- Prototype an interaction, animation, or UI component.
- Generate a status report, incident report, slide deck, or leadership brief.
- Publish a research paper or technical report as a long-form reading page.
- Create an implementation plan.
- Build a one-off editor that lets the user manipulate state and copy/export the result.
If there is no concrete job, use markdown or ask what decision/action the artifact should support.
Allowed primary_job values:
compare
explore
review
explain
prototype
report
plan
editor
dispatcher
If the request does not fit one of these jobs, or if HTML would not improve comprehension, manipulation, export, or reuse, stay in chat/Markdown.
Official Pattern Router
Use references/official-20-patterns.md as the main playbook. It maps the 20 official examples into reusable artifact shapes. Use references/official-details.md when you need official boundary rules: artifact criteria, simple HTML vs React builder, testing tradeoffs, sharing/export, and subagent coordination.
Use references/ecosystem-comparison.md when the user asks how this skill compares to GitHub repos, Obsidian plugins, markdown-viewer tools, or market alternatives.
Routing Contract
Before writing HTML, decide this compact contract:
| Field |
Required decision |
primary_job |
One of compare, explore, review, explain, prototype, report, plan, editor, dispatcher. |
should_html |
Why HTML is better than chat/Markdown for this task. |
selected_pattern |
The official-style pattern or reference being used. |
required_exports |
Copy/export outputs the user needs next. Required for editor, dispatcher, and project-memory artifacts. |
markdown_target |
Required when the artifact affects durable project memory, Obsidian, worklogs, handoffs, AGENTS.md, or CLAUDE.md. |
verification |
Checks to run or state as blocked before claiming done. |
For editor, dispatcher, project-memory boards, and Markdown/Obsidian round-trip artifacts, use references/artifact-contract.md plus the domain reference. For ordinary explainers/reports, keep the contract lightweight and visible through the first viewport and final verification.
Quick routing:
| User request |
Pattern |
Load |
| "compare approaches", "explore options", "which design direction" |
Side-by-side comparison or visual exploration |
references/official-20-patterns.md, references/exploration-and-planning.md |
| "review this PR", "write PR explainer", "explain this code path" |
Code review / code understanding |
references/official-20-patterns.md, references/code-review-and-pr.md |
| "make a design system reference", "component variants", "prototype interaction/animation" |
Design/prototype artifact |
references/official-20-patterns.md, references/design-and-prototypes.md |
| "draw diagram", "flowchart", "architecture map", "SVG illustration" |
Diagram / illustration |
references/official-20-patterns.md, references/diagrams-and-illustrations.md |
| "status report", "incident report", "research explainer", "teach me" |
Report / research / explainer |
references/official-20-patterns.md, references/reports-and-research.md |
| "turn this paper/PDF/DOCX into HTML", "paper website", "publication page", "visual paper explainer" |
Paper publication / long-form research narrative |
references/paper-publication.md, references/matching-your-style.md |
| "implementation plan" |
Plan with timeline, data flow, risk table, not-doing section |
references/official-20-patterns.md, references/exploration-and-planning.md |
| "deck", "slides" |
Arrow-key deck |
references/official-20-patterns.md, references/decks.md |
| "triage/reorder/tune/edit/config/flags/prompt/dataset" |
Custom editor with export |
references/official-20-patterns.md, references/custom-editors.md |
| "Obsidian", "MOC", "worklog", "AGENTS.md", "CLAUDE.md", durable project docs, long-term project memory |
Markdown source of truth with HTML review/editor companion |
references/markdown-obsidian-loop.md |
| "complex app", "routing", "state management", "shadcn", "React artifact", "multi-component artifact" |
Consider complex web artifact builder instead of simple HTML |
references/official-details.md |
| "multiple AI", "subagents", "agent team", "dispatcher", "coordinate workers", "one person managing multiple AIs" |
Solo multi-AI operating loop: HTML dispatcher + focused prompts + Markdown ledger |
references/solo-multi-ai-workflow.md, references/markdown-obsidian-loop.md, references/official-details.md |
| "compare this with GitHub/community tools", "market alternatives", "what is different" |
Ecosystem comparison |
references/ecosystem-comparison.md |
| "Obsidian vs HTML", "markdown vault", "long-term memory vs artifact" |
Markdown/HTML hybrid workflow |
references/markdown-obsidian-loop.md, references/ecosystem-comparison.md |
For mixed requests, combine two patterns only when both serve the same job. Do not create a generic dashboard with every section.
Architecture diagrams: use the bundled Archify renderer
When the primary job is to explain or explore a real or described system topology, workflow, API sequence, data flow, or lifecycle, route the diagram portion through the bundled Archify renderer in vendor/archify/.
- Read references/archify-integration.md when the task matches this branch.
- Choose exactly one Archify type:
architecture, workflow, sequence, dataflow, or lifecycle.
- Read the matching schema and one JSON example from
vendor/archify/ before authoring the candidate. Treat examples as shape references, not facts.
- Write the JSON candidate first, then validate it with
node vendor/archify/bin/archify.mjs validate ... --quality showcase --json.
- Deliver only after validation passes:
node vendor/archify/bin/archify.mjs deliver ... --quality showcase --json.
- Keep the generated HTML self-contained and apply this skill's HTML gate, first-viewport, offline, and output-path rules around it.
Completion criterion: The diagram candidate has a passing Archify validation receipt, and the delivered HTML is included as the single purpose-built artifact or as the clearly scoped diagram section of one.
Universal Artifact Rules
Every artifact must satisfy:
- Single self-contained
.html file. Inline CSS and JS. No build step.
- Works offline. Avoid external CDNs unless the user explicitly wants them.
- Mobile responsive enough to not break.
- First viewport explains the job and the interaction. For a paper publication page, it instead establishes the title, thesis/deck, visual chapter map, and provenance; do not force a tool-style action.
- Use the format, not markdown wrapped in tags: columns for comparisons, timelines for time, diagrams for flow, matrices for variants, editors for state.
- Concrete content from the task. Avoid placeholder SaaS boilerplate.
- If the user manipulates state, include copy/export. This is non-negotiable.
- If the user is managing long-term project memory, keep Markdown as the source of truth and use HTML as a generated review/editor/export surface.
Artifact Contract
For editor, dispatcher, project-memory board, or Markdown/Obsidian round-trip artifacts, include a small contract in the HTML as JSON:
<script id="artifact-contract" type="application/json">{...}</script>
Minimum fields: primary_job, selected_pattern, why_html, sources_used, exports, and verification. Every declared export must have a matching control marked with data-export-label or aria-label. Keep the contract short; it is an audit handle, not user-facing bureaucracy. See references/artifact-contract.md.
Prefer simple single-file HTML for most Claude Code project artifacts. Escalate to a React/Vite-style artifact only when the artifact genuinely needs multi-component state, routing, or a component library. See references/official-details.md.
First-Viewport Test
The top of the page should answer within five seconds:
- What is this artifact for?
- What should I do with it?
- What is already pre-filled?
- What can I inspect/change?
- What can I copy/export?
If this is unclear, simplify before adding more sections.
For a paper publication page, use the publication-specific first-viewport test in references/paper-publication.md. Reading is the primary action, so exports and controls are optional unless the page includes manipulable state.
Output Mechanics
Save the file in the working directory using a descriptive kebab-case .html filename, for example:
cycle-14-triage.html
streaming-pr-review.html
comment-threads-implementation-plan.html
feature-flags-editor.html
prompt-tuner.html
paper-title-publication.html
After saving, tell the user the absolute path. If the page is already open in a browser, tell the user to refresh.
Custom Editor Rules
For any editor, build the export first:
- Copy as markdown for planning/order/triage.
- Copy diff for config/flags.
- Copy prompt for prompt/template tuning.
- Copy JSON/CSV for structured data.
Use navigator.clipboard.writeText plus a textarea fallback because local file:// pages may not have clipboard permission.
Do not make one giant prompt the only export. Match export scope to the user's next action:
- Single selected item: copy a focused Codex prompt for exactly that task.
- Current bucket: copy a batch prompt for only
Now or only selected items.
- Changed items only: copy a diff or patch.
- Whole board: copy planning markdown for docs, not an execution prompt.
- Obsidian sync: copy the Markdown section that should be written back after execution.
For task boards, provide selection controls or per-card copy buttons when the user may execute one task at a time.
Markdown And Obsidian Loop
When the user mentions long-term project docs, Obsidian, MOCs, worklogs, AGENTS.md, CLAUDE.md, dashboards, decision logs, or handoff notes, do not treat HTML as the durable source of truth. Use this loop:
- Read Markdown source files.
- Generate an HTML artifact for review, comparison, triage, visualization, or editing.
- Include
Copy as Markdown, Copy Obsidian note, or Copy patch output.
- Clearly label which exported content should be written back to which Markdown file.
- Preserve Obsidian-style links such as
[[Project MOC]], tags, headings, and task checkboxes when exporting.
The mental model: Markdown is the database and long-term memory; HTML is the dashboard, editor, explainer, or meeting room.
After executing a task, update Markdown. A project-management HTML artifact should not be the final record. The agent should write the completed result, evidence, changed files, next actions, and open loops back to the relevant Markdown note or ask the user before doing so when the target is unclear.
For one person coordinating multiple AI agents, use HTML as the dispatcher:
- Show work items, owners, blockers, and evidence.
- Export one focused prompt per worker/agent.
- Track which Markdown note each result must update.
- Keep decision logs and worklogs in Markdown so every agent can reload context without needing the HTML UI.
For a unified solo multi-AI workflow, read references/solo-multi-ai-workflow.md. It defines the full loop: task assignment, single-task prompt export, execution receipt, Markdown write-back, Obsidian sync, and status tracking.
Definition Of Done
Before finalizing, verify:
- One
primary_job and one selected pattern are clear.
- First viewport shows: job, source data, primary action, export path. For paper publication pages, verify title, thesis/deck, chapter navigation, and author/source provenance instead.
- When exports are required, their controls stay visible near the working area, not hidden at page bottom only.
- When the artifact has empty/error states, they explain what is missing and what remains readable or exportable.
- Mobile layout preserves the primary action and any required export button without horizontal scroll.
- Interactive state gives immediate feedback: counts, changed markers, warnings, or preview.
- The layout matches the job: comparisons are side-by-side, timelines are visual, diagrams are near the text, editors make state manipulable.
- Interactions are load-bearing and exportable, not decorative.
- Required exports work with
navigator.clipboard.writeText plus a textarea fallback for file://.
- Editor/export scopes are labeled as
single, selected, bucket, changed-only, or whole.
- Project-memory artifacts name the target Markdown file/note and preserve
[[Wiki links]], #tags, headings, and task checkboxes.
- Dispatcher artifacts export one focused task prompt by default; batch export is explicit and limited to independent tasks.
Done on project boards requires evidence plus Markdown write-back, or a clear not_applicable reason.
- The HTML opens offline and has no external dependencies unless the user explicitly requested them.
If you cannot run a verification step, say blocked or uncertain and name the missing check.
Anti-Patterns
Avoid:
- A generic dashboard with metrics and cards but no task.
- Long markdown translated into HTML.
- A task board with no clear meaning or export.
- Pretty but non-functional controls.
- Requiring the user to paste data that the prompt already provided.
- Hiding warnings until after export.
- Refusing to recommend when the user asked for comparison.
1---2name: claude-code-html-skill3description: Create self-contained offline HTML artifacts when a substantial task benefits from layout, visualization, interaction, copy/export, or Markdown/Obsidian round-trip. Use for complex comparisons, PR/code explainers, implementation plans, reports, research papers or technical documents converted from PDF/DOCX/Markdown into publication pages, project-memory boards, multi-agent dispatchers, and one-off editors. Require focused exports for editors, dispatchers, and project-memory artifacts. Stay in chat/Markdown for short answers, single commands, code snippets, terminal output, or brief summaries.4---56# Claude Code HTML Skill78Use this skill to turn dense agent work into a readable, visual, shareable, and sometimes editable HTML artifact. The model is Anthropic's `html-effectiveness` examples: HTML is valuable when it reveals shape, comparison, flow, state, risk, or interaction that markdown flattens.910This is not "always make a webpage." It is a routing skill: pick the official-style artifact pattern that matches the user's job.1112## First Decide The Job1314Before writing HTML, name the primary job in one sentence:1516- Compare options.17- Explore visual directions.18- Review code or a PR.19- Explain a code path, system, incident, or concept.20- Prototype an interaction, animation, or UI component.21- Generate a status report, incident report, slide deck, or leadership brief.22- Publish a research paper or technical report as a long-form reading page.23- Create an implementation plan.24- Build a one-off editor that lets the user manipulate state and copy/export the result.2526If there is no concrete job, use markdown or ask what decision/action the artifact should support.2728Allowed `primary_job` values:2930- `compare`31- `explore`32- `review`33- `explain`34- `prototype`35- `report`36- `plan`37- `editor`38- `dispatcher`3940If the request does not fit one of these jobs, or if HTML would not improve comprehension, manipulation, export, or reuse, stay in chat/Markdown.4142## Official Pattern Router4344Use `references/official-20-patterns.md` as the main playbook. It maps the 20 official examples into reusable artifact shapes. Use `references/official-details.md` when you need official boundary rules: artifact criteria, simple HTML vs React builder, testing tradeoffs, sharing/export, and subagent coordination.45Use `references/ecosystem-comparison.md` when the user asks how this skill compares to GitHub repos, Obsidian plugins, markdown-viewer tools, or market alternatives.4647## Routing Contract4849Before writing HTML, decide this compact contract:5051| Field | Required decision |52|---|---|53| `primary_job` | One of `compare`, `explore`, `review`, `explain`, `prototype`, `report`, `plan`, `editor`, `dispatcher`. |54| `should_html` | Why HTML is better than chat/Markdown for this task. |55| `selected_pattern` | The official-style pattern or reference being used. |56| `required_exports` | Copy/export outputs the user needs next. Required for `editor`, `dispatcher`, and project-memory artifacts. |57| `markdown_target` | Required when the artifact affects durable project memory, Obsidian, worklogs, handoffs, `AGENTS.md`, or `CLAUDE.md`. |58| `verification` | Checks to run or state as blocked before claiming done. |5960For `editor`, `dispatcher`, project-memory boards, and Markdown/Obsidian round-trip artifacts, use `references/artifact-contract.md` plus the domain reference. For ordinary explainers/reports, keep the contract lightweight and visible through the first viewport and final verification.6162Quick routing:6364| User request | Pattern | Load |65|---|---|---|66| "compare approaches", "explore options", "which design direction" | Side-by-side comparison or visual exploration | `references/official-20-patterns.md`, `references/exploration-and-planning.md` |67| "review this PR", "write PR explainer", "explain this code path" | Code review / code understanding | `references/official-20-patterns.md`, `references/code-review-and-pr.md` |68| "make a design system reference", "component variants", "prototype interaction/animation" | Design/prototype artifact | `references/official-20-patterns.md`, `references/design-and-prototypes.md` |69| "draw diagram", "flowchart", "architecture map", "SVG illustration" | Diagram / illustration | `references/official-20-patterns.md`, `references/diagrams-and-illustrations.md` |70| "status report", "incident report", "research explainer", "teach me" | Report / research / explainer | `references/official-20-patterns.md`, `references/reports-and-research.md` |71| "turn this paper/PDF/DOCX into HTML", "paper website", "publication page", "visual paper explainer" | Paper publication / long-form research narrative | `references/paper-publication.md`, `references/matching-your-style.md` |72| "implementation plan" | Plan with timeline, data flow, risk table, not-doing section | `references/official-20-patterns.md`, `references/exploration-and-planning.md` |73| "deck", "slides" | Arrow-key deck | `references/official-20-patterns.md`, `references/decks.md` |74| "triage/reorder/tune/edit/config/flags/prompt/dataset" | Custom editor with export | `references/official-20-patterns.md`, `references/custom-editors.md` |75| "Obsidian", "MOC", "worklog", "AGENTS.md", "CLAUDE.md", durable project docs, long-term project memory | Markdown source of truth with HTML review/editor companion | `references/markdown-obsidian-loop.md` |76| "complex app", "routing", "state management", "shadcn", "React artifact", "multi-component artifact" | Consider complex web artifact builder instead of simple HTML | `references/official-details.md` |77| "multiple AI", "subagents", "agent team", "dispatcher", "coordinate workers", "one person managing multiple AIs" | Solo multi-AI operating loop: HTML dispatcher + focused prompts + Markdown ledger | `references/solo-multi-ai-workflow.md`, `references/markdown-obsidian-loop.md`, `references/official-details.md` |78| "compare this with GitHub/community tools", "market alternatives", "what is different" | Ecosystem comparison | `references/ecosystem-comparison.md` |79| "Obsidian vs HTML", "markdown vault", "long-term memory vs artifact" | Markdown/HTML hybrid workflow | `references/markdown-obsidian-loop.md`, `references/ecosystem-comparison.md` |8081For mixed requests, combine two patterns only when both serve the same job. Do not create a generic dashboard with every section.8283### Architecture diagrams: use the bundled Archify renderer8485When the primary job is to explain or explore a real or described system topology, workflow, API sequence, data flow, or lifecycle, route the diagram portion through the bundled Archify renderer in `vendor/archify/`.8687- Read [references/archify-integration.md](references/archify-integration.md) when the task matches this branch.88- Choose exactly one Archify type: `architecture`, `workflow`, `sequence`, `dataflow`, or `lifecycle`.89- Read the matching schema and one JSON example from `vendor/archify/` before authoring the candidate. Treat examples as shape references, not facts.90- Write the JSON candidate first, then validate it with `node vendor/archify/bin/archify.mjs validate ... --quality showcase --json`.91- Deliver only after validation passes: `node vendor/archify/bin/archify.mjs deliver ... --quality showcase --json`.92- Keep the generated HTML self-contained and apply this skill's HTML gate, first-viewport, offline, and output-path rules around it.9394**Completion criterion:** The diagram candidate has a passing Archify validation receipt, and the delivered HTML is included as the single purpose-built artifact or as the clearly scoped diagram section of one.9596## Universal Artifact Rules9798Every artifact must satisfy:991001. Single self-contained `.html` file. Inline CSS and JS. No build step.1012. Works offline. Avoid external CDNs unless the user explicitly wants them.1023. Mobile responsive enough to not break.1034. First viewport explains the job and the interaction. For a paper publication page, it instead establishes the title, thesis/deck, visual chapter map, and provenance; do not force a tool-style action.1045. Use the format, not markdown wrapped in tags: columns for comparisons, timelines for time, diagrams for flow, matrices for variants, editors for state.1056. Concrete content from the task. Avoid placeholder SaaS boilerplate.1067. If the user manipulates state, include copy/export. This is non-negotiable.1078. If the user is managing long-term project memory, keep Markdown as the source of truth and use HTML as a generated review/editor/export surface.108109## Artifact Contract110111For `editor`, `dispatcher`, project-memory board, or Markdown/Obsidian round-trip artifacts, include a small contract in the HTML as JSON:112113```html114<script id="artifact-contract" type="application/json">{...}</script>115```116117Minimum fields: `primary_job`, `selected_pattern`, `why_html`, `sources_used`, `exports`, and `verification`. Every declared export must have a matching control marked with `data-export-label` or `aria-label`. Keep the contract short; it is an audit handle, not user-facing bureaucracy. See `references/artifact-contract.md`.118119Prefer simple single-file HTML for most Claude Code project artifacts. Escalate to a React/Vite-style artifact only when the artifact genuinely needs multi-component state, routing, or a component library. See `references/official-details.md`.120121## First-Viewport Test122123The top of the page should answer within five seconds:124125- What is this artifact for?126- What should I do with it?127- What is already pre-filled?128- What can I inspect/change?129- What can I copy/export?130131If this is unclear, simplify before adding more sections.132133For a paper publication page, use the publication-specific first-viewport test in `references/paper-publication.md`. Reading is the primary action, so exports and controls are optional unless the page includes manipulable state.134135## Output Mechanics136137Save the file in the working directory using a descriptive kebab-case `.html` filename, for example:138139- `cycle-14-triage.html`140- `streaming-pr-review.html`141- `comment-threads-implementation-plan.html`142- `feature-flags-editor.html`143- `prompt-tuner.html`144- `paper-title-publication.html`145146After saving, tell the user the absolute path. If the page is already open in a browser, tell the user to refresh.147148## Custom Editor Rules149150For any editor, build the export first:151152- Copy as markdown for planning/order/triage.153- Copy diff for config/flags.154- Copy prompt for prompt/template tuning.155- Copy JSON/CSV for structured data.156157Use `navigator.clipboard.writeText` plus a textarea fallback because local `file://` pages may not have clipboard permission.158159Do not make one giant prompt the only export. Match export scope to the user's next action:160161- **Single selected item**: copy a focused Codex prompt for exactly that task.162- **Current bucket**: copy a batch prompt for only `Now` or only selected items.163- **Changed items only**: copy a diff or patch.164- **Whole board**: copy planning markdown for docs, not an execution prompt.165- **Obsidian sync**: copy the Markdown section that should be written back after execution.166167For task boards, provide selection controls or per-card copy buttons when the user may execute one task at a time.168169## Markdown And Obsidian Loop170171When the user mentions long-term project docs, Obsidian, MOCs, worklogs, `AGENTS.md`, `CLAUDE.md`, dashboards, decision logs, or handoff notes, do not treat HTML as the durable source of truth. Use this loop:1721731. Read Markdown source files.1742. Generate an HTML artifact for review, comparison, triage, visualization, or editing.1753. Include `Copy as Markdown`, `Copy Obsidian note`, or `Copy patch` output.1764. Clearly label which exported content should be written back to which Markdown file.1775. Preserve Obsidian-style links such as `[[Project MOC]]`, tags, headings, and task checkboxes when exporting.178179The mental model: Markdown is the database and long-term memory; HTML is the dashboard, editor, explainer, or meeting room.180181After executing a task, update Markdown. A project-management HTML artifact should not be the final record. The agent should write the completed result, evidence, changed files, next actions, and open loops back to the relevant Markdown note or ask the user before doing so when the target is unclear.182183For one person coordinating multiple AI agents, use HTML as the dispatcher:184185- Show work items, owners, blockers, and evidence.186- Export one focused prompt per worker/agent.187- Track which Markdown note each result must update.188- Keep decision logs and worklogs in Markdown so every agent can reload context without needing the HTML UI.189190For a unified solo multi-AI workflow, read `references/solo-multi-ai-workflow.md`. It defines the full loop: task assignment, single-task prompt export, execution receipt, Markdown write-back, Obsidian sync, and status tracking.191192## Definition Of Done193194Before finalizing, verify:195196- One `primary_job` and one selected pattern are clear.197- First viewport shows: job, source data, primary action, export path. For paper publication pages, verify title, thesis/deck, chapter navigation, and author/source provenance instead.198- When exports are required, their controls stay visible near the working area, not hidden at page bottom only.199- When the artifact has empty/error states, they explain what is missing and what remains readable or exportable.200- Mobile layout preserves the primary action and any required export button without horizontal scroll.201- Interactive state gives immediate feedback: counts, changed markers, warnings, or preview.202- The layout matches the job: comparisons are side-by-side, timelines are visual, diagrams are near the text, editors make state manipulable.203- Interactions are load-bearing and exportable, not decorative.204- Required exports work with `navigator.clipboard.writeText` plus a textarea fallback for `file://`.205- Editor/export scopes are labeled as `single`, `selected`, `bucket`, `changed-only`, or `whole`.206- Project-memory artifacts name the target Markdown file/note and preserve `[[Wiki links]]`, `#tags`, headings, and task checkboxes.207- Dispatcher artifacts export one focused task prompt by default; batch export is explicit and limited to independent tasks.208- `Done` on project boards requires evidence plus Markdown write-back, or a clear `not_applicable` reason.209- The HTML opens offline and has no external dependencies unless the user explicitly requested them.210211If you cannot run a verification step, say `blocked` or `uncertain` and name the missing check.212213## Anti-Patterns214215Avoid:216217- A generic dashboard with metrics and cards but no task.218- Long markdown translated into HTML.219- A task board with no clear meaning or export.220- Pretty but non-functional controls.221- Requiring the user to paste data that the prompt already provided.222- Hiding warnings until after export.223- Refusing to recommend when the user asked for comparison.