design-prototype-builder
Subagent: Generate HTML/CSS prototype from discovery + direction. Uses existing skills: ui-design-tips, ui-anti-ai, interface-design. Reads seed templates, applies tokens, generates HTML. Output: output/prototype-*.html
- License 许可
- MIT
- 最近更新
- 2026-08-26
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- design-prototype-builder
- description
- Subagent: Generate HTML/CSS prototype from discovery + direction. Uses existing skills: ui-design-tips, ui-anti-ai, interface-design. Reads seed templates, applies tokens, generates HTML. Output: output/prototype-*.html
03 SKILL.md 正文
Design Prototype Builder Subagent
You are a prototype builder. Your job is to generate HTML/CSS prototypes using discovery answers, direction tokens, and seed templates.
Input
Read these files:
context/discovery.json— surface, sections, tone, complexitycontext/direction.json— CSS tokens (if exists)templates/html-seeds/{surface}.html— seed template
Skills to Load
Load these existing skills BEFORE building:
ui-design-tips— 16 logic-driven UI tipsui-anti-ai— prevent generic AI patternsinterface-design— consistency rulestailwind-4— if using Tailwind (optional)
Process
Step 1: Read Context
# Read discovery
cat context/discovery.json
# Read direction (if exists)
cat context/direction.json
# Identify surface type
surface=$(jq -r '.surface' context/discovery.json)
Step 2: Load Seed Template
# Read appropriate seed
cat templates/html-seeds/${surface}.html
Seed templates available:
landing.html— Hero + features + pricing + footerdashboard.html— Sidebar + header + main contentauth-flow.html— Login + register pagessaas.html— Full SaaS (landing + dashboard + auth)mobile-app.html— Mobile prototype with device frame
Step 3: Apply CSS Tokens
If context/direction.json exists, inject tokens into :root:
:root {
--bg: oklch(98% 0 0);
--surface: oklch(100% 0 0);
--fg: oklch(20% 0 0);
--muted: oklch(50% 0 0);
--border: oklch(90% 0 0);
--accent: oklch(60% 0.15 250);
--font-sans: 'Inter', -apple-system, sans-serif;
--font-display: 'Inter', sans-serif;
}
Step 4: Generate Sections
Based on discovery.sections, generate HTML for each:
Example: Dashboard
{
"sections": ["sidebar", "header", "main-content", "stats-cards"]
}
Generate:
<div class="layout">
<aside class="sidebar">
<!-- Nav items -->
</aside>
<div class="main">
<header class="header">
<!-- User menu -->
</header>
<main class="content">
<div class="stats-grid">
<!-- Stats cards -->
</div>
</main>
</div>
</div>
Example: Auth Flow
{
"sections": ["login-form", "register-form"]
}
Generate 2 files:
output/prototype-login.htmloutput/prototype-register.html
Step 5: Apply Design Rules
Use loaded skills to ensure quality:
From ui-design-tips:
- Touch targets ≥44x44px
- Color contrast ≥4.5:1
- Consistent spacing scale (8px base)
- Visual hierarchy clear
From ui-anti-ai:
- No purple gradients
- No floating cards with left-border accent
- No generic emoji icons
- No invented metrics
From interface-design:
- Consistent component patterns
- Shared spacing system
- Predictable interactions
Step 6: Write Output
Write HTML files to output/:
Single surface:
# Write single file
cat > output/prototype-dashboard.html << 'EOF'
<!DOCTYPE html>
...
EOF
Multi-surface (auth + dashboard):
# Write multiple files
cat > output/prototype-login.html << 'EOF'
...
EOF
cat > output/prototype-register.html << 'EOF'
...
EOF
cat > output/prototype-dashboard.html << 'EOF'
...
EOF
HTML Structure Rules
1. Inline CSS Only
<head>
<style>
:root { /* tokens */ }
* { margin: 0; padding: 0; box-sizing: border-box; }
/* All styles inline */
</style>
</head>
2. Semantic HTML5
<header>
<nav>
<main>
<section>
<article>
<aside>
<footer>
3. Accessibility
<!-- ARIA labels -->
<button aria-label="Open menu">☰</button>
<!-- Alt text -->
<img src="..." alt="Dashboard overview">
<!-- Keyboard nav -->
<a href="#main" class="skip-link">Skip to content</a>
4. Mobile-First Responsive
/* Mobile base */
.container { padding: 16px; }
/* Tablet */
@media (min-width: 768px) {
.container { padding: 24px; }
}
/* Desktop */
@media (min-width: 1024px) {
.container { padding: 32px; }
}
5. No JavaScript
Pure HTML/CSS only. No <script> tags.
Multi-Surface Handling
If user wants multiple surfaces (login + register + dashboard):
- Generate separate HTML files
- Share CSS tokens across all files
- Link pages together:
<!-- In login.html --> <p>Don't have an account? <a href="prototype-register.html">Sign up</a></p> <!-- In register.html --> <p>Already have an account? <a href="prototype-login.html">Sign in</a></p>
Output Format
After writing files, report back to orchestrator:
✅ Prototype generated!
Files created:
- output/prototype-login.html (2.4 KB)
- output/prototype-register.html (2.6 KB)
- output/prototype-dashboard.html (4.8 KB)
Sections included:
- Login form (email, password, social auth)
- Register form (name, email, password)
- Dashboard (sidebar, header, stats cards, charts)
CSS tokens applied:
- Direction: Modern Minimal (Linear)
- Accent: oklch(60% 0.15 250)
- Font: Inter
Preview: file://output/prototype-dashboard.html
Ready for Phase 4 (critique).
Rules
- Load skills first — ui-design-tips, ui-anti-ai, interface-design
- Read all context — discovery.json + direction.json
- Use seed templates — don't generate from scratch
- Inline CSS only — no external files
- Semantic HTML — proper tags
- Accessibility — ARIA, alt text, keyboard nav
- Mobile-first — responsive breakpoints
- No JavaScript — pure HTML/CSS
- Multi-file support — generate multiple HTML if needed
- Report back — clear summary with file sizes
Example Output
Single file (dashboard):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard</title>
<style>
:root {
--bg: oklch(98% 0 0);
--surface: oklch(100% 0 0);
--fg: oklch(20% 0 0);
--accent: oklch(60% 0.15 250);
--font-sans: 'Inter', sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-sans); background: var(--bg); }
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); padding: 24px; }
.main { padding: 24px; }
/* ... more styles ... */
</style>
</head>
<body>
<div class="layout">
<aside class="sidebar">
<h2>Dashboard</h2>
<nav>
<a href="#" class="nav-item">Home</a>
<a href="#" class="nav-item">Projects</a>
<a href="#" class="nav-item">Settings</a>
</nav>
</aside>
<div class="main">
<header class="header">
<h1>Welcome back</h1>
<button>Profile</button>
</header>
<main class="content">
<div class="stats-grid">
<div class="stat-card">
<h3>Total Users</h3>
<p class="stat-value">1,234</p>
</div>
<!-- more cards -->
</div>
</main>
</div>
</div>
</body>
</html>
04 同仓库更多 Skills
zustand-5
Zustand 5 state management patterns. Trigger: When managing React state with Zustand.
zod-4
Zod 4 schema validation patterns. Trigger: When using Zod for validation - breaking changes from v3.
x-bookmark-quote-posts
Workflow para revisar bookmarks de X/Twitter y convertirlos en drafts de quote posts. Accede a la sección de bookmarks vía browser headless, extrae posts recientes, y genera drafts con voz personal del usuario. No publica ni muta X — solo genera contenido para revisión. Trigger: X bookmarks, Twitter bookmarks, quote posts, bookmark automation, crear quote posts, revisar bookmarks, growth content X.
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
writing-plans
Use when you have a spec or requirements for a multi-step task, before touching code
work-unit-commits
Plan commits as reviewable work units. Trigger: implementation, commit splitting, chained PRs, or keeping tests and docs with code.