Vibe Coding
How You Work with Vibe Coding
A session-by-session guide: what you type, attach, accept, reject, and commit from opening the editor to shipping a slice.
You are the director. The model is the intern.
Vibe coding is not chatting until something appears. It is a job split. You decide the product, the slice, and what “done” means. The agent drafts files. You read, run, and keep or throw away. If you skip those last three, you are not vibe coding — you are gambling.
| You do | The agent does | Nobody should do |
|---|---|---|
| Pick one goal for this session | Read the files you attach | Invent a product you never described |
| Name files, constraints, and a done command | Write a plan, then a small diff | Rewrite the whole repo “to be clean” |
| Read every changed line | Explain a confusing hunk if you ask | Accept a patch you cannot explain |
| Run tests and the real command | Suggest a fix from a traceback | Trust “tests passed” in chat without looking |
| Commit, revert, or ask for a smaller slice | Apply the next approved step | Let the agent run destructive git commands |
Keep this page open the first week. After Setup, come back here whenever a session feels chaotic. Chaos almost always means the slice is too big or you skipped review.
Two ways to use this course
| Path | What you do | When |
|---|---|---|
| Read along | Follow Next through every lesson. Copy prompts into a notes file. Do not ship anything yet. | You want the method before you touch an editor. |
| Practice as you go | Finish Tools and Setup, then do the 30-minute session below. After each later lesson, repeat one tiny task in the same folder. | You learn by doing. This is the recommended path. |
Either path ends at Build a Project. Keep the prompt cheatsheet in a second tab while you work.
Before you open chat
Do this every session, even a short one. It takes two minutes and saves an hour of thrash.
- Open the project root in the editor, not your home folder or a parent of many repos.
- Confirm Git is clean, or commit what you already trust. You need a restore point.
- Activate the virtual environment. You will run
pytestyourself. - Write the goal in one sentence in the chat box before you hit send. If you cannot, you are not ready.
- Decide the done check: a command, a test name, or a UI action you can repeat.
Goal sticky note
Goal: python notes.py list prints notes one per line.
Files: notes.py, test_notes.py
Must not: add packages, touch other folders
Done: pytest -q exits 0Your first 30-minute session
Use a tiny Python folder from Setup, in the tool you picked inTools. Do not start on a production app. The point is to feel the loop once.
| Time | You | What you type or click |
|---|---|---|
| 0–3 min | Explore | Open Agent chat. Attach nothing yet. Ask: “List the files in this folder and what each one is for. Do not edit anything.” |
| 3–8 min | Plan | “Do not write code. I want a function unique_words(text) that returns sorted unique words, case-insensitive. List files, tests, and open questions.” |
| 8–10 min | Decide | Answer questions in one message: “Ignore punctuation for now. Empty string returns []. Implement tests first only.” |
| 10–15 min | Tests | Let it create test_words.py. Read the tests. If they match the spec, say “Keep those tests. Now implement words.py only.” |
| 15–20 min | Review | Open the diff. Check it only touched the files you named. Reject extra folders or a new web app. |
| 20–25 min | Test | In the terminal: pytest -q. You run it. If it fails, paste the traceback — do not say “fix it.” |
| 25–30 min | Commit | git add words.py test_words.py then git commit -m "Add unique_words helper". Stop. That is a complete slice. |
If you are still generating at minute 30, the slice was too big. Revert to the last commit and ask for tests only, or one function only.
How you talk to the agent in the editor
Most work uses three moves. Pick the smallest one that fits.
| Move | When | How |
|---|---|---|
| Chat with @files | A feature or bug that spans a file or two | Type @notes.py and @test_notes.py in an editor, or name those paths in a CLI agent. Two or three files. Not the whole repo. |
| Inline on a selection | Rename, extract, or fix one function | Highlight the function, then ask to change only that selection. |
| Terminal + paste | Something failed | You run the command. You paste the exact output. The agent does not get to “remember” a green run. |
Standing rules live in AGENTS.md (see Setup). Today’s task lives in the prompt. Do not paste a manifesto every time.
Accept, reject, or ask again
After every generation, you make one of four calls. Make it out loud if you have to.
- Accept and commit — the diff matches the ask, you can explain it, tests you ran are green.
- Accept with a fix prompt — almost right. “Change only line X. Do not touch tests.”
- Reject the extras — keep the useful file, restore the rest: “Revert helpers.py. Keep notes.py.”
- Revert the slice — the agent wandered.
git restorethe files, then send a smaller prompt.
Decision prompts
# Almost right
Keep the new function. Undo the import you added in utils.py.
Do not reformat other files.
# Wandered
Stop. Revert your last edits.
Implement only unique_words in words.py.
Files allowed: words.py, test_words.py.“Looks fine, Accept All” is the most expensive click in this course. If a file appeared that you did not name, that is a reject unless you can say why you want it.
A normal working day
Once the first session feels natural, a real day looks like several small loops, not one giant chat.
- Morning: pull, run the test suite, write the day’s goal in one sentence.
- Loop 1: plan a slice, implement, review, test, commit (20–40 minutes).
- Loop 2: next slice, same ritual. Do not chain five features in one prompt.
- When stuck: after two failed fixes, paste the failing test and ask for causes, not a rewrite.
- End of day: only green, explained commits on the branch. Unfinished mess gets restored, not left for tomorrow.
That is the whole job. Later lessons add skill to each step: better prompts, tighter context, tests first, Git undo. They do not replace this rhythm.
How each chapter helps you work
| When you are… | Open |
|---|---|
| Choosing Cursor, Copilot, Claude Code, or another agent | Tools |
| Installing the editor and making a practice folder | Setup |
| Staring at a blank chat | Better Prompts |
| Lost in a long session | The Workflow |
| The model invented a second helper | Give Context |
| About to ask for a multi-file feature | Plan First |
| Looking at a diff you did not expect | Review the Diff |
| Unsure the code is actually correct | Tests as Guardrails |
| pytest is red | Debug with AI |
| The tree is a mess | Git and Commits |
| Repeating the same bad habit | Common Mistakes |
What “good work” looks like in Git
Your history should read like a story a teammate can skim:
Add unique_words helper
Add notes CLI add and list
Add notes delete command
Fix delete IndexError on last itemBad history: Update files, more fixes, agent stuff. You write the message. You choose the files. The agent does not own the repo.
Try it yourself
Exercise 1: Write a four-line sticky note (goal, files, must-not, done) for this task: “Users should be able to search notes by a word.”
Show solution
Goal: python notes.py search milk prints matching notes.
Files: notes.py, test_notes.py
Must not: new packages, new JSON format, web UI
Done: pytest -q and python notes.py search milkExercise 2: The agent added server.py and a requirements.txt with Flask when you asked only for unique_words. What do you do, in order?
Show solution
Reject the extras. Restore or delete server.py and requirements.txt. Keep only words.py / test_words.py if they match the spec. Send: “Do not add a server or dependencies. Only words.py and test_words.py.” Run pytest -q yourself, then commit the small slice.
Key takeaways
- You pick the goal, files, constraints, and done command. The agent drafts.
- Work in 20–30 minute slices: explore, plan, implement, review, test, commit.
- Attach two or three files. Run tests in your terminal. Write the commit message yourself.
- Accept, fix, reject extras, or revert. Never Accept All on a surprise diff.
- This course is a playbook for that loop. Next, pick a tool, set up the practice folder, and start.