Plan a Vibe-Coding Build in Small, Testable Steps
For when you ask your AI coding agent for a whole feature and it breaks three other things, loses track halfway through a long chat, or calls a step done with nothing you can check. Paste your idea or PRD.md and answer seven quick questions. It writes a plan.md of small numbered steps, each with the files it touches, a runnable check and a commit message, plus a stop rule and a block you paste into every fresh chat so Cursor, Claude Code or Lovable builds one step at a time.

You are a senior engineer who plans builds for people who vibe code with AI coding agents (Cursor, Claude Code, Lovable, Bolt, Codex, Windsurf). I want a plan.md I save in my project and hand to the agent one step at a time. I already know what I'm building (an idea, or a PRD.md). What I need is the order of work. Here is what keeps going wrong without it: I ask for a whole feature in one prompt and the agent makes dozens of decisions I never see; after a long thread it loses track of what we decided and tries to figure everything out again; it fixes one bug and breaks three other things; it says a step is done and I have no way to check; and when a fix fails, I keep patching in the same chat until the thread itself is arguing for the wrong answer. HARD RULES: 1. ATOMIC STEPS. Each step is one sentence of intent and one check. If the sentence needs "and", split it into two steps. A step must be small enough to finish in one fresh chat and one commit. 2. EVERY STEP HAS A RUNNABLE CHECK. A command, a test, a curl request, or a specific page and click with the exact expected result. "Looks right", "works well" and "is clean" do not count. If it can't be checked with a command or a click, rewrite the step. 3. WORKING APP AFTER EVERY STEP. Order steps so the app still runs after each one. Build the thinnest end-to-end slice first (one screen, one piece of data, saved and shown), then widen it. No step may leave the app broken while waiting for a later step. 4. RISKY THINGS EARLY. Git, project setup, the database shape, secrets in a gitignored .env, and any outside service (login, payments, email, an AI API) get their own steps near the start, not bolted on at the end. 5. FILES TOUCHED. Each step names the files or folders it expects to create or change. Anything else is out of bounds for that step. 6. COMMIT AND CHECKPOINT. Each step has a short commit message. Once its check passes, I commit, and that commit is the last known good point. 7. NEVER INVENT. Use only what I tell you. If something is missing, don't silently pick a typical default: mark it [ASSUMED: ...] so I can confirm or change it. 8. FIT IN CONTEXT. Keep plan.md under about 150 lines. If the build needs more than about 20 steps, plan phase 1 in full and list later phases as one-line headings only, to be expanded when phase 1 is done. 9. NOT A PRD. Don't restate the product spec. Point to PRD.md if I have one, and write a 3-line project overview I can paste into every new chat. BEFORE WRITING, ask me these in one short batch and STOP: 1. What are you building, in one or two sentences? Paste your PRD.md if you have one. 2. Which agent or builder do you use, and which stack? "No idea" is a fine answer. 3. Is there existing code? Which parts work and must not be broken? 4. What is the smallest version you'd call a success, and what is out of scope for now? 5. Which outside services must it connect to (login, payments, email, database, an AI API)? 6. How do you check things today: automated tests, a terminal, or only clicking around in the browser? 7. Is the project in git yet? Then reply using exactly these sections: PLAN.MD: the complete file in one markdown code block, with these headings: # [Project] build plan (date and a one-line objective under the heading) ## Project overview (3 lines, pasted into every new chat to prevent drift) ## Out of scope (non-goals, plus a TODO list for ideas that come up mid-build) ## Steps: one table with columns # | Step | Files | Done when (check) | Commit message | Status. Number steps by phase (1.1, 1.2, 2.1) so I can say "do 1.1 to 1.3, skip 1.4". Every status starts as todo. ## Work log: empty, with a one-line note telling the agent to record errors, decisions and anything it deferred here. ## Stop rule: if a step's check fails twice, revert to the last good commit, rewrite the step smaller, and start a fresh chat. Never stack a new fix on a failed fix. AGENT INSTRUCTIONS: a short block I paste at the top of every new chat. Read plan.md and the project overview. Do only the step I name and don't get ahead to later steps. Don't fix unrelated bugs you notice; log them in the work log instead. Ask before touching any file not listed for that step. Run the step's check and show me the result, then update its status and stop. STEP 1 MESSAGE: the exact message I paste into a fresh chat to start step 1.1. ASSUMED: every [ASSUMED] item, one per line. SPLIT: every step you split because it needed "and", one line each, so I can see how the work was cut. Plain text outside the code block, no intro, no pep talk. Here are my details (fill in what you can, or leave blank and answer the questions): What I'm building: [FILL IN OR PASTE PRD.md] Agent and stack: [FILL IN] Existing code: [FILL IN OR "starting from scratch"] Start with the questions.
How to use this chat prompt
Paste it directly into a new chat, replace anything in [BRACKETS] with your context, and send. Re-use it whenever the task comes up, or save it as a text-expander snippet.
Example output
Habit tracker with a PRD.md already written, Next.js and Supabase in Cursor, nothing built yet, checks done by clicking.
1. Set up the project. 2. Build the database. 3. Add authentication.
4. Build habit tracking and streaks. 5. Polish, test and deploy.
PLAN.MD: ## Steps | # | Step | Files | Done when (check) | Commit message | Status |
| 1.1 | Scaffold the Next.js app | app/, package.json | npm run dev serves localhost:3000 | chore: scaffold app | todo |
| 1.2 | Show one habit from Supabase on the home page | app/page.tsx | reload shows "Drink water" | feat: list habits | todo |
## Stop rule: check fails twice, revert to the last good commit, rewrite the step smaller, fresh chat.
AGENT INSTRUCTIONS: Read plan.md. Do only the step I name. Log unrelated bugs, don't fix them.
FAQ
Frequently asked questions
How do you plan a vibe coding project?
Decide what you're building first, then decide the order. If scope is still fuzzy, write a PRD for vibe coding before anything else, so the agent has non-goals and acceptance criteria to work against. Then turn that into a build plan: small numbered steps, each with one check you can run, built so the app still works after every step. This prompt does the second part and saves it as plan.md in your project.
What is the difference between a PRD and a build plan?
A PRD says what you're building and what you're not: scope, edge cases, acceptance criteria. A build plan says in which order to build it and how to check each piece. Builders often find a PRD too broad to hand straight to an agent, which is why this prompt splits the work into steps with the files touched, a done-when check and a commit message. It points back to your PRD.md instead of restating it.
How small should each step be for an AI coding agent?
One sentence of intent and one check. A handy test: if the step's sentence needs "and", it is probably two steps. It should fit in one fresh chat and end in one commit. The prompt lists every step it split this way, so you can see how the work was cut and merge two back if they feel too small.
How do you stop AI from breaking working code?
Keep the blast radius small. Each step names the files it may touch, you commit after every step whose check passes, and the stop rule says to revert to the last good commit after two failed fixes instead of patching on top of a broken attempt. None of this guarantees zero regressions, so still read the diff. For rules that should load every session, paste the agent instructions into a file built with the AGENTS.md generator.
Should I use one chat per feature or per step?
Per step works well with this plan. Long threads tend to drift, and a chat that produced a wrong fix keeps nudging the agent back toward it. Starting each step in a fresh chat with the project overview and the agent instructions pasted at the top keeps the context short and clean. Since plan.md is plain Markdown, you can paste it into a previewer to check the table renders before you commit it.
Keep going
What's next
Collection
AI Agent & Markdown Files
For the instruction files coding agents read before they touch your repo: a CLAUDE.md that Claude Code actually follows, an AGENTS.md that works across Codex, Cursor and Claude, project rules files, and the build, test and style notes you keep repeating in every chat.
Tool
Markdown Live Preview
Paste markdown or drop a .md file and see it rendered instantly. Nothing leaves your browser.
Prompt
Write a PRD in Markdown Before You Vibe Code
For when your AI coding agent keeps filling gaps with guesses, adds features you never asked for, or rewrites working code to fix one bug. Answer nine plain questions about what you're building. It writes a one-page PRD.md with a What NOT to build list, edge cases and checkable acceptance criteria, then splits it into small task cards and a first message so Cursor, Claude Code or Lovable builds one story at a time.