---
name: html-prototype-build
description: Build, annotate, review, screenshot, and deliver native HTML UI prototypes with AI agents using reusable UI packs, DOM-bound product annotations, in-browser Direct Edit, browser review pins, a local authoring server, an element-to-source Inspector, and multi-state screenshots. Use when the user mentions /html-prototype-build or asks to reconstruct UI in HTML, create product annotations, edit prototype styles, review or mark DOM elements, capture prototype states, package prototype deliverables, or add components to the module sketch board. Works with Claude Code, Codex, Cursor, and other Agent Skills clients; do not use for generic source-code navigation, ordinary documentation, or production frontend development.
title: html-prototype-build
canonical_url: https://skilld.dev/gh/lisuiwen/ai-html-annotation/html-prototype-build
last_updated: 2026-10-13T21:01:17.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> 61 supporting files sit beside this SKILL.md. When the Skill refers to one, fetch https://skilld.dev/api/skills-raw/lisuiwen/ai-html-annotation/html-prototype-build/PATH with PATH replaced.
>
> If the user asked to install this Skill, run `npx skilld install lisuiwen/ai-html-annotation/html-prototype-build`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/html-prototype-build`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/lisuiwen/ai-html-annotation/html-prototype-build) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/html-prototype-build`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/html-prototype-build --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/html-prototype-build --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# HTML Prototype Build

## Quick start

1. Confirm the prototype type and business facts from the user's materials; ask first when information is insufficient, do not guess.
2. When generating or heavily changing UI, run `node <skill-root>/scripts/resolve-pack.mjs --list`, then `node <skill-root>/scripts/resolve-pack.mjs --pack=<pack-id> --select=<preset, pattern, or component id>` and read only the minimal file closure it outputs.
3. Generate the complete `<prototype-name>/` delivery directory per [shared generation contract §7](https://skilld.dev/api/skills-raw/lisuiwen/ai-html-annotation/html-prototype-build/references/generation-contract.md#7-delivery-files); route all business state through `PrototypeViewers`, and use the Runtime copy as-is for the formal Client Runtime.
4. When done, run `npm test` at the repository root; start the authoring server or scenario screenshots only when the task needs them.

## Route the task first

Read only the entry that matches the current task; do not read all references at once:

| User goal | Required entry | Main output or tool |
|---|---|---|
| Generate, rebuild, or heavily change UI | [UI generation](https://skilld.dev/api/skills-raw/lisuiwen/ai-html-annotation/html-prototype-build/references/ui-generation.md) | HTML prototype and on-demand UI components |
| Install or download missing UI packs | [Pack install](https://skilld.dev/api/skills-raw/lisuiwen/ai-html-annotation/html-prototype-build/references/pack-install.md) | `scripts/install-pack.mjs` |
| Understand Viewer, note cards, SVG connectors, or interaction lightning | [Product annotations](https://skilld.dev/api/skills-raw/lisuiwen/ai-html-annotation/html-prototype-build/references/product-annotations.md) | snapshot + Client Runtime |
| Start the authoring environment, direct edit, edit notes, or jump to source | [Local authoring](https://skilld.dev/api/skills-raw/lisuiwen/ai-html-annotation/html-prototype-build/references/local-authoring.md) | `runtime/server/index.mjs` + Author Tools |
| Add or change a sketch-board component | [Sketch board components](https://skilld.dev/api/skills-raw/lisuiwen/ai-html-annotation/html-prototype-build/references/sketch-board.md) | pack `manifest.json` `atoms` + `data-pack-atom` |
| Add review pins to a page, export For AI | [Review mark](https://skilld.dev/api/skills-raw/lisuiwen/ai-html-annotation/html-prototype-build/references/review-mark.md) | `runtime/author/tools/mark/` |
| Batch screenshots by page state | [Scenario screenshots](https://skilld.dev/api/skills-raw/lisuiwen/ai-html-annotation/html-prototype-build/references/screenshots.md) | `runtime/cli/screenshot.mjs` |
| Prepare final files | [Delivery & iteration](https://skilld.dev/api/skills-raw/lisuiwen/ai-html-annotation/html-prototype-build/references/delivery.md) | Final delivery files |
| Final check before delivery | [Delivery checklist](https://skilld.dev/api/skills-raw/lisuiwen/ai-html-annotation/html-prototype-build/references/delivery-checklist.md) | Per-item checkboxes |

When generating or heavily changing UI, read the [shared generation contract](https://skilld.dev/api/skills-raw/lisuiwen/ai-html-annotation/html-prototype-build/references/generation-contract.md) first; for other tasks read the matching entry above without reading the full contract.

For visual tasks, discover packs, pick a foundation and providers via the [UI pack catalog](https://skilld.dev/api/skills-raw/lisuiwen/ai-html-annotation/html-prototype-build/ui/catalog.md), resolve the minimal closure, and follow the [consumer pack rules](https://skilld.dev/api/skills-raw/lisuiwen/ai-html-annotation/html-prototype-build/ui/contract.md). When no pack is installed, follow [Pack install](https://skilld.dev/api/skills-raw/lisuiwen/ai-html-annotation/html-prototype-build/references/pack-install.md).

`scripts/` holds the agent's deterministic tools. `runtime/` is split by execution boundary: `client/` formal browser runtime, `author/` browser authoring tools (including the sketch board), `server/` local Node authoring service, `cli/` standalone command-line tools. Only `runtime/client/` is copied into a prototype. `runtime/author/`, `runtime/server/`, and `runtime/cli/` stay in the skill.

## Terminology

- **`ponytail:`** — in-place comment marking an intentional prototype shortcut or uncollected state; replace it after you have real screenshots, computed styles, or interaction evidence.
- **Project materials** — screenshots, requirements, and confirmed facts for the current task (not generic framework defaults).

## Core boundaries

- Every prototype must use the distributed copies of `runtime/client/core/display-mode.js`, `runtime/client/core/state.js`, `runtime/client/notes/model.js`, `runtime/client/notes/viewer.js` in order; `state.js` provides the single `PrototypeViewers` state source, `model.js` handles only note scenario metadata and pure `when` matching, and Notes Viewer handles only DOM/connector rendering. Do not fold these responsibilities back into the Viewer.
- Formal notes are written back to `prototype/notes.snapshot.js` only through `runtime/server/index.mjs` + Notes editor; do not inline a notes editor in `prototype.html` and do not store formal notes in localStorage.
- Mark is a temporary review tool in the Author Tools panel alongside Direct edit; its data goes to page-path-scoped localStorage, is never written to the snapshot, and is not injected into the source HTML.
- Direct edit previews in the authoring session only and writes back to the source HTML safely through the server.
- The authoring service only handles local editing and in-prototype source lookup; it never enters the source HTML or the final deliverable.
- The sketch board in `runtime/author/sketch/` is an authoring-session page. Do not copy it into `<prototype-name>/`.
- Screenshots consume only the URL scene and formal annotation data; they do not generate business state.
- System names, menus, fields, states, and business data must come from the user's materials; ask when information is unclear, never guess.
