PromptSharp › Prompt Library › Vibe Coding › Spec-first prompting: write the contract before you ask for code
Spec-first prompting: write the contract before you ask for code
You're about to ask the AI to build a feature. Write the one-page spec first — vague asks are why builds go sideways.
The prompt — copy and run it
You are a product-minded software architect helping a non-engineer specify a feature BEFORE any code is written. I will describe what I want in plain language. Produce: A) SPEC — what the feature does in 5 sentences or fewer: the user, the trigger, the inputs, the outputs, and what 'done and working' means in observable terms I can check myself. B) EDGE CASES + NON-GOALS — the inputs and situations the feature must handle (empty, wrong format, double-submit, slow network), and an explicit list of what this version will NOT do, so scope stays fixed. C) DATA + STATE — what needs to be stored or remembered, where it lives, and what happens to existing data if this changes. D) BUILD REQUEST — the spec rewritten as a single, precise instruction I can paste into my AI coding tool, with the acceptance checks listed at the end. Inputs: [WHAT I WANT, IN PLAIN LANGUAGE] · [THE APP IT LIVES IN + TECH IF KNOWN] · [WHO USES IT] · [WHAT EXISTS TODAY] Rules: Do not invent requirements, tech constraints, or existing behavior I didn't state — list every assumption as an open question for me to answer instead. Where 'done' can't be checked without running the app, say exactly what I should click and what I should see so I can verify it myself. Never include API keys, passwords, or customer data in the spec — reference them as named placeholders.
Why this prompt works
Most AI-built features fail at the ask, not the code — a vague prompt gives the model room to guess. Writing observable 'done' checks and explicit non-goals before any code turns the model from a mind-reader into a contractor with a contract, and the assumptions-as-questions rule stops invented requirements from becoming silent scope.
Want the daily version?
The PromptSharp Vibe Coding Brief delivers prompts like this every day. Honest status: sample stage — 50 waitlist signups start the free daily, and waitlist members see every issue first.
Frequently asked
When should I use this prompt?
You're about to ask the AI to build a feature. Write the one-page spec first — vague asks are why builds go sideways.
Why does this prompt work?
Most AI-built features fail at the ask, not the code — a vague prompt gives the model room to guess. Writing observable 'done' checks and explicit non-goals before any code turns the model from a mind-reader into a contractor with a contract, and the assumptions-as-questions rule stops invented requirements from becoming silent scope.
What mistake does this prompt help you avoid?
{'code': 'PF08', 'note': 'The unwritten spec — edge cases and non-goals nobody stated. Observable done-checks and an explicit will-NOT-do list pin the contract before code exists.'}
Related Vibe Coding prompts
Architecture options: three ways to build it, priced in plain English
Before you accept the first approach the AI suggests, make it lay out the real options and what each costs you later.…
The debugging loop: reproduce, isolate, fix, verify — one step at a time
Something broke and your instinct is to paste the error and accept whatever rewrite comes back. Run the loop instead — one discipl…
All Vibe Coding free prompts
The PromptSharp Vibe Coding Brief page — five full free prompts plus the ladder status.
PromptSharp Daily — free
The cross-vertical sampler: one sharp, copy-paste prompt each day, rotating across the roster. See what each vertical is like before you commit to one.
Double-opt-in. Unsubscribe anytime. No spam, ever.
Home · Prompt Library · Pricing · Archive · Privacy · Terms · Refunds
Finance · CPG · Marketing · Sales · Consulting & Strategy · Product Management · Dev & Engineering · Vibe Coding · C-suite · Law · Personal Finance · Career & Job Search · Focus & Productivity · Learning · Health & Fitness · Parenting