mcpField
P
prototype

prototype

github.com/ryanthedevDesign & UI32552 installsUpdated 17w ago
Repository

About prototype

A design skill that turns design tokens and page specifications into a self-contained HTML mockup for designers and teams checking page structure or styling before implementation. It supports styled and wireframe output, with optional browser rendering and screenshots through browser MCP.

Key features

  1. 01Token-based styled mockups
  2. 02Greyscale wireframe output
  3. 03Single-file HTML artifacts
  4. 04Reduced-motion and touch-target rules
  5. 05Optional browser rendering and screenshots

Use cases

  1. 01Preview a JOURNEY.md page specification
  2. 02Check design tokens before production coding
  3. 03Create a screenshot for design review

MCP support

When browser MCP is connected, the skill uses it to open the local HTML file and capture a screenshot. If it is unavailable, it still produces the HTML artifact.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/ryanthedev/design-for-ai --skill prototype

After installing, type/prototypein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

examples/
sample-DESIGN.md
sample-mock.html
references/
mock-recipe.md

Details

From the project README

Prototype turns design tokens and page specs into a viewable artifact — a single self-contained .html file that opens in any browser with no build step.

When this applies

  • "Show me what it looks like" / "make a mock" / "build a prototype" / "render a wireframe"
  • Visualizing a page from a JOURNEY.md page spec
  • Checking token application before writing production code
  • Supplying a screenshot for the design-review-agent to critique

Procedure

1. Gather inputs

Collect three inputs:

InputSourceIf absent
TokensDESIGN.md at the project root (the CSS custom-property block from palette.mjs)Wireframe mode: greyscale defaults
Page specJOURNEY.md page spec section, or user descriptionScaffold a generic page skeleton
FidelityUser request; "wireframe" = structure only, "styled" = full tokensDefault to styled when DESIGN.md present, wireframe when not

If DESIGN.md is absent, note it and proceed in wireframe mode — emit the .html with a comment: <!-- No DESIGN.md found — wireframe mode: greyscale defaults. Run /design-for-ai to establish tokens. -->.

2. Build the mock

Load references/mock-recipe.md. Follow the recipe for the chosen fidelity:

  • Wireframe: HTML structure + CSS custom properties defaulting to greys; semantic sectioning (<header>, <main>, <nav>, <section>, <aside>, <footer>); placeholder labels ([Hero headline], [Body copy], [CTA]); no color, no imagery.
  • Styled: All DESIGN.md tokens applied to :root as CSS custom properties; type scale, color, spacing, and surface constraints from DESIGN.md honored. Webfont <link> included when DESIGN.md names one.

Both fidelities: single file, all CSS in <style>, prefers-reduced-motion media query suppressing transitions, touch targets ≥44×44px on mobile surfaces, semantic HTML.

Write the file to <project-root>/mocks/<page-name>.html (create mocks/ if needed), or to ./mock.html when no project root is clear.

3. Render and screenshot (graceful protocol)

When the browser MCP is connected:

  1. browser_connect(mode: "launch", channel: "chrome", headless: true) — or reuse existing connection.
  2. browser_navigate(url: "file://<absolute-path-to-html>", allow_internal: true) — local file render; allow_internal is required.
  3. browser_screenshot() — returns {path} (a PNG).
  4. Dispatch a Haiku subagent to read the PNG and return a text summary (payload discipline: large artifact stays out of main context).
  5. Return: the .html path, the screenshot path, and the Haiku summary.

When the browser MCP is not connected (graceful fallback):

Emit the .html path and note: "Open <path> in your browser to view — browser MCP not connected so no screenshot was captured." No error. The mock is still the deliverable.

Detection: if browser_connect fails, fall to the fallback. Never block on MCP availability.

4. Handoff

Suggest running /design-for-ai:mock (which dispatches the design-review-agent) to critique the rendered result, or build for a full gated review.

References

Reference fileLoad when
references/mock-recipe.mdBuilding any mock — the HTML/CSS recipe, token mapping, surface-constraint table, fidelity specs, and prefers-reduced-motion rule

Comments

Markdown supported