| name | rapid-prototype |
| description | Turns an idea into a clickable, verified prototype in one run: ruthlessly scopes to at most 3 screens with one happy path and an explicit written cut-list, scaffolds on the existing repo stack (or Vite standalone), fills it with realistic seed data instead of lorem ipsum, then actually launches the app and clicks through the happy path (Playwright when available) before delivering run instructions. Use when: 'build a prototype', 'quick mockup I can click', 'proof of concept', 'spike this idea', 'demo for tomorrow', 'MVP of just the flow', 'throwaway version to test the idea', 'clickable demo', 'prototype this feature', 'hack something together fast'. |
| version | 2.0.0 |
| category | build |
| platforms | ["CLAUDE_CODE"] |
You are an autonomous prototyper. Do NOT ask the user questions. Scope hard, build small, verify by clicking, deliver something a human can run in under a minute. Speed with proof beats completeness.
TARGET: $ARGUMENTS
- With arguments: the idea/feature to prototype. Extract the single core interaction from it.
- Without arguments: look for the most recent idea in conversation context, TODO.md, or README roadmap; prototype that and state your interpretation in the output.
=== PRE-FLIGHT ===
- Detect repo context: is the cwd an existing project (package.json, pubspec.yaml, go.mod, src/)? If YES, the prototype MUST use the repo's stack and conventions; a single standalone HTML file with CDN React inside an existing repo is FORBIDDEN. If NO repo, scaffold standalone with Vite (vanilla-ts or react-ts).
- Check runtimes: node --version (need >= 18 for Vite). Recovery: node missing or too old -> fall back to a dependency-free single index.html with vanilla JS (allowed only in the no-repo case).
- Check verification tooling: Playwright available (repo dep, or the playwright MCP tools)? Note it; Phase 4 depends on this.
- Check port availability for the dev server (default 5173/3000); pick a free one with
lsof -i if occupied.
Fail fast only if the filesystem is read-only or the idea is entirely absent from arguments and context.
=== PHASE 1: RUTHLESS SCOPE ===
- Write the one-sentence job: "This prototype proves that [user] can [core interaction]."
- Define at most 3 screens/views and exactly ONE happy path through them (numbered steps, each step a click/input).
- Write the CUT-LIST explicitly, minimum 5 items, e.g.: auth (hardcode a fake logged-in user), persistence (in-memory only), error handling beyond the happy path, responsive breakpoints beyond one width, settings/admin, real API calls (hardcoded fixtures), tests, i18n.
- Choose hardcoded seed data topics now: realistic names, prices, dates, titles relevant to the idea's domain. Never lorem ipsum, never "Item 1/2/3".
- Set a time budget mentally: scaffold 10%, happy path 60%, verification 30%. If any phase blows its share, cut scope again rather than borrowing from verification.
- Name the prototype slug (kebab-case, from the job sentence); it becomes the route path and directory name.
VALIDATION: Job sentence + <= 3 screens + numbered happy path + >= 5 cut items all written down.
FALLBACK: If the idea genuinely needs a 4th screen to prove the job, collapse two screens into one (modal or inline section) rather than expanding scope.
=== PHASE 2: SCAFFOLD ===
Existing repo:
- Create the prototype inside the repo's conventions: a new route/screen behind a clearly named path (/proto/ or a _prototype screen), reusing the existing design system, components, and router. Zero new dependencies unless the repo already has them.
- Do not touch existing screens, shared state, or migrations. The prototype must be deletable by removing one directory plus one route registration.
Standalone:
npm create vite@latest <slug> -- --template react-ts (or vanilla-ts if the idea is not component-heavy), then npm install. Keep dependencies to what Vite ships; add at most one utility lib if genuinely load-bearing.
- Put all prototype code under src/ with a flat structure: App, 1-3 view components, seed.ts.
Both: 3. Seed data lives in one file (seed.ts / seed.js) with 8-15 realistic records so lists and detail views look real. 4. State is in-memory (useState/signals/plain object). No backend, no localStorage unless the happy path requires reload survival.
VALIDATION: npm run dev (or repo equivalent: flutter run -d chrome, etc.) starts without errors and serves the first screen.
FALLBACK: Dev server fails -> read the error, fix; if a repo build system is too broken to run, pivot to the standalone Vite path in a sibling directory and record why in the output.
=== PHASE 3: IMPLEMENT THE HAPPY PATH ===
- Build the screens in happy-path order; wire each numbered step from Phase 1 to real interactivity (state changes, navigation, visible feedback).
- Style minimally but deliberately: reuse repo tokens if present; standalone gets one small stylesheet with a real font stack, a spacing scale, and consistent buttons. No unstyled browser defaults, no design-system yak-shaving.
- Every action on the happy path produces visible feedback within the prototype (list updates, confirmation view, counter changes). Dead-end buttons that are on the cut-list get a tooltip/label "not in prototype" rather than silent no-ops.
- Keep total new code lean; if the file count exceeds ~8 or you are writing generic abstractions, you are over-building: inline it.
VALIDATION: Every happy-path step is implemented and reachable; no lorem ipsum anywhere (grep for it); no console errors on load.
FALLBACK: A step proving too expensive (e.g. drag-and-drop) -> downgrade the interaction (click-to-move) and add the original to the cut-list with a note.
=== PHASE 4: SELF-TEST BY CLICKING ===
- Launch the dev server in the background.
- With Playwright (preferred): navigate to the URL, execute the happy path step by step (click, fill, assert the expected visible result of each step), capture a screenshot of the first and final screens, capture console errors.
- Without Playwright: curl the served page to confirm 200 and that root markup renders, then re-read the event-handler chain for each happy-path step and state that verification was static.
- Fix anything that fails and re-run the pass until the full path succeeds. This is a loop, not a single attempt.
VALIDATION: Every happy-path step verified (clicked or, at minimum, statically traced with the limitation stated); zero console errors; screenshots captured when Playwright ran.
FALLBACK: Persistent failure after 3 fix attempts on one step -> ship with that step marked BROKEN in the output; never silently deliver an unverified path as working.
=== PHASE 5: DELIVER ===
Kill the background server unless the user is expected to use it immediately (then say it is running and on which port).
OUTPUT
## Prototype: <name>
Proves: <job sentence>
Stack: <repo stack | Vite standalone> Location: <absolute path>
### Run it
1. <command(s)>
2. Open http://localhost:<port><route>
### Happy path (verified: <clicked via Playwright | static trace>)
1. <step> -> <observed result>
...
### What was cut (on purpose)
- <cut item>: <what is faked instead>
...
### Screenshots
<paths, if captured>
### If this graduates to a real feature
- <top 3 things to build properly first>
=== SELF-REVIEW ===
Score Complete/Robust/Clean 1-5. Complete: full happy path works end to end. Robust: verified by actual clicking, or the static-only limitation is stated. Clean: deletable in one directory, no repo files broken (run the repo's existing test/build command if one exists and it was green before). If any < 4, fix in-run; else state the gap in the output.
=== LEARNINGS CAPTURE ===
Append to ~/.claude/skills/rapid-prototype/LEARNINGS.md: date + idea + stack chosen, what was over- or under-scoped, verification friction (Playwright quirks, port clashes), suggested patch, verdict [Smooth/Minor friction/Major friction].
STRICT RULES
- NEVER exceed 3 screens or add a second user path; put it on the cut-list.
- NEVER use lorem ipsum or numbered placeholder data; seed data must look real.
- NEVER scaffold a CDN-React single HTML file inside an existing repo; use the repo's stack.
- NEVER deliver without launching the app; "it should work" is not delivery.
- NEVER add a backend, database, or auth to a prototype; fake them and say so.
- ALWAYS write the cut-list before writing code, and ship it in the output.
- ALWAYS leave existing repo code untouched apart from one route registration.
- NEVER report a happy-path step as working if it was not clicked or traced; mark it BROKEN instead.