Vibe Coding
Plan Before You Generate
Ask for a plan, not a 40-file rewrite. Approve the approach, then let the agent code.
Why plan first
Generation is cheap. Wrong architecture is expensive. A two-minute plan catches "this should be a function, not a new package" before 15 files appear.
A planning prompt
Do not write or edit code yet.
Feature: export notes to CSV.
Return:
1. Goal in one sentence
2. Files to change (and files you will not touch)
3. Steps in order, each small enough for one commit
4. Tests you will add
5. Open questions (ask me; do not guess product behavior)What a good plan looks like
Goal: `python notes.py export notes.csv` writes id,text rows.
Files: notes.py, test_notes.py. No new packages.
Steps:
1. Add export() that writes CSV with csv.writer
2. Wire argparse subcommand `export PATH`
3. Test export of two notes and empty list
Questions:
- Overwrite existing PATH or error?
- Include a header row?You answer the questions. Then you say: "Overwrite, include a header. Implement step 1 only."
How you use a plan at work
- Send the planning prompt. Wait. Do not let it “start coding while it plans.”
- Read the file list. Cross out anything you did not ask for.
- Answer every open question in one message. Product guesses become the wrong app.
- Reply: “Implement step 1 only. Files allowed: …” Then review that step before step 2.
You can skip a written plan for a rename, a docstring, or a failing test you already understand. Everything else gets a plan.
When you can skip a written plan
- Rename a variable in one file.
- Fix a failing test you already understand.
- Add a docstring or a type hint.
If more than one file, more than one behavior, or you feel unsure: plan.
Specs beat vibes
"Make it user friendly" is not a spec. "Empty list prints No notes yet. and exits 0" is a spec. Write the boring acceptance lines. The model follows those more faithfully than mood.
If you cannot write three acceptance lines, you are not ready to generate. Clarify the product first.
Try it yourself
Write three acceptance lines for python notes.py search TEXT.
Show solution
- Match is case-insensitive;
Milkfindsbuy milk. - No matches prints
No notes found.and exits 0. - Missing TEXT prints usage and exits 1. Storage format stays the same JSON.
Key takeaways
- Plan mode is how you stay director.
- Force open questions. Guessing is how you get a different app.
- Implement one planned step per prompt.
- If you cannot write three acceptance lines, you are not ready to generate.