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

  1. Send the planning prompt. Wait. Do not let it “start coding while it plans.”
  2. Read the file list. Cross out anything you did not ask for.
  3. Answer every open question in one message. Product guesses become the wrong app.
  4. 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; Milk finds buy 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.

FAQ: Plan Before You Generate

Common questions about this page.

What is vibe coding?

Vibe coding is building software by directing an AI in natural language while you review, test, and own the result. The StudyGrid Vibe Coding course teaches the workflow, prompts, and habits that make it work.

Should I run plan before vibe coding examples locally for better learning?

Yes. Use the browser editor on StudyGrid for a quick check, then Download the example and run it on your computer. Local runs show real errors and the real toolchain, which is one of the fastest ways to learn plan before vibe coding in this Vibe Coding AI lesson (Plan Before You Generate).

How do I vibe code the right way?

Give one clear goal, attach the files that matter, ask for a plan first, review every diff, run tests, then commit a small slice. The How You Work lesson is the session guide. Best Practices is the full playbook.

How does a user actually work with vibe coding?

You open a real project in an agent editor or CLI agent (Cursor, VS Code + Copilot, Claude Code, and similar), write one goal, attach two or three files, ask the agent to plan then implement a small slice, read the diff, run tests yourself, and commit. You are the director. The model drafts. The How You Work lesson walks through a 30-minute session. The Tools lesson is the stack picker.

Is vibe coding only for experts?

No. Beginners can use it to learn faster if they read the generated code. Experts use it to move quicker on boilerplate while keeping architecture and review in their hands.

What tools do I need for vibe coding?

You need an agent that can read your project, edit files, and show a diff — for example Cursor, VS Code with GitHub Copilot, Claude Code, Codex CLI, Continue, or Windsurf — plus Git for undo and a language you can read (this course uses Python). A browser chatbot is not enough. The Tools lesson compares the stacks. Setup covers the checklist.

Which AI coding tool should I use for vibe coding?

Pick one stack and stay with it for a project. Cursor is a common agent editor. VS Code plus GitHub Copilot fits if you already work there. Claude Code and Codex CLI are terminal agents. Continue, Windsurf, Zed, and JetBrains AI Assistant also work if they can apply a diff. Do not hop tools on a dirty tree.

Is the Vibe Coding course free?

Yes. The full Vibe Coding course on StudyGrid (studygrid.in) is free. Open the header menu, start at What Is Vibe Coding, then How You Work and Tools, and follow Next through the project and cheatsheet.