Catalogue / create-prototype
create-prototype
MITSignedBuild a clickable, final-fidelity HTML prototype of an agreed UI change inside the app's real shell, with a floating state panel, and open it in the browser for review. Use when a UI change is agreed and the user wants to click through it before it is built.--- name: create-prototype description: "Build a clickable, final-fidelity HTML prototype of an agreed UI change inside the app's real shell, with a floating state panel, and open it in the browser for review. Use when a UI change is agreed and the user wants to click through it before it is built." disable-model-invocation: true argument-hint: "[feature or page]" ---
create-prototype
One interactive HTML page: the agreed feature, page, or revamp at final fidelity, inside the app's real shell, every in-scope control working, plus a floating state panel that flips each component through its states. The user reviews it and asks for changes until satisfied. Every change updates the same file and the same local URL.
1. Scope contract
Read the conversation, create ${CODEX_HOME:-$HOME/.codex}/artifacts/prototype/<slug>/, and write scope.md there: the screens, components, and actions, with the states of each (loaded, loading, empty, error, disabled, invalid, submitting), plus the global ones the app has (toast, theme, role). Each line is one thing the user can click or see. "Billing page" is an intent; "plan card with an Upgrade button that opens a confirm dialog" is a line. Done when every line is concrete. A conversation that gives only an intent: stop, list what is missing, and name /grill as the way to settle it. Generated files stay outside the repository unless the user asks for a repository path.
2. Visual truth
Screen references. Look in this session's tools for one that gives screens and flows from real apps, such as the Mobbin MCP. Search it for the screens and flows in scope.md, as in "billing page" or "upgrade flow", and keep the three to five that fit best. tokens.md keeps them in its own ## References part, each as the app, the screen, and its link; every later write to tokens.md keeps that part. No such tool, or one that fails or asks for a login: go on with no references.
Existing app. Start with DESIGN.md and PRODUCT.md when the repo has them. They hold the settled tokens and product context: copy from them first, and read the code only for what they leave out. Where they disagree with the code, the shipped code wins. Then read the real files and copy values, not impressions:
- Shell: root layout, sidebar, header, nav labels in order, active-item style, content width and padding.
- Tokens: colors, font family and scale, radius, shadows, spacing. Usually the tailwind config,
globals.css, or a theme file. - Primitives the scope uses: button, input, select, dropdown, tabs, table, dialog, toast, skeleton or spinner, empty state, error banner. Copy the app's own version of each, copy tone included.
- Icons: the app's icon set, as inline SVG paths.
- Theme: both when the app ships both. Responsive: only when the app is. Roles: a role row when the app renders differently per role.
Write the findings to tokens.md next to scope.md. The references shape only layout and flow here; every value comes from the app. The repo stays untouched.
From scratch. No existing app to copy. With impeccable installed, load it and pick a direction from its design guidance and the references. Without it, take the direction from the references and the project's design system, or from your own judgement when neither exists. Record the direction in tokens.md.
3. Build
Use impeccable for the visual implementation when it is installed, then write one file at ${CODEX_HOME:-$HOME/.codex}/artifacts/prototype/<slug>/<slug>.html. That path holds for the life of the prototype, so follow-up changes update the same page.
- The real shell wraps the feature. Shell areas outside the scope are present with real labels and stay static.
- Every scope line works: a dropdown opens and the choice changes what shows; tabs switch; a form validates in the app's error style; a dialog opens, closes, and closes on Esc; a toast appears and dismisses; the right nav item is active; hover, focus, and disabled are styled.
- Data looks real: domain names, plausible numbers, the app's date and currency format.
- A multi-screen flow is one page with in-page screens, switched by the app's own navigation.
- State panel: inline
state-panel.js(next to this file) in a<script>and init it with one row per scope line that has more than one state, plus the global rows. Rendering reads from the panel state. An in-app action that changes a state callsStatePanel.set, so the panel stays true. - The HTML is self-contained: local CSS, JavaScript, and SVG inline; a remote CDN only when it is needed and safe for the user's environment.
4. Verify
Serve the prototype folder on 127.0.0.1 (python3 -m http.server 8765 --bind 127.0.0.1) and check the page in a hidden browser, one the user does not see; file:// is not the review path. Port 8765 taken: pick another free port and leave the running process alone. Check it per ../../shared/harness.md, row Check a page in a hidden browser, with session prototype-<slug>, from the prototype folder. That browser is the agent's, not the user's: once the checks below pass, also open the page in the user's own browser, open "<url>" on macOS or xdg-open "<url>" on Linux, and again after every rebuild. Walk scope.md line by line: a fresh snapshot for the element refs before each click, since a re-render changes them, then click <ref> on it, flip its panel row through every option, and read console after each. screenshot --filename <path> for desktop; when the app is responsive, resize 375 812 and a second screenshot for mobile. Fix everything in one batch, then confirm in at most one more round. Done when every scope line and every panel option has run with zero console errors. playwright-cli's open fails, or no browser tool: walk scope.md against the HTML by reading it, one render branch per panel row.
5. Deliver and iterate
Open http://127.0.0.1:<port>/<slug>.html in the browser and leave the finished page up for the user. Copy the local URL to the clipboard with ../../shared/copy.sh; on any other exit than 0, say Clipboard copy skipped. Reply with the local URL, the HTML file path, scope.md as a checklist, which data is fake, what is out of scope, and that the backtick key hides the panel.
On each change request, edit the same file, re-verify only the changed lines, reload the same local URL, and copy it again with copy.sh. A later session continues from the same file path.
Headless host (command -v open xdg-open finds neither): there is no browser to leave the page in. Skip the local URL. Publish the page with the to-artifact skill and reply with the artifact link in place of the URL. A change request republishes to the same artifact. Publish fails: say why, give the HTML file path, stop.
| File | Size | SHA-256 |
|---|---|---|
| README.md | 2.0 kB | 615069db7044 |
| SKILL.md | 6.8 kB | 2d61207e4d0c |
| SKILVAULT_SOURCE.json | 1.4 kB | a1101c45f7cc |
| THIRD_PARTY_NOTICES.md | 1.1 kB | 02d2bd541e78 |
| agents/openai.yaml | 184 B | 86cb15d8ffb6 |
| state-panel.js | 7.8 kB | 74451682f160 |
Published verbatim from the pinned commit. Nothing is rewritten.
| Version | Pinned commit | Signed | |
|---|---|---|---|
| 0.1.0 Current | dbd22745e139 | 29 Nov 2026 |
Locking a skill to one version needs Pro.