SESSION 4 · ~55M

Spec-first prompting

A supply-chain problem becomes buildable the moment you write its spec — inputs, outputs, constraints, edge cases — before the first prompt.

Vibe coding fails at the spec, not the code. The model can generate code freely; what it can't do is read your mind. Writing the spec first — what goes in, what comes out, what's constrained, what can go wrong — is the single highest-leverage habit in this whole course.

The four-part spec

  • Inputs — exactly what the user provides (a CSV of demand, a service level, a lead time), with types and units.
  • Outputs — exactly what the tool returns (a safety-stock number, a chart, a table), with formats.
  • Constraints — the rules it must respect (no negative stock, service level 90–99%, lead time greater than zero).
  • Edge cases — what it must handle gracefully (empty input, missing columns, demand of zero, extreme values).

Translate supply-chain intuition into this structure deliberately. You already know a safety-stock calculator needs demand variability and lead time; the spec makes that knowledge explicit and unambiguous so the model can act on it.

Fixing a spec defect in the prompt costs minutes; fixing the same defect after the code is built and deployed costs hours. The NASA 100× finding maps directly onto vibe coding — front-load the thinking, or pay it back with interest.

Done-criteria belong in the spec too. Before building, write the test for 'this is finished': given this input, the output equals this expected value. If you can't state the done-criteria, you don't yet understand the problem — and neither will the model.

TRY IT

Pick a small supply-chain annoyance you'd like a tool for. Write the four-part spec (inputs, outputs, constraints, edge cases) and one done-criterion. Do not prompt the model yet — the spec is the deliverable for this exercise.

CHECK YOUR UNDERSTANDING

What are the four parts of a spec for vibe coding?

What NASA finding does the module apply to vibe coding?

Why does the module say done-criteria belong in the spec before building?

NOTEBOOKLM

Connect your notebook

Paste a NotebookLM share link to embed your notebook for this module.

Answer the 3 questions above to unlock
Streak
0-day streak
Today's fact
Progress
25% to next milestone