prototype
vinvcn/mattpocock-skills-zh-cn
Build throwaway prototypes to validate design decisions and state models quickly.
What is prototype?
Prototype is single-use code designed to answer a specific design question. Use it when you need to verify whether a state model or logic feels correct, or to explore what a UI should look like. After validating the decision, capture findings and discard the prototype.
- Choose between logic validation (state machine behavior via interactive HTML) or UI exploration (multiple design variations via URL params)
- Run with zero setup friction—single HTML file or one task-runner command
- Keep state in memory with no persistence layer; focus on learning, not production concerns
- Expose full state after each action so changes are immediately visible
- Skip polish: no tests, minimal error handling, no abstractions—speed over perfection
How to install prototype
npx skills add https://github.com/vinvcn/mattpocock-skills-zh-cn --skill prototypeHow to use prototype
- 1.Identify the core question: 'Does this logic/state model feel right?' or 'What should this look like?'
- 2.For logic questions, build a single shareable HTML file with buttons and tabbed walkthroughs that drive the state machine
- 3.For UI questions, generate several distinct design variations on a single route, switchable via URL search params and a floating control bar
- 4.Place the prototype next to the code it validates, with naming that clearly marks it as throwaway (not production)
- 5.Run the prototype from a single command or file double-click with no setup required
- 6.After each action or variant switch, display the complete relevant state so changes are visible
- 7.Once you've validated the decision, capture the verdict in the implementation issue, save the prototype on a throwaway branch as a reference, and merge only the verified decision into main
Use cases
- Validate a complex state machine by building an interactive HTML demo with free-play buttons and guided walkthroughs
- Explore multiple UI design directions for a page or component by switching between variations via URL parameters
- Test whether a proposed logic model handles edge cases that are hard to reason about on paper
- Verify user workflows feel natural before committing to implementation
- Quickly prototype database or persistence behavior using a scratch DB or clearly-marked local file
- Backend developers validating state models and logic flows
- Frontend developers exploring UI design directions
- Product teams wanting to test workflows before full implementation
- Anyone needing rapid design validation without production overhead
prototype FAQ
No—keep state in memory by default. Persistence is something the prototype should check, not depend on. Only use a scratch database or clearly-marked local file if the question explicitly involves persistence.
Place it next to the module or page being prototyped so context is clear. Use naming conventions that signal it's throwaway (not production), and follow existing routing conventions for UI prototypes.
Commit it to a throwaway branch as the primary source of truth for the decision, leave a context pointer in the implementation issue, capture the verdict and problem it solved, then merge only the verified decision into main.
No. Skip polish entirely—no tests, minimal error handling, no abstractions. The goal is to learn quickly, not build production code.
If the question is about state/logic behavior, choose logic (interactive HTML). If it's about visual design, choose UI (design variations). If the question is unclear and the user is unavailable, default to whichever matches the surrounding code.
Full instructions (SKILL.md)
Source of truth, from vinvcn/mattpocock-skills-zh-cn.
name: prototype description: 构建一次性原型来回答一个设计问题。适用于用户想验证某个 state model 或 logic 是否感觉对,或探索 UI 应该长什么样时。
Prototype
Prototype 是用来回答一个问题的 throwaway code。问题决定形状。
Pick a branch
先识别正在回答哪个问题:来自用户 prompt、周围代码,或在用户在线时直接询问:
- "Does this logic / state model feel right?" → LOGIC.md。构建一个单一、可分享的 HTML 文件——free-play buttons 加 tabbed guided walkthroughs——推动 state machine 跑过纸面上难以推理的 cases,而且非开发人员也能驱动它。
- "What should this look like?" → UI.md。在单一路由上生成几种差异很大的 UI variations,并通过 URL search param 和浮动底栏切换。
这两个分支会产出非常不同的 artifacts;选错会浪费整个 prototype。如果问题确实模糊且用户不可达,默认选择更匹配周围代码的分支(backend module → logic;page 或 component → UI),并在 prototype 顶部说明假设。
Rules that apply to both
- 从第一天就是 throwaway,并明确标记。 Prototype code 要靠近它实际会被使用的位置(放在被 prototype 的 module 或 page 旁边),这样上下文清楚;但命名要让随手读代码的人看出它是 prototype,不是 production。对 throwaway UI routes,遵守项目现有 routing convention;不要发明新的顶层结构。
- 运行毫无负担。 UI prototype 从项目 task runner 中的一条命令启动——
pnpm <name>、python <path>、bun <path>等。Logic demo 则是用户双击即可打开的单个 HTML 文件。无论哪种,启动都不需要动脑。 - 默认不持久化。 State 保存在内存中。Persistence 是 prototype 要_检查_的东西,不该成为依赖。如果问题明确涉及 database,就用 scratch DB 或带有清晰 “PROTOTYPE — wipe me” 名称的本地文件。
- 跳过 polish。 不写 tests,不做超过“能跑起来”所需的 error handling,不做 abstractions。重点是快速学到东西。
- 暴露 state。 每次 action(logic)或每次 variant switch(UI)后,打印或渲染完整相关 state,让用户看到发生了什么变化。
- 完成后 capture。 把验证过的 decision 折进真实 code,然后把 prototype 本身作为 primary source 保存:commit 到 main 之外的 throwaway branch,并在 implementation issue 上留下指向该 branch 的 context pointer。同时在 issue 或 commit 中 capture answer,也就是 verdict 与它解决的问题。Main branch 只保留验证过的 decision。
Related skills
More from vinvcn/mattpocock-skills-zh-cn and the wider catalog.

qa
Interactive QA sessions that convert user-reported bugs into well-structured GitHub issues with codebase context.

request-refactor-plan
Create detailed refactor plans with small commits through user interviews, then submit as GitHub issues.

research
Research topics against primary sources and save findings as Markdown files in your repo.

resolving-merge-conflicts
Resolve git merge/rebase conflicts by understanding intent and preserving both sides when compatible.

scaffold-exercises
Scaffold exercise directory structures with chapters, problems, solutions, and explanations that pass linting.

setup-matt-pocock-skills
Configure repository settings for Matt Pocock's engineering skills: issue tracker, triage labels, and domain docs layout.