按源仓库内容呈现,保留标题、案例、代码、表格、链接以及原文引用的演示图片。
Prototype
A prototype is throwaway code that answers a question. The question decides the shape.
Route the question
Identify which question is being answered — from the user's prompt, the surrounding code, or by asking if the user is around:
- "Does this logic / state model feel right?" → LOGIC.md. Build a single shareable HTML file — free-play buttons plus tabbed guided walkthroughs — that pushes the state machine through cases that are hard to reason about on paper, and that a non-developer can drive.
- "What should this look like?" → invoke
/frontend-design. It owns the richer visual workflow: prerequisite gating, three runnable directions, screenshots, user grilling, and an approveddocs/design/<feature>/DESIGN.mdcontract. If its product prerequisites are unresolved, route them back to/wayfinderor/grilling; do not build UI variants here.
These are two destinations, not two prototype branches: this skill builds only logic/state prototypes, while /frontend-design owns visual exploration. If the question is genuinely ambiguous and the user is not reachable, build a logic prototype only when the prompt clearly asks about state or behavior. Otherwise stop and route the missing decision through /wayfinder or /grilling; never resurrect a local UI-prototype path.
Rules for logic prototypes
- Throwaway from day one, and clearly marked as such. Locate the prototype code close to where it will actually be used so context is obvious, but name it so a casual reader can see it is a prototype, not production.
- Trivial to run. Produce a single HTML file the user can double-click, with no setup to remember.
- No persistence by default. State lives in memory. Persistence is the thing the prototype is checking, not something it should depend on. If the question explicitly involves a database, hit a scratch DB or a local file with a clear "PROTOTYPE — wipe me" name.
- Skip the polish. No tests, no error handling beyond what makes the prototype runnable, no abstractions. The point is to learn something fast.
- Surface the state. After every action, print or render the full relevant state so the user can see what changed.
- Capture it when done. Fold any validated decision into the real code, then capture the prototype itself as a primary source: commit it to a throwaway branch, out of main, and leave a context pointer to that branch on the implementation issue. Capture the answer too — the verdict and the question it settled — in the issue or a commit. The main branch keeps only the validated decision.

