How to Prompt AI for a Technical Spec Document
A six-step prompt sequence that turns a rough feature idea into a real technical spec, with a worked example prompt and the failure mode of asking for it all in one shot.
How to Prompt AI for a Technical Spec Document
Ask an AI model to write a technical spec in one prompt, and you get a document that reads well and matches almost nothing your team agreed on. The model fills every gap you didn't cover: it invents a data model, assumes a tech stack, and picks defaults for edge cases nobody discussed. The fix isn't a better single prompt. It's a short sequence of prompts, each one locking down one section before you move to the next: problem, scope, non-goals, data model, edge cases, open questions. Below is the actual sequence, a worked example, and how to phrase each step so the model asks instead of assumes.
Why a one-shot spec prompt fails
Feed a model one paragraph, say "we need a way for users to bookmark articles and organize them into folders," and ask for a full spec, and it hands back a confident five-page document. It will also invent a tag limit, decide bookmarks sync in real time across devices, assume a Postgres schema, and pick REST over GraphQL, none of which you said. Anthropic's own prompt engineering guidance makes the underlying issue explicit: a model acts on what's literally written and fills gaps with whatever is statistically plausible, it doesn't flag them as missing or ask you to fill them in.
This is the same gap-filling problem prompt engineering deals with generally, just with higher stakes: every invented detail becomes something an engineer builds against, and nobody catches the mistake until the feature ships wrong.
The multi-step sequence that works
Break the spec into six passes instead of one request. Each prompt produces a single section, you review and correct it, then feed the approved text, not the model's raw draft, into the next prompt.
Problem statement. Ask for three to five sentences on what pain this solves and for whom, nothing about the solution. Tell the model to write [NEEDS INPUT] instead of guessing a number or a segment you didn't mention.
Scope. Ask what's in scope for a first version, built strictly from the original idea. Anything not stated shouldn't appear here.
Non-goals. Ask for adjacent features people will assume are included but aren't: real-time sync, sharing, multi-user folders. This is the section most one-shot specs skip entirely.
Data model. Ask for entities and fields drawn only from the approved scope, with every inferred field labeled inferred so you can confirm or cut it.
Edge cases. Ask the model to phrase these as open questions, not answered behavior, since edge case handling is usually a product decision, not a technical one.
Open questions. Ask the model to compile everything it flagged as [NEEDS INPUT] or inferred across the previous five prompts.
A final prompt stitches the six approved sections into one document in that order: problem, scope, non-goals, data model, edge cases, open questions.
A worked example
Say the actual one-paragraph idea is: "We want users to be able to bookmark articles in our app and put them into folders they name themselves." The first prompt in the sequence looks like this:
You are helping me turn a rough feature idea into a technical spec, one section at a time. Do not write the full spec yet.
Raw idea: "We want users to be able to bookmark articles in our app and put them into folders they name themselves."
Write ONLY a problem statement, 3-5 sentences: what pain this solves, who has it, why it matters now. Do not propose a solution, a data model, or any UI. If you're missing information you'd need to answer accurately (current bookmark requests, retention data), write [NEEDS INPUT] instead of guessing a number.A model that follows this comes back with something like: "Users have no way to save an article to read later inside the app. They currently email links to themselves or leave tabs open, which loses articles between sessions. [NEEDS INPUT]: volume of support tickets requesting this." That's usable. It names the gap instead of papering over it.
Approve or edit that paragraph, then move to scope, feeding the approved text back in: "Given this approved problem statement, list what's in scope for the first version only. Base every item on the original idea, don't add anything it didn't mention." Repeat for non-goals, data model, edge cases, and open questions, in that order.
How to keep the model from inventing requirements at every step
Ban invention in the prompt itself, every time. "Base this only on what I've given you. If something's missing, write [NEEDS INPUT] or ask a question, don't pick a default" works better repeated in each prompt than stated once at the start.
Ask for an assumptions list after every section, even a short one. Models flag some gaps and quietly fill others; a dedicated "what did you assume" pass catches what slipped through.
Feed forward only the text you approved, not the model's own last draft. Errors compound fast if an unapproved guess from step two becomes an accepted fact by step four.
For edge cases, ask for questions, not resolved behavior. "What happens when a folder name is a duplicate?" beats an invented answer, since the right answer is usually a product call, not something the model should decide.
One way to make the ban-invention instruction actually stick across all six prompts: wrap the raw idea and each approved section in its own tag so the model can never confuse your input with its own earlier draft. How to use XML tags to structure AI prompts covers the pattern in more depth.
From spec to build
Closing the open questions and getting scope and non-goals signed off is what makes a spec usable. From there the document becomes the input for actually building the feature. That's a separate prompting problem, covered in how to build an app with AI, where the spec you just wrote does the same job a PRD does for a human engineering team.
The same section-by-section approach works in reverse, too: prompting AI to write a user manual takes a finished feature and documents it for end users, and prompting AI to summarize a long document is worth knowing once the spec itself gets long enough that stakeholders won't read it end to end.
Frequently asked questions
What's the difference between a PRD and a technical spec?
A PRD describes what to build and why, aimed at product and business stakeholders. A technical spec describes how, aimed at engineers, and covers what a PRD usually skips: data model, API shape, edge cases, non-goals. The problem statement and scope sections from this sequence double as a lightweight PRD if you don't already have one.
Do I need to give the AI a spec template, or let it structure the document itself?
Give it the section order. Left alone, models default to whatever structure is most common in training data, which drifts between requests and makes specs hard to compare across a team. Naming the six sections up front keeps every spec in the same shape.
What if the AI still invents requirements despite these prompts?
It will occasionally, especially in the data model and edge case sections. Read those two line by line rather than skimming; a plausible-sounding invented field is easy to miss and expensive to catch after an engineer has built against it.
How long does this six-prompt process actually take?
For a small feature, 15 to 25 minutes including your review of each section. That's longer than one prompt and a copy-paste, but shorter than the rewrite cycle a wrong one-shot spec costs once someone starts building from it.
Can one detailed prompt with a template ever replace the six-step sequence?
For a feature you already understand completely, sometimes. But the multi-step version's value is the checkpoint between sections: you catch a wrong assumption in scope before it becomes a wrong field in the data model. One prompt, however detailed, gives you nowhere to catch that until the whole document is done.
How did this land?
About the author

Developer Advocate
Steve builds something with Swarmz every week and writes up what worked, what broke, and what he'd do differently. Tutorials and hands-on guides are his lane.


