prototype
- 作者仓库星标 0
- 作者更新于 2026年8月24日 22:19
- 作者仓库 skills
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. 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. 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
- 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.
- 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. - 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 (logic) or on every variant switch (UI), 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.
- 流狐分类
- 工程开发
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @mattpocock · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 即装即用
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- macOS · Linux · Windows
- 底层运行要求
- Python
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 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. Build a single shareable HTML file (free-play buttons plus tabbed guided…
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…
# 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.
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Pick a branch → Rules that apply to both
要点 -> throwaway code that answers a question · "Does this logic / state model feel right?" · "What should this look like?" · Throwaway from day one, and clearly marked as such. · Trivial to run. · No persistence by default. · Skip the polish. · Surface the state.
文件/命令 -> pnpm <name> · python <path> · bun <path> · LOGIC.md · UI.md
内容 SHA-256 -> 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 答完之后正式落实施)。