TL;DR
Good vibe coding prompts are boring and specific. Give the AI a one-page PRD to read first and a rules file it follows on every task, ask it to plan before it codes, build one small step at a time, and report bugs with the exact error while asking for the cause before the fix.
The workflow matters more than the wording: test and commit after each step, start a fresh chat when the AI loops, and run a security review prompt before launch. Every template below has a copy button.
The 8 workflow rules that matter more than any prompt
Most “bad AI code” is a workflow problem. These rules come from the official guidance of the tool makers and from makers who ship with AI daily.
- Write the spec first. The AI fills every gap you leave with a guess.
- Plan, then build. Anthropic’s own Claude Code guidance recommends asking the agent to explore and make a plan before writing code (source: anthropic.com).
- One step per prompt. Small diffs are easy to test and easy to undo.
- Commit after every working step. Git (or your builder’s version history) is your undo button.
- Give standing rules in a file, not in every message:
AGENTS.md,CLAUDE.mdor Cursor rules. AGENTS.md is a shared convention read by many agents (source: agents.md). - Paste exact errors. “It doesn’t work” gets a guess; a stack trace gets a fix.
- Reset when it loops. After two or three failed fixes, start a new chat with a summary instead of pushing on.
- Review before you trust. Read the diff, or have a second model or a review bot read it. Prajwal Tomar’s agency, which says it has shipped more than 60 MVPs, adds CodeRabbit code review to its Lovable, Cursor and Supabase stack (source: prajwaltomar.co).
Template 1: a one-page PRD the AI reads first
Save this as SPEC.md in the project, or paste it as the first message in Lovable, Bolt, v0 or Replit. The sections that save the most time are Data (the AI designs tables badly when left to guess), Out of scope (stops feature creep) and Done means (gives it a finish line).
# PRD: <App name> ## One-liner <App> helps <specific user> <do one job> without <current pain>. ## Users - Primary: <who, in one sentence> - Not for: <who we are explicitly ignoring in v1> ## Core flow (the one thing that must work) 1. User lands on <page> and <action>. 2. User signs up with <email magic link / Google>. 3. User <core action>. 4. User sees <result> and can <share / export / come back later>. ## Screens - / (landing): headline, one screenshot, sign-up button - /app (dashboard): <what is listed, what can be clicked> - /app/<item> (detail): <fields shown, actions> - /settings: email, delete account ## Data - users: id, email, created_at - <items>: id, user_id (owner), <field>: <type>, created_at Rule: a user can only read and write rows where user_id = their id. ## Integrations - Auth + database: <Supabase / Firebase / built-in> - Payments: none in v1 (or: Stripe Checkout, one plan, $<x>/mo) - Email: <Resend / none> - AI: <model and what it is used for, with a monthly spend cap> ## Out of scope for v1 - Teams, roles, admin panel, mobile app, dark mode, i18n ## Done means - A new user can complete the core flow on mobile and desktop in under 2 minutes. - No secrets in client code; every table has row-level security. - Deployed at <domain> with analytics and error tracking.
Planning is valuable enough that makers sell it. Sebastian Volkis, who built TrendFeed with AI in four days, now runs CodeSpring, a planning workspace that turns mapped features into PRDs and tasks for Claude Code, Codex and Cursor (source: codespring.app).
Template 2: a project rules file
A rules file is read at the start of every session, so you write your standards once. Name it CLAUDE.md for Claude Code, AGENTS.md for Codex and other agents, or put it under .cursor/rules for Cursor. Browser builders such as Lovable and Bolt have a project knowledge or instructions field that does the same job.
# Project rules (AGENTS.md / CLAUDE.md / .cursor/rules) ## Stack - <Next.js + TypeScript + Tailwind + Supabase>. Do not add new frameworks or libraries without asking. ## How to work - Read SPEC.md and PROGRESS.md before every task. Update PROGRESS.md when a task is done. - Plan first: for anything touching more than 2 files, show the plan and wait for "go". - One task at a time. Do not refactor or "improve" code outside the task. - After changes, run the type checker, linter and tests, and fix what you broke. ## Code - Keep files under 300 lines; split by feature. - Reuse existing components and helpers before writing new ones. - No placeholder or mock data in production code paths. ## Security (never break these) - Never put secret keys in client code or commit them. Use environment variables. - Every new table gets row-level security policies scoped to the owner. - Every API route and server action checks the session before reading or writing data. - Validate all user input on the server. - Only install packages you can confirm exist and are maintained; tell me the package name first.
Add a rule every time the AI makes the same mistake twice. Tony Dinh, building a browser game with Claude Code, added a 500-line file limit and a no-needless-comments rule after one file passed 3,000 lines (source: news.tonydinh.com).
Prompts for planning and building
Read SPEC.md and the existing code. Don't write code yet. Task: <feature>. 1. Explain how this fits the current structure (which files, which tables). 2. List the changes you would make, file by file. 3. Call out risks: data migrations, security, anything that could break existing features. 4. Ask me any question whose answer would change the plan.
Implement step <n> from the plan: <one sentence>. Only this step. Keep the existing design system and components. When done: list the files you changed, how to test it by hand, and anything you were unsure about.
Build the <page> screen. Layout: <describe sections top to bottom>. Style: match the existing components; spacing and type from the current pages; mobile first. Reference: <attach screenshot or describe a site whose layout to borrow>. States to handle: loading, empty (first-time user), error, and a long list (50+ items).
For UI, a screenshot of a layout you like beats three paragraphs of description in every tool that accepts images. Always ask for the empty, loading and error states; AI tools skip them unless asked, and they are the first thing a new user sees.
Prompts for debugging
Bug report. Expected: <what should happen> Actual: <what happens> Steps: <1, 2, 3> Error (exact): <paste console / server log> What changed recently: <last prompt or commit> Before changing anything: explain the most likely cause and how you'd confirm it. Then fix the cause, not the symptom, and tell me how to verify the fix.
We've tried to fix this 3 times without success. Stop patching. 1. Summarise what we know and what each attempt changed. 2. List 3 different hypotheses for the root cause. 3. Suggest how to test each one cheaply (a log line, a minimal reproduction). Revert any changes from the failed attempts that are not needed.
Asking for the cause before the fix is the single most useful debugging habit. It stops the “fix one bug, create two” spiral, because a wrong explanation is easy to spot before any code changes.
Prompts for security review, refactoring and tests
Run the security prompt before launch and after any change to auth, payments or the database. It does not replace a human review, but it catches the common mistakes covered in our vibe coding security checklist.
Act as a security reviewer for this app. Don't change code yet; produce a report. Check and list file + line for every finding: 1. Secrets: any API keys, service_role keys or tokens in client code, the repo or logs. 2. Database: every table has row-level security enabled, and policies restrict reads/writes to the owner. 3. Auth: every page, API route and server action that touches private data verifies the session server-side. 4. Input: user input validated server-side; no raw SQL string building; no dangerouslySetInnerHTML with user content. 5. Payments: prices and entitlements decided on the server, webhooks verified with the signing secret. 6. Abuse: rate limits on sign-up, login, AI and email endpoints; spend caps on paid APIs. 7. Dependencies: any package that is unmaintained, has few downloads or that you are not sure exists. Rank findings by severity and propose the smallest fix for each.
Refactor <file or feature> without changing behaviour. Goals: smaller files, no duplicated logic, clear names. First write or list tests that pin the current behaviour, then refactor, then run them. Do not touch unrelated files.
Write automated tests for the core flow in SPEC.md: sign up, <core action>, see result. Also cover: a logged-out user can't reach /app, and user A can't read user B's <items>. Use the project's existing test setup; if there is none, propose one and wait for my OK.
Tips by tool
| Tool type | What works | What to avoid |
|---|---|---|
| Browser builders (Lovable, Bolt.new, Replit, Base44, v0) | Paste the PRD first; fill the project knowledge field; use chat or plan mode for questions before edits. | Long vague prompts that change five things; burning credits on retries instead of reverting. |
| AI editors (Cursor, Windsurf) | Rules files; tag the exact files with @; review each diff before accepting. | Accepting multi-file diffs unread; letting context fill with unrelated files. |
| Terminal agents (Claude Code, Codex) | CLAUDE.md / AGENTS.md; plan mode; let it run tests and the type checker; work in branches. | Broad permissions on production systems; running against live databases. |
Many builders mix them: prototype the UI in a browser tool, then move to an editor or terminal agent once the app has real users. Our vibe coding tools page compares them in depth.
What experienced makers do differently
- Kitze tours conferences with a talk titled “From Vibe Coding to Vibe Engineering”, arguing for keeping engineering discipline while the AI types (source: kitze.io).
- Mckay Wrigley open-sourced the app template he starts new full-stack projects from, so every project begins with the same structure the AI already knows (source: github.com).
- Ian Nuttall, an SEO veteran, ships small SEO tools with Cursor, Claude Code and Codex, and reported about $100K ARR across two of them four months after launch (source: twitter.com).
- Alex Finn built Creator Buddy largely with AI coding tools and now teaches the workflow in a paid community (source: betterlaunch.co).
- Riley Brown co-founded Vibecode, a prompt-to-app builder that raised a $9.4M seed round in 2025, after building his own apps with AI agents (source: businessinsider.com).
The common thread: they invest in the scaffolding (specs, templates, rules, review) once, so each prompt can be short. If you are just starting, read how to start vibe coding first, and see Karpathy’s original post for where the term came from (source: x.com). For more structured learning, compare free courses in our courses guide.
Frequently asked questions
What is a good vibe coding prompt?
A good vibe coding prompt asks for one specific change, points to the spec and the relevant files, names the states to handle (loading, empty, error) and says how you will check the result. For bugs, it includes expected vs actual behaviour and the exact error, and asks for the cause before the fix.
What are vibe coding best practices?
Write a one-page spec, keep standing rules in a file the agent reads every session, plan before building, change one thing per prompt, test and commit after each working step, start a fresh chat when the AI loops, and run a security review before real users arrive.
Should I write a PRD before vibe coding?
Yes, even a short one. A one-page PRD that lists users, the core flow, screens, data, what is out of scope and what done means removes most of the guessing that leads to rewrites. Paste it as the first message or save it as SPEC.md in the project.
What should go in a CLAUDE.md or AGENTS.md file?
Your stack, how the agent should work (plan first, one task at a time, run tests), code conventions such as file size limits, and security rules it must never break, such as no secrets in client code and row-level security on every table. Add a rule whenever the AI repeats a mistake.
Why does the AI keep breaking things that worked?
Usually because prompts are too broad, the conversation has grown so long that early context is lost, or there are no tests to catch regressions. Ask for one change at a time, commit working states, start a new chat with a short summary, and add tests for the core flow.