The Three Parts of a Good Instruction
The most common beginner instruction is "make me a to-do list". It can do that, but there's an 80% chance the result isn't what you pictured, and then you spend ten rounds fixing it.
A good instruction has three parts: goal (what to build, for whom), acceptance criteria (what "done" looks like), and constraints (what must or must not be used).
做一个待办清单网页,给我自己在手机浏览器上用。
验收标准:
1. 能输入一条待办并回车添加
2. 点一下能标记完成,完成的划掉
3. 刷新页面后数据还在(用浏览器本地存储)
4. 手机竖屏下按钮够大、不用横向滚动
约束:只用一个 index.html,不引入任何框架和外部库;界面简洁,浅色背景。Checking Order: Result First, Code Second
When it finishes it will say "Done, open index.html to view". At this point don't go read the code. You won't understand it and you don't need to. Do three things first:
1. Open it in the browser and test each acceptance criterion one by one.
2. Open the same file on your phone (or shrink the browser window) to check the portrait layout.
3. Send the failing criterion back to it word for word: "Criterion 3 failed: to-dos disappear after refresh".
Small Steps: Change One Thing at a Time
Once everything passes, you'll want to add things: delete, categories, reminders, dark mode...
There's only one rule: ask for one change at a time. Check it. Then ask for the next. Ask for five at once and it may get four right and break one, and you won't be able to tell which change broke it, and you can't roll back cleanly either.
✅ 给每条待办加一个删除按钮,点击后从列表和本地存储里都移除。其他功能不要动。
❌ 加删除、加分类、加到期提醒、换成深色、再把字体换个好看的。自测 · 学完检查一下
想真正动手做题、记进度、攒连胜?到互动课里练。
Of these four instructions, which is most likely to get Claude Code to build what you want in one go?
答案:Build a reading log page for my own use. Acceptance: can add a book title, can record pages read today, survives refresh. Constraints: single html file, no frameworks
Only the first has a goal, tickable acceptance criteria, and constraints. "Beautiful and professional" can't be ticked; "like WeChat Reading" is too big to ever finish; "as many as possible" hands it all the decisions, and then you spend ten rounds undoing its decisions.
What's wrong with the acceptance criterion "make the interface look nicer"?
答案:It can't be ticked off. You and the AI understand "nicer" differently, so there's bound to be a dispute when it's done
The only requirement for an acceptance criterion is that it can be judged. Replace "nicer" with something judgeable: "light background, body text at least 16px, buttons at least 44px tall". Then the AI can get it right and you can check it.
Claude Code says it's done. Zhou opens it and criterion 2, "tap to mark as done", doesn't work. Which message should he send back?
答案:"Criterion 2 failed: tapping a to-do doesn't strike it through, and nothing changes at all"
Send back the failing criterion and exactly what you saw, and it can locate the problem. "Redo it" throws away the parts that were already right; guessing line numbers is you doing its job; piling on requests turns one unfixed problem into three.
True or false: after the to-do list passes acceptance, Xia sends four requests at once, "add delete, add categories, add reminders, switch to dark mode", for the AI to do together. This saves the most time.
答案:False
It looks like it saves three conversations, but the moment one feature breaks, the four changes are tangled together, you can't tell which caused it, and rolling back means rolling back all of them. One change at a time, check each one before moving on, and the total time is actually shorter.
After adding the "delete button", the original "mark as done" suddenly stopped working. Following this lesson, what's the next step?
答案:Tell it "after adding the delete button, mark as done stopped working. Fix only this problem, don't touch other features"
Because you changed only one thing, you know the delete button caused it, so just tell it the symptom and the scope. Giving up the feature, digging through code yourself, or starting over are all the most expensive ways to solve the smallest problem.