plugins/spectre/skills/prototype/SKILL.md
👻 | Generate a self-contained HTML prototype to validate a feature visually before planning - primary agent
npx skillsauth add codename-inc/spectre prototypeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Treat the current command arguments as this workflow's input. When invoked from a slash command, use the forwarded $ARGUMENTS value.
Produce a self-contained, clickable HTML artifact that makes a feature visible — resolving ambiguity before scope, validating flows before plan, or anchoring stakeholder review. Output: single portable HTML file the user can open locally or host anywhere, saved to {OUT_DIR}/prototypes/{name}_{MMDDYY}.html.
<ARGUMENTS> $ARGUMENTS </ARGUMENTS>
Detect mode from environment markers, ARGUMENTS, and existing docs. Order matters — check from most context to least:
/spectre:plan or /spectre:create_tasks.FROM_UX=true — invoked mid-flow from ux Stage 1 → Stage 2 gate. Only approved flows exist (no detailed spec yet). Skip flow-discovery intake. Default fidelity: mid-fi. On completion, point user back to ux Stage 2.--explore flag in ARGUMENTS — pre-scope discovery. Concept is unvalidated. Default fidelity: low-fi. On completion, recommend /spectre:scope as next step./spectre:ux or /spectre:plan based on feature complexity.Goal: Confirm what we're prototyping, at what fidelity, and what visual anchor to use. Keep this tight — 2 to 4 questions, never a form.
FROM_UX=true → acknowledge ux context, read approved flows from {OUT_DIR}/ux.md, SKIP to Step 3FROM_UX=true.Action — DetectExistingDocs: Check for relevant inputs before asking the user anything.
branch_name=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo unknown)docs/tasks/{branch_name}/concepts/scope.md, docs/tasks/{branch_name}/specs/prd.md, docs/tasks/{branch_name}/ux.mdAction — ClassifyUxDoc: If ux.md exists, classify its completeness — this drives fidelity AND how much intake to skip.
/spectre:ux). Treat as authoritative. Skip flow-discovery questions. Set mode = post-ux.Pick fidelity from signals available:
| Signal present | Recommends |
|---|---|
| --explore flag, or no scope/prd | Low-fi — grayscale, layout-only, no typography polish |
| scope.md exists, no design system anchor | Mid-fi — real colors, basic type, simplified components (default) |
| scope.md + flows-only ux.md, or brand/design system anchor | Mid-fi to High-fi — depends on anchor strength |
| Complete ux.md (post-ux) | High-fi — full design tokens, realistic data, micro-interactions; render the spec faithfully |
Post-ux mode (complete ux.md) — present a tight confirmation, ask one question:
Prototype plan — rendering complete UX spec
Source:
{path to ux.md}({N} screens, {M} components, {K} states specified) Fidelity: high-fi (default — full spec is on disk; I'll render it faithfully, not invent)One thing I need: visual anchor — brand colors, font stack, an existing app/URL to match, or a named aesthetic (e.g. "Linear-style", "Notion-quiet", "Stripe-clean"). If the spec already specifies design tokens, reply "use the spec." If you skip this, I'll commit to a deliberate named aesthetic and call it out at the top of the file.
All other modes — present recommendation + request anchor + confirm framing:
Prototype plan
I'm reading this as: {inferred feature/flow} Recommended fidelity: {low-fi | mid-fi | high-fi} — {one-line reason} Primary flow: {name} (from {scope.md | ux.md flows | your description})
Two things I need from you:
- Override fidelity? Or "looks good."
- Visual anchor — brand colors, font stack, an existing app/URL to match, or a named aesthetic (e.g. "Linear-style", "Notion-quiet", "Stripe-clean"). If you skip this, I'll commit to a deliberate named aesthetic and call it out at the top of the file so you can redirect.
Wait for response. If user pushes back on fidelity or feature framing, adjust and re-confirm.
Gate: Only proceed after Stage 1 confirmation (or FROM_UX=true).
Spawn three subagents in parallel. Each has a focused job.
@spectre:web-research — Visual Reference DiscoveryPrompt template:
Research visual design patterns and UI conventions for {feature type}. Specifically:
- Find 2–3 living examples or screenshots of similar UI patterns in well-regarded products. Return URLs and visual descriptions.
- Identify the established UX convention for this interaction type (wizard, dashboard, list+detail, modal flow, etc.) and any recent (2025–2026) refinements.
- If the user specified an aesthetic anchor ({anchor_text}), find representative color palettes (hex), typography choices (font families with fallbacks), and one or two distinctive design moves that define the aesthetic.
- Return concrete decisions — colors, fonts, layout patterns — not general advice.
Length: under 400 words. Cite sources.
Why: Grounds generation in specific references. Without this step the model defaults to its own distribution (Inter + purple gradients). This is the anti-slop forcing function.
@spectre:analyst — Flow & Content ExtractionUse one of two prompt templates based on mode detected in Step 2.
Extraction mode — post-ux (complete ux.md present):
Read {path to ux.md} fully. The Stage 2 spec is authoritative — your job is to extract structured data for HTML rendering, NOT to synthesize new screens, states, or content.
Return a render brief organized by ux.md section:
- Screens — verbatim from the Screens section: name, purpose, navigation relationships
- Layouts — verbatim from Layouts: per-screen header/main/footer + responsive breakpoints
- Components — verbatim from Components: each element's purpose, location, all documented states (default, hover, active, disabled, loading, error)
- Interactions — verbatim from the Interactions table: Element | Action | Result
- States — verbatim from the States table: State | Trigger | Appearance | Available Actions
- Content — verbatim copy from the Content section: page titles, button labels, empty-state messages, error messages, confirmation dialogs. Use this copy EXACTLY in the prototype — do not paraphrase.
- Edge cases & a11y — note any documented constraints (limits, null/long data, keyboard actions, focus management) the prototype should reflect
If the spec specifies a state or content value, the prototype must match it. If the spec is silent on a detail, flag it as a "filled assumption" so it appears in the prototype's metadata header. Never invent screens that aren't in the spec.
Synthesis mode — flows-only ux, scope-only, or standalone:
Read these documents fully: {list of paths — scope.md, prd.md, ux.md flows section if present}. Extract a content skeleton for an HTML prototype:
- Primary flow — entry → action → outcome, with decision points
- Required UI states per screen — every screen needs at minimum: happy path, empty state, error or edge state. Some screens also need: loading, success
- Stated constraints — any layout, behavior, or content constraints from the docs
- Realistic content — actual product names, plausible numbers, real-looking copy. NO Lorem ipsum. NO "Card Title." If domain-specific data is unclear, invent plausible values that match the feature's domain.
- Component inventory — every recurring UI element that will need a named CSS class (button, card, input, badge, etc.)
Return a structured flow brief: screen list, per-screen state list, realistic content for each, component inventory.
Why: This is the content skeleton. In post-ux mode, the spec already did this work — re-synthesizing risks contradicting documented decisions. In all other modes, skipping synthesis produces prototypes with Lorem ipsum and inconsistent component styling.
@spectre:patterns — Existing Codebase Anchor (only if applicable)Skip this agent if there is no existing app to anchor to. Otherwise:
Find existing UI patterns in this codebase that the prototype should match or extend: design tokens (colors, spacing, type), component conventions (button styles, card layouts), and any established interaction patterns. Return file references with the actual values (hex codes, class names, etc.) — not just paths.
Why: When prototyping inside an existing app, the prototype should look like a plausible new screen of that app, not a designer's blank canvas.
Wait for ALL subagents to complete. Synthesize their outputs, then generate a single self-contained HTML file. Use @spectre:dev to produce the file (or inline if the synthesis is straightforward).
File structure (every prototype includes these in order):
<!DOCTYPE html> + minimal <head> with <meta viewport> and an inline <style> block<head>:
<!--
SPECTRE PROTOTYPE
Feature: {feature name}
Fidelity: {low-fi | mid-fi | high-fi}
Generated: {YYYY-MM-DD}
Branch: {branch_name}
Flow covered: {primary flow}
Screens/states: {comma-separated list}
Visual anchor: {named aesthetic or reference URL}
Source spec: {path to ux.md if post-ux mode, else "none — synthesized from {scope.md | description}"}
Key assumptions: {bullet list of design decisions and content assumptions}
Filled assumptions: {only in post-ux mode — items the spec was silent on that the prototype filled in; review these against the spec}
NOT included: {explicit list of what was deliberately left out}
Next step: /spectre:plan OR resume /spectre:ux Stage 2
-->
<head>:
<!-- DESIGN TOKENS
Primary: #{hex}
Accent: #{hex}
Surface: #{hex}
Text: #{hex}
Font: {family}, served from {CDN or system}
Border-radius: {value}
Spacing unit: {value}
-->
Also encode these as CSS custom properties on :root so they're reusable in the stylesheet.display:block/none. No routing, no framework.<section> per screen. Every screen must include the happy path AND at least one of: empty state, error state, loading state. Skipping these is the most common prototype failure mode.<script> at end of body for interactions (tab switching, form submit interception, modal toggle, accordion). Vanilla JS only.Size budget: under 300KB. No base64 photos. No Chart.js or other large libraries. Use inline SVG and CSS-drawn shapes for any illustrations. Tailwind via CDN is acceptable for mid/high-fi; skip for low-fi.
Asset rules (keep the file portable so users can open locally, email it, host on a gist, or push to any static host):
<img src="https://..."> that can 404 — use inline SVG, data URIs, or CSS shapes./image.png, ../style.css) — they break the moment the file movesWhen delegating to @spectre:dev, the prompt MUST include these as forbidden patterns:
onclick, <form>, or interactive element must respond visually. No href="#" that causes page jumps. No event handlers that throw console errors.Action — DetermineOutputDir:
branch_name=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo unknown)FROM_UX=true or FROM_KICKOFF=true → use the existing task directoryOUT_DIR=docs/tasks/{branch_name}mkdir -p "$OUT_DIR/prototypes"Action — SaveArtifact: Write file to {OUT_DIR}/prototypes/{feature_slug}_{MMDDYY}.html
Before reporting completion, sanity-check the artifact against the portability rules:
<img src="http..."> external images./, ../, /local/)Surface any violations as caveats in the handoff. Don't silently ship a broken portable file.
Action — PresentForReview:
Prototype complete:
{path}({size} KB, {N} screens, {fidelity})Visual anchor: {named aesthetic} Key assumptions made (also embedded in file header):
- {bullet 1}
- {bullet 2}
- {bullet 3} NOT included: {explicit list}
Open the file in a browser to review (
open {path}on macOS, or drag into any browser tab). The file is fully self-contained — share it however you like (email, gist, static host, etc.). Reply with feedback to iterate, or pick a next step below.
Action — SurfaceFilledAssumptions (post-ux mode only): If mode = post-ux AND any filled assumptions exist (items the spec was silent on that the prototype filled in), append a closing-the-loop block:
Filled assumptions — ux.md was silent on these; I made calls to render the spec. Review and tell me which to promote into the spec:
- {assumption} → I chose {decision} ({why, one line})
- {assumption} → I chose {decision} ({why, one line})
- {assumption} → I chose {decision} ({why, one line})
Reply with numbers to update ux.md (e.g.
1, 3),allto add all, orskipto leave the spec as-is.
If user picks updates:
ux.md directly: place each chosen item in the appropriate section (Components / States / Content / Edge Cases / Interactions).ux.md ← added: {item} (in {section}).Action — RenderFooter: Render Next Steps using @skill-spectre:spectre-guide skill, with mode-specific recommendation:
FROM_UX=true → recommend: "Resume /spectre:ux Stage 2 with this prototype as input"--explore → recommend: /spectre:scope with the prototype as anchor/spectre:ux (if flows still need detail) or /spectre:plan (if ready to build)If the user replies with feedback after Step 7:
<head> includes feature, fidelity, assumptions, NOT-included list:roothref="#" jump links{OUT_DIR}/prototypes/{slug}_{MMDDYY}.htmltesting
👻 | Independent multi-lens review of plan.md and/or tasks.md — finds overengineering, missing verification, hallucinated deps, weak references
data-ai
👻 | Unified planning entry point - researches, assesses complexity, routes to workflow - primary agent
data-ai
👻 | Transform requirements into executable tasks - primary agent
testing
👻 | Independent multi-lens review of plan.md and/or tasks.md — finds overengineering, missing verification, hallucinated deps, weak references