Produces a self-contained HTML file for deliverables the reader will keep, share, or manipulate; not for ordinary answers. Use when spatial layout, comparison, or interaction carries meaning.
2 stars
0 votes
0 copies
3 views
Added November 11, 2026
ai-agentsgocode-reviewgitapi
Works with
terminal
cli
api
mcp
Security analysis
A92/100
mediumInstalls packages at runtime which could introduce malicious dependencies
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Html Artifacts?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/fabiandistler-html-artifacts)
---
name: html-artifacts
category: communication
environments: coding, chat
description: Produces a self-contained HTML file for deliverables the reader will keep, share, or manipulate; not for ordinary answers. Use when spatial layout, comparison, or interaction carries meaning.
---
# HTML Artifacts
## When to use
Default to a one-line offer and stay in markdown unless the user asked for HTML or the output is clearly a deliverable they will keep, share, or manipulate. Reach for HTML only when that deliverable test holds and one of the following is true.
- **Comparison.** Two or more options/approaches/designs the reader needs to weigh against each other. Side-by-side beats stacked.
- **Spatial information.** Diffs, call graphs, module maps, flowcharts, timelines, before/after — anything where position carries meaning.
- **Interaction matters.** Animations, easing curves, parameter tuning, state transitions — things the reader needs to *feel*, not read about.
- **Reference material.** A document the reader will navigate non-linearly: tabs, collapsible sections, glossary in the margin, jump links.
- **Color or hierarchy carries meaning.** Severity tags, status colors, syntax highlighting, design tokens.
- **One-off editor.** The reader needs to manipulate a thing (drag tickets, toggle flags, tune a prompt) and round-trip the result back into a prompt or a commit.
- **The reader will share it.** A spec going to leadership, a PR writeup going to reviewers, a status report going to a team. Readers often engage more with an HTML page than a markdown file.
Deliverable cues include a doc, writeup, spec, report, explainer, review, comparison, mockup, diagram, flowchart, deck, slides, status update, post-mortem, playground, or editor. Keep bare requests to explain, summarize, compare, explore, or brainstorm in Markdown unless the user wants a deliverable to keep, share, or manipulate.
Examples include "compare these three options side by side for the leadership review", "turn this incident timeline into a shareable post-mortem", and "build a board to triage these tickets and copy the result back".
## This skill picks the format, not the content
It decides how a deliverable is rendered. What goes *in* the deliverable is often another skill's job, and the two compose — run the other skill for the substance, then render its output as HTML instead of markdown:
- Weekly/monthly leadership status, launch announcements, risk escalations → `stakeholder-update`.
- Standup prep or a status update assembled from recent repo activity → suggest the user run `repo-status`, then render its Yesterday / Today / Blockers output as HTML.
- The internal structure of a technical explanation (problem before solution) → `problem-first-explanation`.
- Review findings on a diff or PR, and a PR description → whichever review or PR-writing skill is installed (for example `code-review` or `pr`) supplies the substance; render it with `references/code-review-and-pr.md`. The PR body posted on the forge stays markdown; the HTML page is the shareable companion for reviewers.
## When to stay in markdown
Markdown still wins for:
- Short conversational replies inside chat.
- Code-only outputs (a function, a config block, a one-liner).
- Terminal/command-flavored answers ("run this, then that").
- Quick three-bullet summaries the reader will scan once and discard.
- Prefer Markdown for files that will be hand-edited or regularly diffed in version control. Generate a companion HTML view if it helps review.
## Universal rules for every HTML artifact
Every artifact this skill produces must satisfy all of these:
1. **Single self-contained `.html` file.** No build step, no bundler, no `npm install`. CSS goes in a `<style>` tag, JS goes in a `<script>` tag, images are inline SVG or data URIs.
2. **Works offline, inline-first.** No required network calls at view time: ship CSS, JS, SVG, and fonts inline in the single file with no external CDN dependencies. If a library is needed while drafting, pin the exact version with `integrity` and `crossorigin` from cdnjs or the jsDelivr npm endpoint, then inline it before delivery. Avoid third-party web fonts in shared files; use system stacks.
3. **Mobile responsive.** Include `<meta name="viewport" content="width=device-width, initial-scale=1">` and a layout that survives a 390 px viewport, where only wide tables, code and figures scroll sideways, each inside its own box. The reader may open it on a phone.
4. **Real layout, not stacked headers.** If the content is a comparison, lay it out in columns. If it's a timeline, draw a timeline. If it's a diff, render a diff. Don't translate markdown structure 1:1 into HTML — that's wasted effort.
5. **Readable on its own.** Title at the top, a one-paragraph TL;DR or framing sentence right below, then the substance. The reader should know what they're looking at within five seconds.
6. **Tasteful by default.** A neutral but considered design: legible serif or sans body, comfortable line length, generous spacing, restrained color, dark-mode-friendly if cheap. Resist the default-AI aesthetic of "everything is a card with a gradient." See `references/matching-your-style.md` for document defaults and existing design systems.
7. **Editors export back to text.** This one is non-negotiable for any artifact where the reader manipulates state. The artifact must end with a "copy as markdown" / "copy as JSON" / "copy as prompt" button that turns the UI state into something pasteable. The whole point of a throwaway editor is the round-trip.
8. **Accessible and safe.** Set `lang`, use semantic landmarks (`header`/`main`/`nav`/`footer`), keep contrast readable, label every control and give every figure `alt` text or a caption. Keep every interaction keyboard-operable with a visible focus style, honor `prefers-reduced-motion`, give each figure unique IDs, offer a keyboard or button alternative to drag and swipe, and redact secrets and personal data before sharing.
9. **Demos that take input are tools.** A demo, calculator, parser or editor that takes input from the reader, a file, a URL or a model follows these:
- **Text** reaches the page through `textContent` or an escape helper, never `innerHTML`. Text written into a generated format (YAML, JSON, Markdown, code) is escaped for that format; parse one sample of each export before delivery.
- **Numbers** pass through one parse helper. It reads `1.234,50` and `1234.50`, takes the decimal separator from the values, never from the field separator, and accepts a cell only when it is non-empty and all of it parses (`Number()`, not `parseFloat`). A visible message names the rejected fields or rows. Every computed result passes `Number.isFinite` before it is shown; `NaN`, `∞` or a degenerate case such as zero variance shows an inline message instead.
- **State** from the previous run, load or error is cleared before the next one: sort keys, selections, results and messages. A toggle changes how the input is used and leaves the stored input as it was.
- **Touch** keeps the page scrollable: a swipe that starts on a chart or canvas still scrolls it (`touch-action: pan-y` unless the figure needs drags), and a tap, not `pointerdown`, adds a point.
- **API keys** stay in memory when the page shares its origin with other pages, as every page in the learning gallery does: there, one injectable page can read every key in `localStorage`.
## Category index
Before drafting, read `references/matching-your-style.md` for every artifact, alongside its category reference: it holds the default look when no style exists and the steps for adopting one that does. Then pick exactly one row below. Choose by what the page is built around, not by the verbs in the request; "explain" or "compare" alone fits several rows.
| The page is built around… | Typical requests | Read… |
|---|---|---|
| Two or more candidates side by side, or a plan for the one chosen | compare approaches, flows, or UI directions; brainstorm; implementation plan | `references/exploration-and-planning.md` |
| Code at file and line level that the reader reviews, changes, or navigates | annotated diff, code review, PR writeup, module map of a package | `references/code-review-and-pr.md` |
| One design to look at or click through | mockup, component sheet, design tokens, animation or interaction prototype | `references/design-and-prototypes.md` |
| How the parts of a system connect, drawn as boxes and arrows | how services fit together, request flow, deploy pipeline, figures for an article | `references/diagrams-and-illustrations.md` |
| How or why something works, or what happened, in prose sections | concept or feature explainer, onboarding material, status report, incident timeline, post-mortem | `references/reports-and-research.md` |
| Slides presented in sequence | deck, arrow-key presentation, talk | `references/decks.md` |
| Controls that change state and export it back as text | triage or reorder board, flag toggles, prompt tuner, dataset curator | `references/custom-editors.md` |
When two rows still seem to fit, these tie-breaks decide:
- **Code, system, or concept.** Code the reader reviews, changes, or walks file by file → `code-review-and-pr`. How the parts of a system connect (services, pipelines, request paths) → `diagrams-and-illustrations`. How or why something works, for a learner → `reports-and-research`; an explainer that contains a figure stays there.
- **Several candidates or one.** Two or more candidates to choose between → `exploration-and-planning`, even when each candidate is a mockup or a flow. One design to build out → `design-and-prototypes`.
- **State the reader changes.** If the reader manipulates the page and exports the result → `custom-editors`, even when it lays items out side by side.
If the request asks for several deliverables (e.g., "implementation plan with mockups and a flowchart"), read the reference for each. They're short.
## Output mechanics
### Writing a file to disk
Save to the working directory with a descriptive `kebab-case` name and a `.html` extension. Examples: `onboarding-design-explorations.html`, `pr-streaming-review.html`, `cycle-14-triage.html`. After saving, tell the user the path and offer to open it in their default browser (`open <file>` on macOS, `xdg-open <file>` on Linux). The user may want to upload it somewhere shareable — that's their call, but mention the option once.
If the artifact is a member of a *web* of related files (explorations → mockups → plan), put them in a folder together so they can be opened/shared as a unit.
### Rendering into an inline preview
Some runtimes render a document inline next to the conversation instead of writing it to disk. Emit a single `text/html` document — not a component framework, not a bare diagram, not SVG-only — unless the request specifically calls for one of those. It is the closest analog to the file on disk and gives the user the same affordance: open, screenshot, share.
Sandboxed preview panes are stricter than a local file. Guard storage access with try/catch and an in-memory fallback instead of assuming `localStorage`/`sessionStorage` exists, keep everything in one file, and load no external scripts beyond whatever the host allows. Some runtimes render a single self-contained file with storage possibly unavailable, so the guarded in-memory fallback above is the portable default.
### Publishing to the learning gallery (on request only)
The learning gallery is the user's public repository `fabiandistler/tools`, served at `https://fabiandistler.github.io/tools/`; the user calls it the tools repo. A page goes there only when the user asks for it.
1. **Check the content.** The repository is public and a merge publishes the page, so it carries only generic or synthetic data. When it holds employer, client or person data, stop and ask before committing.
2. **Add the file.** In a clone of the repository, branch from `main` and write the full document to the repository root as `<kebab-case-name>.html`. The gallery's index lists every root `.html` file on its own, so it needs no edit.
3. **Open a pull request** against `main`. Use the GitHub MCP tools if the session has them; otherwise `gh api repos/fabiandistler/tools/pulls -f title=<title> -f head=<branch> -f base=main -f body=<body>`. The user merges, and the merge deploys.
4. **Hand back both links:** the pull request and the page's address after the merge, `https://fabiandistler.github.io/tools/<kebab-case-name>.html`.
## A note on token cost and time
HTML artifacts cost roughly 2–4× the tokens of a markdown equivalent and take longer to generate. Account for that cost when deciding whether a deliverable warrants HTML; a disposable iteration such as "summarize this file" usually does not.