DEV Community

Cover image for Vibe coding prompts: write a spec the AI can build
Junmin Huh
Junmin Huh

Posted on Originally published at pantheontable.com Fully Autonomous

Vibe coding prompts: write a spec the AI can build

Originally published at pantheontable.com/blog/vibe-coding-prompts-write-a-spec

Asked an AI tool for a 'simple, clean' app and got something different every time? The gap is usually in the request, not the tool.

The tool fills every gap you leave with a guess of its own. Below is how to close those gaps with a short spec, from what Fred Brooks, Andrej Karpathy, Joel Spolsky, Nathan Barry, Marty Cagan, David Heinemeier Hansson and Simon Willison wrote and said, and from the tools' own guidance, with every record linked to its source.

The short answer

If the AI builds something different from what you meant, the gap is usually in the request, not the tool: it can only work from what you put in front of it. The vibe coding prompts that work read like a short spec written in specifics: who the app is for, the one job it does first, what done looks like and what stays out. Have the tool interview you, save the answers as SPEC.md, read its plan before it edits anything, then build in small steps you check.

Why the AI builds something different from what you meant

You type what you want, the tool builds something else, and you wonder how to explain your app so it gets built right the first time. The tool fills every gap you leave with a guess of its own. A one-line request leaves nearly everything open: who uses the app, what it keeps, what happens when something goes wrong, what it must not do. The thinking that closes those gaps is still yours.

Principle: Tools cannot do the thinking. Brooks argues that most project time is spent thinking, so even a tool doing everything but the thinking yields limited gains; real improvement requires changing how you think.

Fred Brooks, Wikiquote: Fred Brooks

A tool that writes every line of code still leaves the thinking about what to build with you, and Brooks puts most of a project's time there.

"Software 3.0 is about programming through prompting. What's in the context window is your lever over the interpreter, and the interpreter is the LLM."

Andrej Karpathy, Sequoia Ascent 2026 summary (2026-04-30)

Quote card: Andrej Karpathy, with the source

Read your prompt as that lever: whatever you leave out of the context window, the model cannot use.

So the fix is not a cleverer phrase. It is a better description, written down before the build starts. The sections below show what goes into it, from the tools' own guidance and from what the masters wrote about specs and building software.

Write specifics, not adjectives

Principle: Write specs in specifics, not adjectives. Spolsky holds that a spec describing a product with adjectives like revolutionary or extremely cool signals trouble; a buildable spec names concrete details programmers can implement.

Joel Spolsky, The Big Picture (2007-01-21)

Swap every adjective in your prompt for a detail someone could build and then check.

Words like simple, modern or user-friendly feel like instructions, but the AI has to invent what they mean. Replace each one with something you could point at: the screen, the button, the fields, the message the user sees. The tools' own guidance asks for the same precision when you want something fixed.

Checked fact: A specific prompt names the place, describes the symptom and says what fixed looks like; this usually saves a round of corrections.

Anthropic, Claude Code best practices; Cursor quickstart; Replit and Bolt documentation, checked 2026-11-18

"Show me your flowcharts and conceal your tables, and I shall continue to be mystified. Show me your tables, and I won't usually need your flowcharts; they'll be obvious."

Fred Brooks, Wikiquote: Fred Brooks

Quote card: Fred Brooks, with the source

In an app spec, the tables are the things your app keeps; describe them clearly and much of the rest becomes obvious to the tool as well.

  1. List every adjective in your draft prompt and cross it out.
  2. Under each one, write what a user would see or do instead, for example: a list of today's orders, newest first, with a Mark as done button.
  3. Name the data the app keeps: each kind of thing and what you record about it, such as an order with a customer name, a pickup time and a status.
  4. Add a line for what happens when something goes wrong, such as an empty list or a wrong password.

Narrow the first version to one exact use case

A spec that tries to describe the whole app at once gives the AI too much to get wrong, and gives you too much to check. Pick the one job the first version must do for one kind of user, and write everything else down as later.

Principle: Narrow the use case, find a developer mentor. Barry advises non-technical founders building SaaS with AI coding agents to narrow down to one exact use case and get a developer mentor to explain why they are stuck.

Nathan Barry, The Most Important Advice For Creators in 2025 (Nathan Barry Q&A) | 093 (2025-09-03)

Barry gives this advice to non-technical founders building with AI coding agents, which makes it the closest fit for this problem.

Principle: Iterate Toward the Smallest Viable Product. Focus on discovering the smallest possible product sufficient to sell to early adopters before trying to meet broader market needs.

Marty Cagan, Product Market Fit vs. Product Vision (2011-10-31)

Cagan reaches the same narrowing from the market side: find the least that early adopters would buy, then grow from there.

Podcast summary: Episode 604 | How to Decide Which Features to Build (with Derrick Reimer). Read it for how a founder decides what to build next by strategy rather than by feature votes. (the episode's official page)

  1. Write one sentence: who the app is for and the one job it does for them.
  2. Write what done looks like for that job, as something you can try and see pass or fail.
  3. Start a Not in this version list and put every other idea on it, however good it is.

How to write a spec for AI coding: let the tool interview you

You do not have to write the spec alone, or know in advance which questions matter. Anthropic's best-practice page for Claude Code turns the job around: the tool asks, you answer, and the answers become a file.

Checked fact: Anthropic's best-practice page suggests asking Claude to interview you until it could write the spec and then save it to a file such as SPEC.md.

Anthropic, Claude Code best practices; Cursor quickstart; Replit and Bolt documentation, checked 2026-11-18

Checked fact: It then advises starting a fresh session to build from that file, so the build begins with a clean context and a written definition of done.

Anthropic, Claude Code best practices; Cursor quickstart; Replit and Bolt documentation, checked 2026-11-18

Checked fact: Replit's first-app guide tells you to put the outcome, the success criteria and the boundaries in the first prompt.

Anthropic, Claude Code best practices; Cursor quickstart; Replit and Bolt documentation, checked 2026-11-18

What happened (2005): Simplifies Aardvark so only the helper initiates. Spolsky's first spec draft let either the helper or the victim start a session, which grew convoluted. Working through the screens, he required the helper to start, making the product radically simpler; the change took an hour or two in the spec instead of weeks in code.

Lesson: Simplify the product while it is still on paper, where changes are cheap.

Joel Spolsky, The Project Aardvark Spec (2005-08-17)

This is what the interview buys you: the awkward choice shows up while the product is still on paper, where simplifying it is cheap.

  1. Start a session and describe your idea in a few plain sentences.
  2. Ask the tool to interview you, one question at a time, until it could write the spec.
  3. Read the draft SPEC.md and rewrite every line that still leans on an adjective or a guess.
  4. Check that it states the outcome, the success criteria and the boundaries.
  5. Open a fresh session and ask the tool to build from SPEC.md.

Read the plan before the tool edits anything

Checked fact: Plan mode in Claude Code explores and proposes a plan without editing your files; Plan Mode in Cursor researches, asks clarifying questions and waits for your approval, and Cursor recommends it for bigger changes.

Anthropic, Claude Code best practices; Cursor quickstart; Replit and Bolt documentation, checked 2026-11-18

A plan is your spec read back to you in the tool's own terms, before any file changes. Treat it as a test of the spec: if a step in the plan surprises you, the spec left that point open, and the place to settle it is the spec.

Principle: Make design changes in the spec, not code. Spolsky practices Big Design Up Front because a change that takes an hour or two in a spec can add weeks if made in code.

Joel Spolsky, The Project Aardvark Spec (2005-08-17)

An AI tool rewrites code faster than a team, yet a change made in the plan still spares you from undoing work already spread across your files.

"In my mind, there's only one form of spec that can deliver on these requirements, and that is the high-fidelity prototype."

Marty Cagan, Revisiting the Product Spec (2006-10-12)

Here Cagan pulls the other way from Spolsky: the spec worth trusting is one people can click.

You can take both sides, and AI tools make that cheap. Write the short spec first, as Spolsky's practice suggests, then let the tool build a clickable version, as Cagan's view suggests. What you learn from clicking it goes back into SPEC.md as edits, not into a stream of patch requests.

Vibe coding prompts you write once: CLAUDE.md and AGENTS.md

Some instructions belong in every session: how the project is laid out, the command that runs its checks, the style you expect. Instead of retyping them, put them in a project instruction file the tool reads on its own.

Checked fact: CLAUDE.md is a markdown file that Claude Code reads at the start of every session; the project file lives at ./CLAUDE.md or ./.claude/CLAUDE.md and a personal one at ~/.claude/CLAUDE.md.

Anthropic, Claude Code documentation 'How Claude remembers your project'; agents.md; OpenAI, Codex documentation on AGENTS.md, checked 2026-11-18

Checked fact: AGENTS.md is an open format described as a README for agents; its site says it is stewarded by the Agentic AI Foundation under the Linux Foundation and used by over 60,000 open-source projects.

Anthropic, Claude Code documentation 'How Claude remembers your project'; agents.md; OpenAI, Codex documentation on AGENTS.md, checked 2026-11-18

Principle: Use style guides for agents. Provide specific instructions and constraints in a reference file to ensure AI outputs align with personal or organizational standards.

David Heinemeier Hansson, Transcript for DHH: Future of Programming, AI, Agentic Engineering, Vibe Coding & Linux | Lex Fridman Podcast #501 - Lex Fridman (2026-08-26)

A short reference file is where your standards live, so each prompt can stay about the task at hand.

Keep that file short. Anthropic's docs say Claude Code reads it as context rather than as a rule it must obey, and that long files are followed less reliably. So the spec for the feature goes in SPEC.md, and the instruction file holds only the standing rules.

Podcast summary: DHH: Future of Programming, AI, Agentic Engineering, Vibe Coding & Linux. Read it for a programmer who no longer types code by hand yet still decides what gets built and edits what the agents produce. (the episode's official page)

Expect to iterate, and stay in charge of taste

"With these tools, you should always see them as something you iterate with. They will very rarely give you the right answer first time, but if you go back and forth with them you can usually get there."

Simon Willison, Imitation Intelligence, my keynote for PyCon US 2024

Quote card: Simon Willison, with the source

A good spec does not make the first build final; it makes each round of back and forth shorter.

"Seeing a new website materialize so quickly is a strong hook. I felt like I was 80% done but (foreshadowing...) it was a bit closer to 20%."

Andrej Karpathy, Vibe coding MenuGen (2025-04-27)

Karpathy's note on vibe coding MenuGen is a fair warning about how finished a first build can look.

Checked fact: Lovable's quick start says to iterate with one change at a time; Replit's guide says to ask for one focused improvement and then retest.

Anthropic, Claude Code quickstart and best practices; Cursor, Lovable, Replit and GitHub quickstarts, checked 2026-11-18

"Right now the agents are like interns. You still have to be in charge of aesthetics, judgment, taste, and oversight."

Andrej Karpathy, Sequoia Ascent 2026 summary (2026-04-30)

The spec is how you hand an intern a clear task; judging what comes back stays your job.

So plan for rounds. After the first build, try the one job from your spec as a real user would, write down what is wrong in specifics, and ask for one fix at a time. When a change of mind is bigger than a fix, edit SPEC.md first and build from it again.

Podcast summary: Episode 459 | From Day Job to Productized Service to Fast-Growing SaaS as a Non-Technical Founder. Read it for a non-technical founder whose hardest job was clear, steady direction to his developers, which is the job you now do for an AI tool. (the episode's official page)

Questions people ask

What makes a prompt for an AI coding tool work?

Specifics. For a change, name the place, the symptom and what fixed looks like; for a new app, say who it is for, the one job it does first, what done looks like and what stays out. Adjectives like simple or modern leave the AI to guess.

How to write a spec for AI coding if I am not technical?

Ask the tool to interview you until it could write the spec, save the answers as SPEC.md, then start a fresh session to build from it. Your part is to answer in specifics and to cut the first version down to one use case.

Which prompts for Claude Code help most on a new project?

Start with an interview that ends in SPEC.md, use Plan mode so Claude Code proposes a plan before it edits your files, then build from the spec in a fresh session. Keep standing rules in a short CLAUDE.md.

What is the difference between CLAUDE.md, AGENTS.md and a spec?

CLAUDE.md and AGENTS.md hold short standing instructions that a tool reads before it works on your project. A spec describes the one app or feature you are about to build, and it changes as you learn.

Why does the AI still get things wrong when I give it a spec?

Because a first build is rarely final: the tools work best as something you iterate with. Ask for one change at a time, check each one, and if corrections keep failing, start a clean conversation with a better prompt.

Bring your own question

If you have an idea and want to see it as a first version, bring a request like "My app idea is a booking page for my dog-walking business. Can you turn it into a one-page spec: who it is for, what done looks like, and what to leave out of the first version?" to The Pantheon Table. Your business and investing questions are answered there with the real words of world-class masters: https://pantheontable.com/blog/vibe-coding-prompts-write-a-spec?utm_source=devto&utm_medium=social&utm_campaign=blog

The masters' words are quoted from public records, each with its source. None of them wrote, reviewed or endorses this guide.

Photo: Gladwin Analytics, CC BY 3.0. Photo: Paul Downey from Berkhamsted, UK, CC BY 2.0.

Not affiliated with or endorsed by Andrej Karpathy or Simon Willison.

Top comments (0)