00 — Why This Layer Exists
Here's what happens the first time most PMs prompt an AI coding tool: they type something that reads exactly like a Jira ticket title. "Add a way for users to save their favorite items." Then they wait, expecting something like what a competent engineer would produce from that same one-liner in standup — because a human engineer would ask three clarifying questions before writing a line of code.
An AI coding agent doesn't ask those questions unless you invite it to. It picks the most statistically plausible interpretation of "favorites" and runs with it: maybe a heart icon with no persistence, maybe a whole new database table, maybe a page that doesn't match anything else in your product. The build isn't wrong exactly — it's just an answer to a question you didn't mean to ask. Anthropic's own Claude Code documentation puts this plainly: Claude "can infer intent, but it can't read your mind" — the fix is reference specific files, mention constraints, and point to example patterns, not hope harder.
You already know how to prevent this kind of ambiguity — you do it every time you write a PRD or a user story with acceptance criteria. This layer is about porting that exact instinct into a new medium: a prompt, and its slightly more formal cousin, a spec (a short written document that pins down what should be built and how you'll know it's done, which you hand to the AI instead of an engineer). The muscle is the same. The syntax is different.
01 — PRDs and User Stories, Translated
A PRD (product requirements document) and a good prompt solve the same problem for two different readers. Both exist to eliminate ambiguity before work starts. The mapping is closer than it looks:
| Your PRD already has this | It becomes this for an AI coding tool |
|---|---|
| Problem statement / context | A sentence or two the AI reads before touching code — why this exists, not just what it is |
| User story ("As a user, I want…") | The literal task instruction — one story per prompt, not the whole epic at once |
| Acceptance criteria | A checklist the AI can test itself against — ideally something it can run, not just read |
| Out-of-scope notes | Explicit exclusions in the prompt — AI agents don't default to "minimal," they default to "plausible" |
| Design/technical constraints | References to existing code patterns, file names, and libraries already in use |
The one habit that doesn't transfer cleanly: PMs are trained to write PRDs that describe outcomes and stay agnostic about implementation, trusting engineers to fill in the "how." An AI coding agent has no such context by default — it needs you (or your spec) to either point it at the existing pattern to follow, or explicitly say "your call" if you genuinely don't care. Silence isn't neutral to a coding agent the way it is to a human engineer; it just resolves to a guess.
02 — Acceptance Criteria the AI Can Actually Check
This is the single highest-leverage change you can make to how you prompt. Coding agents are good at producing plausible-looking work and then declaring themselves done — because "looks done" is the only signal they have unless you give them another one. Anthropic's guidance for Claude Code is explicit on this point: give the agent "a check it can run: tests, a build, a screenshot to compare. It's the difference between a session you watch and one you walk away from."
That means the acceptance criteria you already write need one upgrade: make at least one of them checkable in the tool, not just readable by a person.
| Weak (PM-readable, not AI-checkable) | Strong (AI can verify it) |
|---|---|
| "Email validation should work correctly" | "Write a validateEmail function. Test cases: user@example.com → true, invalid → false, user@.com → false. Run the tests after implementing." |
| "The dashboard should look better" | "[paste screenshot] Implement this design. Take a screenshot of the result, compare it to the original, list differences, and fix them." |
| "Fix the login bug" | "Login fails after session timeout. Check the auth flow in src/auth/, especially token refresh. Write a failing test that reproduces the issue, then fix it." |
Notice the pattern: each "strong" version gives the AI a pass/fail signal it can generate and read for itself — a test, a diff against a fixture, a screenshot comparison — instead of an adjective ("better," "correctly," "properly") that only a human can judge. When you can't turn a criterion into something checkable, at minimum describe the symptom, the likely location in the codebase, and what "fixed" looks like — that alone cuts down guessing substantially.
03 — Scoping One Build Session
The single most common beginner mistake is treating a prompt like a wish to a genie: "build my whole app" in one shot. Coding agents work in a context window (the amount of conversation, file contents, and command output the model can hold in working memory at once) that fills up fast, and — per Claude Code's own documentation — "performance degrades as it fills." A session that starts strong on a big ask often drifts, forgets earlier instructions, or quietly cuts corners by message fifty.
The fix is the same one your engineering team already applies to sprints: break the work into small, independently testable increments — one user story per prompt, not one epic. A spec-driven-development toolkit released by GitHub frames this as the difference between "add photo sharing" (vague, guesses required) and a sequence of small, testable units like "create a user registration endpoint that validates email format" — each one testable in isolation, "like test-driven development for AI agents."
A rough sizing test: if you can't describe the diff (the set of changes) in one sentence, it's probably too big for one prompt. Anthropic's own advice for Claude Code draws the same line for planning overhead — skip elaborate planning for a small, clear fix; slow down and plan explicitly when a change touches multiple files or you're unsure of the approach.
04 — Managing Context: What the AI Needs to Know, and What to Leave Out
Context management is the part of this job that has no PRD equivalent, so it's worth spelling out plainly. Everything you paste into a prompt, every file the AI opens, and every command's output all live in the same finite context window. More isn't better — a cluttered context measurably degrades output quality.
What's worth including:
- The specific file or feature area, named directly, rather than "the app." AI coding tools can read a codebase, but pointing them at the right corner saves time and prevents them exploring (and filling context with) irrelevant files.
- An existing pattern to follow — e.g., "look at how HotDogWidget.php implements this on the homepage, follow that pattern." This is the AI equivalent of a style guide.
- Constraints that aren't visible in the code — required libraries (or ones to avoid), performance or compliance requirements, anything a PRD would flag as non-negotiable.
What's worth leaving out: - Backstory the AI doesn't need to write this code — the full history of why the feature was requested, prior debates, roadmap context. Save that for the PRD; the prompt needs the actionable slice. - Unrelated tasks bundled into the same conversation. Anthropic calls this the "kitchen sink session" failure pattern — starting one task, asking something unrelated, then returning to the first — and the fix is to start a fresh session between unrelated tasks rather than let old context linger and distract the model. - Full API documentation pasted inline, when a link or a narrower excerpt would do.
If you're doing this inside Claude Code specifically, there's a standing place for durable, always-true context — a file called CLAUDE.md that the tool reads at the start of every session (things like coding conventions or how to run tests). That's different from what goes in an individual prompt, which should carry only what's relevant to this task.
05 — The Loop: Prompt, Review, Refine
Treat the first output as a draft, not a delivery. The working pattern that both Anthropic and independent spec-driven-development guidance converge on looks like this:
- Prompt with a scoped task and a checkable acceptance criterion.
- Let the AI show its work — the test output, the command it ran, a screenshot — rather than just asserting it's done. If it can't show evidence, treat the result as unverified.
- Review against your original criteria, not against "does this look reasonable."
- Refine with a specific, targeted correction — not a vaguer restatement of the original ask.
One nuance worth knowing early: if you find yourself correcting the same issue more than twice in one conversation, stop correcting. The context is now cluttered with failed attempts, and a fresh conversation with a sharper initial prompt — informed by what went wrong — reliably outperforms continuing to patch a polluted session. This is counterintuitive if you're used to iterating in a live meeting, but with an AI agent, "start over with a better brief" is often faster than "keep explaining."
For a genuinely new feature, there's a stronger version of step 1 worth knowing: rather than writing the whole spec yourself, you can ask the AI to interview you first — walking through implementation questions, edge cases, and trade-offs you haven't considered — and only then write the spec to a file before any code gets touched. The most useful specs, on this guidance, are self-contained: they name the files and interfaces involved, state what's explicitly out of scope, and end with an end-to-end check that proves the feature actually works.
06 — Worked Example: One-Liner to Real Prompt
Start where most PMs start — a feature idea dashed off in a backlog:
One-liner: "Add a way for users to save their favorite items."
Before (what most beginners paste into the AI tool):
Add a way for users to save their favorite items.
This has no scope, no acceptance criteria, no pointer to existing patterns, and no way for the AI to check its own work. It will produce something — just not reliably the something you meant.
After (spec-to-prompt, applying every section above):
Context: Users currently browse items on the /catalog page (see
src/pages/Catalog.jsx) but have no way to bookmark them for later.
Task: Implement "Save to Favorites" for a single item card, scoped to
this user story only:
"As a logged-in user, I want to save an item to my Favorites list so
I can find it again without re-searching."
Follow the existing pattern: look at how "Add to Cart" is implemented
in src/components/ItemCard.jsx — reuse its button placement and
loading-state pattern rather than inventing a new one.
Out of scope: no Favorites page/list view yet (that's a separate
story), no sharing, no guest (logged-out) support.
Acceptance criteria (verify each one before calling this done):
1. A logged-in user can click "Save" on an item card; the button
changes to "Saved" and persists across a page refresh.
2. A logged-out user sees the button disabled with a tooltip:
"Log in to save items."
3. Write a test covering both cases in the existing test suite
pattern (see src/components/__tests__/ItemCard.test.jsx) and
run it — report the pass/fail output.
If anything here is ambiguous, ask before implementing rather than
guessing.
Same feature idea, same length of time to write. The difference is that the second version gives the AI a bounded task, an existing pattern to anchor to, an explicit non-goal, and — critically — something it can test and show you, instead of something it can only claim.
07 — Common Mistakes Beginners Make
- Writing the whole epic as one prompt. "Build the favorites feature" (list view, sharing, notifications, and all) invites scope creep and context overload in a single session.
- Acceptance criteria with no verification path. "Should feel intuitive" or "should work well" gives the AI nothing to test itself against — restate it as a behavior with a pass/fail outcome.
- Assuming silence means "AI's choice, and it'll pick sensibly." Omitted constraints don't default to minimal or conventional — they default to whatever's statistically plausible, which is often not what you'd have chosen.
- Letting one conversation drift across unrelated tasks. Fixing a bug, then asking about a totally different feature, then coming back to the bug — all in the same session — pollutes context and degrades both.
- Re-explaining instead of restarting. Correcting the same mistake three, four, five times in one thread rarely converges; a fresh session with a sharper prompt usually beats it.
- Treating "it ran without errors" as "it's done." No errors is not the same as meeting the acceptance criteria — always ask for the evidence (test output, screenshot, diff) explicitly.
Where this leads
Spec-to-prompt is the skill that makes every tool in this series usable — it's the input layer, not a one-time trick you use once and set aside. The next layer, 02 — No-Code AI App Builders, looks at the other end of the spectrum: tools where you barely write prompts at all, and the interface itself constrains what you can ask for. You'll see where that trade-off — less prompting skill required, less control over the result — actually helps a PM move faster, and where the spec discipline you just built still does the heavier lifting.