prototype · diff
git:20261008.3f25f14 to git:20261015.f440cbb
12 added, 42 removed. Audit A to A.
---
name: prototype
- description: Use when a design question is best answered by a throwaway prototype — a single shareable HTML file for state/logic, or several toggleable UI variations to compare. Triggers on "prototype", "throwaway", "mockup", "compare layouts", "validate the interaction", "sketch out", "try this quickly", "build a demo", "原型", "试做", "试这个方案", "搭个快速 demo".
+ description: Build a bounded disposable experiment to resolve a specific uncertainty. Triggers on "prototype", "原型".
---
# Prototype
- A prototype is **throwaway code that answers a question**. The question decides the shape.
-
## When to use
- - "Does this logic / state model feel right?" → logic prototype
- - "What should this look like?" → UI prototype
- - Sanity-check a state machine or data model before committing; explore UI directions before picking one
- - Triggers on "prototype", "throwaway", "mockup", "compare layouts", "validate the interaction", "sketch out", "try this quickly", "build a demo", "原型", "试做", "试这个方案", "搭个快速 demo"
+ - Build a bounded disposable experiment to resolve a specific uncertainty.
- **Not for:** production UI implementation (use `frontend-design`); production code (use `implement`).
+ **Not for:** implement for production work.
## Steps
- ### 1. Pick a branch
-
- The two branches produce very different artifacts; getting this wrong wastes the whole prototype.
-
- - **Logic / state model** → load `references/logic.md`. Single shareable HTML file with free-play
- buttons and tabbed guided walkthroughs a non-developer can drive.
- - **What it looks like** → load `references/ui.md`. Several radically different UI variations on one
- route, switchable via `?variant=` and a floating bar.
-
- If the question is ambiguous and the user isn't reachable, default to whichever branch matches the
- surrounding code (backend module → logic; page/component → UI) and state the assumption up top.
-
- ### 2. Build it throwaway from day one
+ 1. State one uncertainty, observable criterion and effort bound; choose the simplest runnable form.
- - State the question being answered at the top of the prototype artifact
- - Locate it close to where it will be used, but name it so a reader sees it's a prototype
- - Trivial to run: one command in the task runner, or a single HTML file double-clicked
- - No persistence by default — state in memory; no tests, no abstractions, no polish
- - Surface the full relevant state after every action (logic) or variant switch (UI)
+ 2. Implement only what exercises it; label simulated behavior and synthetic data.
- ### 3. Capture the answer when done
+ 3. Run and inspect the experiment against its criterion.
- Fold validated decisions into the real code. Capture the prototype itself as a **primary source**:
- commit to a throwaway branch (out of main), leave a context pointer on the implementation issue,
- and record the verdict + question settled. Main keeps only the validated decision.
+ 4. Report conclusions in conversation or an approved findings path; retain or remove the prototype according to its actual use.
- **Output:** `docs/design/prototype-findings.md` — the question tested, the verdict, and the validated
- decision. The prototype code itself stays on a throwaway branch; only the finding is promoted to main
- as a durable record. The verdict is the human's call — record it as a 确认 entry (采纳/修正/驳回
- with rationale). Format: `${CLAUDE_PLUGIN_ROOT}/references/human-audit.md`.
+ **Output:** Suggested paths, subject to [human audit](../../../references/human-audit.md): `docs/design/prototype-findings.md` when conclusions need persistence.
## Verify
- - [ ] Question being answered stated explicitly at the top of the prototype
- - [ ] Correct branch chosen — not silently defaulted
- - [ ] Runs from one command or one double-click, no setup required
- - [ ] State visible after every action / variant switch
- - [ ] Validated decision folded into real code; prototype on a throwaway branch
+ - The experiment was run and narrows its question; simulated behavior is not presented as real integration.
## References
- - [${CLAUDE_PLUGIN_ROOT}/references/engineering-principles.md](${CLAUDE_PLUGIN_ROOT}/references/engineering-principles.md) — shared discipline (enforce simplicity, verify don't assume)
- - [${CLAUDE_PLUGIN_ROOT}/references/design-principles.md](${CLAUDE_PLUGIN_ROOT}/references/design-principles.md) — design discipline (hierarchy before decoration, design every state, recognize rather than recall).
- - [${CLAUDE_PLUGIN_ROOT}/references/human-audit.md](${CLAUDE_PLUGIN_ROOT}/references/human-audit.md) — audit-block baseline: AUD vs 确认 blocks, status lifecycle, readability bar
+ - [engineering-principles.md](../../../references/engineering-principles.md) — shared decision boundaries, scope and verification.
+ - [design-principles.md](../../../references/design-principles.md) — design discipline (hierarchy before decoration, design every state, recognize rather than recall).
+ - [human-audit.md](../../../references/human-audit.md) — document consent, readability and human review.
- [references/logic.md](references/logic.md) — single-shareable-HTML logic prototype: pure module, free-play + guided walkthroughs
- [references/ui.md](references/ui.md) — toggleable UI variants: sub-shape A (existing page) vs B (throwaway route), floating switcher