prototype
Prototype
Prototype 是用来回答一个问题的 throwaway code。问题决定形状。
Pick a branch
先识别正在回答哪个问题:来自用户 prompt、周围代码,或在用户在线时直接询问:
- "Does this logic / state model feel right?" → LOGIC.md。构建一个很小的交互式 terminal app,推动 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;不要发明新的顶层结构。
- 一个命令即可运行。 使用项目现有 task runner 支持的东西:
pnpm <name>、python <path>、bun <path>等。用户必须能不动脑地启动它。 - 默认不持久化。 State 保存在内存中。Persistence 是 prototype 要检查的东西,不该成为依赖。如果问题明确涉及 database,就用 scratch DB 或带有清晰 “PROTOTYPE — wipe me” 名称的本地文件。
- 跳过 polish。 不写 tests,不做超过“能跑起来”所需的 error handling,不做 abstractions。重点是快速学到东西,然后删掉。
More from vinvcn/mattpocock-skills-zh-cn
grill-me
围绕 plan 或 design 持续 interview user,直到达成 shared understanding,并逐一解决 decision tree 的每个分支。Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
133grill-with-docs
Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions.
129tdd
使用 red-green-refactor loop 做 test-driven development。Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.
127diagnose
面向棘手 bug 和性能回退的纪律化 diagnosis loop。Reproduce → minimise → hypothesise → instrument → fix → regression-test. Use when user says "diagnose this" / "debug this", reports a bug, says something is broken/throwing/failing, or describes a performance regression.
125setup-matt-pocock-skills
Sets up an `## Agent skills` block in AGENTS.md/CLAUDE.md and `docs/agents/` so the engineering skills know this repo's issue tracker (GitHub or local markdown), triage label vocabulary, and domain doc layout. Run before first use of `to-issues`, `to-prd`, `triage`, `diagnose`, `tdd`, `improve-codebase-architecture`, or `zoom-out` — or if those skills appear to be missing context about the issue tracker, triage labels, or domain docs.
123zoom-out
让 agent zoom out,并给出更广的 context 或更高层 perspective。Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.
122