协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
workflow-coding-discipline【开发与工程】Guardrails for writing, editing, refactoring, or debugging code: surface assumptions, simplicity first, surgical changes. Use when vibe-coding keeps producing wrong results, or for "think before coding" or "surgical changes".
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Degree of freedom: HIGH. How strictly to apply each guardrail is judgment. Trivial one-liners may skip the full loop; a wrong architectural guess may not.
Observe: user said "just add caching"; repo already has TanStack Query on the same endpoint. Interpret: a second cache would duplicate, not simplify. Classify: ask, then reuse Query — do not add Redis. Check: surgical edit; no new abstraction.
workflow-refactor; repo-wide pattern → audit-code-qualityFour guardrails to apply on every non-trivial coding task. Bias toward caution over speed. For trivial one-liners (typo fixes, obvious renames), use judgment — not every change needs full rigor.
If a project's own rules contradict any guideline below, the project rules win.
State your assumptions. Say when you're confused. Surface tradeoffs.
Before writing code:
Anti-pattern: Reading an ambiguous request, picking one interpretation, building 200 lines, then discovering the user meant something else.
Minimum code that solves the problem. Nothing speculative.
try/catch, ?. chains, or Array.isArray() guards as the primary fix — those are symptom suppressors. Fix the root cause first; harden second.The test: Would a senior engineer reading this say it's overcomplicated? If yes, simplify.
Touch only what you must. Clean up only your own mess.
When editing existing code:
When your changes create orphans:
The test: Every changed line in the diff should trace directly to the user's request. If a reviewer asks "why is this line different?" you should have an answer rooted in the task.
Define success criteria. Loop until verified.
Transform imperative tasks into verifiable goals:
| Instead of... | Transform to... |
|---|---|
| "Add validation" | "Write tests for invalid inputs, then make them pass" |
| "Fix the bug" | "Write a test that reproduces it, then make it pass" |
| "Refactor X" | "Ensure tests pass before and after" |
| "Make it work" | "Define what 'work' means as a verifiable check, then verify" |
For multi-step tasks, say in one line what you are about to do before the first tool call, then list the steps with the check that proves each:
1. [Step] → verify: [check]
2. [Step] → verify: [check]
3. [Step] → verify: [check]
Strong success criteria let you loop independently. Weak criteria ("make it work") force the user back into the loop to clarify.
Before saying "done", confirm:
Source: Adapted from forrestchang/andrej-karpathy-skills, distilled from Andrej Karpathy's observations on LLM coding pitfalls. MIT licensed.