Vibe coding is a way of building software by describing what you want in plain language and letting an AI code assistant write and revise the code while you steer, test, and correct it. You stay in charge of the goal and the acceptance checks; the assistant handles the typing, the boilerplate, and most of the syntax. The method works best for small, self-contained projects such as a personal website, a script that renames files, or a prototype you want to show someone within an hour.

What Vibe Coding Actually Involves

In practice you work in a loop: state a small goal, read the generated code, run it, describe the failure, and repeat. The assistant is a fast typist with broad knowledge of libraries and syntax, not an authority on your requirements. Your job is to keep each request narrow enough that you can verify the result in under a minute. A request like "add a button that downloads the table as CSV" is verifiable; "build my whole app" is not.

The term describes a spectrum rather than a single tool. At one end you accept most suggestions without reading them closely, which is fine for throwaway scripts and risky for anything that touches money, personal data, or other people's machines. At the other end you review every line as if a junior colleague wrote it. Decide which end you are on before you start, because that decision determines how much testing you need.

What You Need Before the First Prompt

You need three things: a working development environment, a version control repository, and a clear one-sentence description of what "done" looks like. Install the language runtime and a code editor, confirm you can run a hello-world file from the terminal, and initialise a Git repository in the project folder. Commit after every working change so you can undo a bad batch of generated code with a single command instead of reconstructing it by hand.

Write the definition of done as a checklist of observable behaviours. "The page loads, shows a list of items from a local JSON file, and each item has a delete button that removes it from the list" is a checklist. "A nice task manager" is not. Keep the checklist in a file in the repository so you can paste it into the conversation when the assistant drifts.

How to Write Prompts That Produce Usable Code

Give the assistant the context it cannot infer: the language and framework, the file it should edit, the input and output, and the constraint you care about. A useful prompt names the file path, describes the current behaviour, states the desired behaviour, and lists what must not change. For example: "In src/list.js, the render function currently prints items to the console. Change it to append one list element per item to the element with id 'items'. Do not change the data loading code."

Ask for one change at a time. When you bundle five changes into one request, a failure tells you nothing about which part broke. When you must bundle, ask the assistant to list the changes it made so you can test them in order. If a response is longer than about 50 lines, split the task before accepting it; long outputs are harder to review and more likely to contain an invented function name.

How to Review and Test Generated Code

Read the code for four things before running it: imports that do not exist, functions called with the wrong number of arguments, hard-coded paths or credentials, and loops that never terminate. Then run it on the smallest input you can construct. Test the empty case, the single-item case, and one malformed input, because those three catch most crashes. If the code touches a file or a database, run it against a copy of the data, never the original.

Keep a short list of the checks you ran and their results in the commit message. When a later change breaks something, that list tells you what used to work. Automated tests are worth the effort once a project passes about 300 lines, because at that size you can no longer hold the whole behaviour in your head, and the assistant will happily break an earlier feature while fixing a new one.

Which Tasks Suit This Method and Which Do Not

The method fits tasks with fast feedback and low blast radius: static sites, command-line utilities, data cleaning scripts, prototypes, test fixtures, and small internal tools. It fits poorly when a mistake is expensive or hard to detect: authentication, payment handling, cryptography, medical or financial calculations, anything that deletes data, and anything that runs unattended on a server. In those areas, use the assistant to draft and explain, then have a person with domain knowledge review and sign off.

Task typeFitReview levelTypical failure
Static website or landing pageStrongVisual check in browserBroken layout at narrow widths
File-renaming or data-cleaning scriptStrongDry run on a copyOverwrites files on a second run
Prototype for a demoStrongHappy path onlyNo handling of empty input
Login and session handlingWeakSecurity reviewTokens stored in plain text
Payment or billing logicWeakExpert review plus testsRounding and duplicate charges
Anything deleting production dataWeakManual approval stepMissing confirmation or backup

How to Keep a Project From Drifting

Drift happens when the assistant forgets earlier decisions or invents a new structure mid-project. Counter it with three habits: keep a short notes file describing the architecture and the naming conventions, paste the relevant part into the conversation when you start a new session, and commit working states often. When the assistant proposes a rewrite of a file that already works, ask it to make the smallest edit that achieves the goal instead.

If two attempts in a row fail, stop prompting and read the error message yourself. Copy the exact error text into the conversation rather than paraphrasing it, and include the command you ran. Vague reports produce vague fixes. When the assistant apologises and repeats the same wrong suggestion, change the framing: describe the observed behaviour and the expected behaviour as two separate sentences, with no proposed solution attached.

Safety, Secrets and Data Handling

Never paste real credentials, private keys, customer records, or personal data into a prompt. Use placeholder values and load real secrets from environment variables at run time. Check generated code for network calls you did not ask for, for logging statements that print sensitive values, and for dependencies you do not recognise. Before installing any package the assistant recommends, confirm it exists in the official registry and read its description; invented package names are a known failure mode, and installing one can run unknown code on your machine.

Treat generated code as untrusted until you have read it. Run unfamiliar scripts in a container or a virtual environment, not in your home directory. Back up any folder a script will modify, and prefer a dry-run flag that prints what would change before it changes anything. If a project handles other people's data, the review standard is the same as for code a person wrote: someone accountable must understand what it does.

Goal: a script that reads a text file of URLs, one per line, and prints each URL with its HTTP status code. Definition of done: it handles a file with zero lines, reports unreachable hosts without crashing, and finishes 20 URLs in under 30 seconds. Step one: create the folder, initialise Git, and commit an empty file. Step two: ask for a script that reads the file path from a command-line argument and prints each line unchanged; run it on a three-line test file. Step three: ask it to add an HTTP request per URL with a 10-second timeout and print the status code; run it against one known-good and one deliberately broken URL. Step four: ask it to catch connection errors and print the word "error" with the URL; run the broken URL again. Step five: run it on the full list, then commit. Each step is small enough to verify, and any failure points to exactly one change.