Lesson 1 of 5
Say what the program should do before anyone writes it
A request such as "write me something that compares the fencing quotes" leaves the decisive choices to whoever writes the code. If an agent writes it, the agent makes those choices, and they may not be the ones the garden committee would make. This lesson turns a vague request into examples of behavior that a reader can check, marks the awkward cases, and states what the program is not for. The program itself is read in the next lesson. The garden group, its committee and its suppliers continue from modules 3 to 5; the quotes, prices and supplier details in this module are a new authored scenario for the course, not figures from those modules.
Numbered links identify sources. Underlined terms offer a definition without leaving the lesson.
Where a vague request leaves the decisions
The garden group has three quotes for a 40 metre fence, one each from Northfence, Hedgerow Fencing and Parkside Fencing. The organizer asks an agent to compare them. That sentence says nothing about what "compare" should produce, so consider what a plausible program built from it would do.
It would probably read the quotes, sort them by the quoted price and print the cheapest first. Two of the committee's concerns are missing from that behavior. Hedgerow's price excludes installation, which is quoted separately, so the cheapest listed price is not the cheapest fence. Parkside quoted 38 metres because their surveyor measured differently, so their figure is not for the same job. These are decisions about the fence that the request never made, so the program would make them by default, and the organizer would discover the defaults only by noticing a wrong number in the result, if they noticed at all.
A third problem is of a different kind. Hedgerow's registered name is "Hedgerow Fencing, Ltd", with a comma. A quotes file in the common comma-separated layout writes such a name inside quotation marks, and a program that reads the file properly keeps the name whole. A program that breaks it in two is not making an undecided domain choice; it has a defect in something ordinary that any reader of that file format is expected to get right. The distinction matters when judging what an agent delivers: the first two problems are the requester's to decide, and the third is the author's to get right whether or not anyone asked. The remedy for the first kind is to make the decisions before the code exists, in a form that someone can check the code against afterwards.
Examples of behavior
The most useful form is a : a concrete input paired with the output the program should produce for it. Examples are checkable, because a reader can run the program on the input and compare. A description of intent can also be checkable when it is precise, such as "a quote for a different length is never included in the table"; what fails is vague intent, such as "compare fairly", which two people can read and expect different results from.
Here is the organizer's set, authored for the lesson. The input is a table of quotes, one row per supplier, with the columns supplier, length in metres, price, whether installation is included, the separate installation price, delivery in weeks and guarantee in years. The requested length is 40.
supplier length_m price installation_included installation_price delivery_weeks guarantee_years
Northfence Ltd 40 2150 yes 3 5
Hedgerow Fencing, Ltd 40 1980 no 300 6 2
Parkside Fencing 38 1900 yes 4 3
Expected output for length 40:
Northfence Ltd installed 2150 3 weeks 5 years
Hedgerow Fencing, Ltd installed 2280 6 weeks 2 years
Parkside Fencing is reported as not compared: quotes 38 m, brief says 40 m
Three decisions are now visible on the page. The comparison uses the installed price, which is the quoted price plus the installation price when installation is not included. A quote for a different length is reported, not silently compared and not silently dropped. And the supplier's full name, comma included, appears in the output. Each of these is something a program can be checked against.
A small published example shows the same shape at even smaller scale. Harvard's introductory Python course sets a first problem that asks for a program which prompts for input and prints that input in lowercase, with punctuation and whitespace unchanged, and it supplies the checks in the same breath: "HELLO" becomes "hello" and "50" stays "50" (CS50P Problem Set 0, checked 2026-09-29). A few input and output pairs carry the whole specification. It is short because it is precise, not in spite of it.
Edge cases, the input contract and non-goals
The main examples show what happens when the input is as expected. An is an input at the boundary of what the program should handle, where the intended behavior is easy to get wrong or to leave undecided. The organizer's file has several, and each needs its own expected output.
A price written as "2,150" with a thousands separator is not a number the program should guess at; it is reported by row and not compared. A row where installation is not included but the installation price is blank is likewise reported, because the installed price cannot be computed for it. A row whose installation column says "included" rather than yes or no is reported, not interpreted. A row with a different length is reported, as above. When some rows fail, the rows that can be compared are still compared and printed, and the program signals that the result is partial. This last decision matters more than it looks: a table that silently omits a supplier reads as complete, and module 5's contract lesson made the same point about a lookup that skipped malformed rows.
Writing these down amounts to an : the statement of what input the program accepts and what it does with input outside that. For the comparison it reads: the file's first line names exactly the seven columns above, in that order; installation_included is yes or no, ignoring letter case and surrounding spaces; price and installation_price are non-negative amounts in pounds written as plain numbers; installation_price is ignored when installation is included and must be present and valid when it is not; length_m is a plain finite decimal number; delivery_weeks and guarantee_years are whole numbers; a row with too many or too few values, or any value outside these rules, is reported by row and left out of the table. A file with a different header, or an empty file, is refused with a message rather than compared. Anything the contract does not mention, such as a supplier name written across two lines, is behavior the program has not been asked to have; lesson 2 records what it does in one such case.
A is something the program is deliberately not asked to do, stated so that nobody adds it by accident. The comparison does not judge which fence is better value; it presents the numbers and leaves the judgment to the committee. It does not fetch quotes from anywhere; the organizer types them into the file. It does not send anything to anyone. Each non-goal states behavior the agent should leave out. The delivered code and its available access still need inspection: writing “sends nothing” in a specification does not enforce it. A program confirmed to send nothing needs no email credentials.
Together the examples, edge cases, input contract and non-goals form the : the statement of what the program should do, written so that a check can be derived from every line. A longer document is not automatically a better one. Forty lines describing why the committee wants a fence and how suppliers should be treated fairly can still leave the installation question undecided, while the three-row example above settles it. Some projects fix the order of this work in a written procedure; one published example, the feature-spec skill from a DeepLearning.AI course on spec-driven development, has the agent ask a fixed set of scoped questions before it writes requirements, a plan and a validation document, and forbids adding a dependency without the user's approval (course files, SKILL.md, checked 2026-09-29). That is one course's arrangement rather than a standard. Thariq Shihipar's field guide to working with Claude Fable makes a similar recommendation from the practitioner's side, an interview and brainstorm before implementation, on the grounds that reducing and planning for unknowns is the core skill of agentic coding (field guide, July 2026; summarized on Intel); it is one practitioner's report about one model family. The transferable part of both is the order: questions and behavior first, code afterwards.
Carry this forward
- A vague request does not remove decisions; it hands them to whoever writes the code, and an agent will make them by default.
- Undecided domain choices, such as whether installation is added, are the requester's to settle; ordinary format handling, such as keeping a quoted name whole, is the author's to get right, and getting it wrong is a defect.
- A behavior example pairs a concrete input with the output the program should produce; precise intent can be checked too, vague intent cannot.
- Edge cases and the input contract say what the program accepts and what it does with everything else, including how it signals a partial result.
- Non-goals state what the program will not do so that nobody adds it by accident; each one also removes a class of risk.
Lesson check
Choose an answer for each question.
This is a practice check. Answers reset when you leave this page. Results are not saved and do not place you in another module or award a qualification.
With the behavior written down, the next lesson reads the program that an agent produced for it, following the data from the file to the printed table rather than starting from the names of the parts.
Sources · Reviewed 2026-09-29
- 1. Harvard CS50's Introduction to Programming with Python: Problem Set 0, Indoor Voice
- 2. DeepLearning.AI, Spec-Driven Development course files: feature-spec skill (SKILL.md)
- 5. Thariq Shihipar (claude.com): A field guide to Claude Fable: finding your unknowns (July 2026)
- 6. VibeLeaderboard Intel: A field guide to Claude Fable: finding your unknowns
Sources support nearby explanations. Product details can change. Scenarios and model results are authored illustrations unless a lesson explicitly identifies a recorded execution. Module 7 identifies its offline code checks.