原型
- 作者仓库星标 0
- 作者更新于 2026年8月24日 14:19
- 作者仓库 skills
- 领域
- 工程开发
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @mattpocock · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 运行环境要求
- Python
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
# Prototype
A prototype is **throwaway code that answers a question**. The question decides the shape.
## Pick a branch
Identify which question is being answered, using the user's prompt, the surrounding code, or by asking if the user is around:
- **"Does this logic / state model feel right?"** → [LOGIC.md](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?"** → [UI.md](UI.md). Generate several radically different UI variations on a single route, switchable via a URL search param and a floating bottom bar.
The two branches produce very different artifacts, so getting this wrong wastes the whole prototype. If the question is genuinely ambiguous and the user isn't reachable, default to whichever branch better matches the surrounding code (a backend module → logic; a page or component → UI) and state the assumption at the top of the prototype.
## Rules that apply to both
1. **Throwaway from day one, and clearly marked as such.** Locate the prototype code close to where it will actually be used (next to the module or page it's prototyping for) so context is obvious, but name it so a casual reader can see it's a prototype, not production. For throwaway UI routes, obey whatever routing convention the project already uses; don't invent a new top-level structure.
2. **Trivial to run.** A UI prototype starts from one command in the project's task runner: `pnpm <name>`, `python <path>`, `bun <path>`, etc. A logic demo is a single HTML file the user double-clicks. Either way, no thinking required to start it.
3. **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.
4. **Skip the polish.** No tests, no error handling beyond what makes the prototype _runnable_, no abstractions. The point is to learn something fast.
5. **Surface the state.** After every action (logic) or on every variant switch (UI), print or render the full relevant state so the user can see what changed.
6. **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.
章节与文件索引
按说明文件中的顺序排列。
选择一个分支
适用于两者的规则
文件/命令 -> pnpm <name> · python <path> · bun <path> · LOGIC.md · UI.md
内容校验值 -> d09be9359561
设计思路
prototype是 mattpocock 的「快速原型」skill——把「我们应该怎么做」拆成两个分支问题:逻辑 / 状态模型(用LOGIC.md:建一个小交互终端 app 把状态机推过那些纸上很难推的 case)vs 视觉 / UI(用UI.md:在单一路由上同时生成多套激进不同的 UI,通过 URL search param + 浮动底栏切换)。走错分支会浪费整个 prototype——所以要先选对枝。选枝原则
LOGIC.mdUI.md两枝共用规则
pnpm <name>/python <path>/bun <path>)——用户不动脑就能跑。When done
答案才是 prototype 留下的唯一价值。 把它沉淀到 commit message / ADR / issue / prototype 旁边的
NOTES.md,连同它在回答的问题。删 prototype 之前,把 verdict 写下来。适合谁
不适合
配套
brainstorming(前置)、design-an-interface(接口形状专门版)、design-shotgun(UI 多版本探索的视觉版)、writing-plans(prototype 答完之后正式落实施)。