Spec-driven development, for real
Spec-driven development, for realPart 5
Definitions and open questions
On this page
New to the short codes like REQ, ADR or AC? See the vocabulary in Part 1, or hover over any code.
In short: A definition writes a business word down once, in its owner’s words, and names the one function that computes it; every screen and report reads that field instead of working it out again. An open question (OQ-##) is something only finance, legal or a manager can answer. It stays open on purpose: restated where the code depends on it, built so the answer becomes a setting, with every fallback logged. Claude is told plainly never to answer one.
Part 4 recorded the decisions engineering can make. This part covers block 4: the words nobody may redefine, and the answers nobody here may give. The team and product are invented.
Tuesday, 9:05
Two small words are about to cause trouble. The first is late. Late by whose clock? The rental company’s, or the server’s? Is 59 seconds over one hour of fee, or none? The second is a question Claude asks while planning: which ledger account should late fees post to?
Claude offers an answer to both. For the first, it suggests UTC and rounding to the nearest hour. For the second, it suggests a standard revenue account. Both sound reasonable. Both are wrong, and only one of them would show up in a test.
Think of it like this: A good form has a box marked “office use only”. You do not fill it in, however obvious the answer seems. And a shared dictionary means two people saying “late” mean exactly the same thing.
Definitions: one word, one function
The head of operations already said what late means. Maya writes it down where Claude will find it:
# Late return: the definition - Owner: head of operations Signed off by: product lead - Date: 2026-03-04 Cites: REQ-041, DEC-018 - Status: decided and built ## In the owner's words > Late means back after the due time on the contract, in the > rental company's own time. Charge per started hour, never > more than a day. ## The definition | Term | Means | The one function | | Overdue | returned after due_at, company time zone | terms.is_overdue | | Hours overdue | started hours after due_at | terms.hours_overdue | | Late fee | hours x hourly rate, capped at day rate | terms.late_fee_minor | ## Choices we had to make - A 59-second delay counts as one started hour. The words say "started"; changing it is one line in terms.hours_overdue.
Rule: no screen, report or export computes a defined term itself. It reads the field the one function produces. When the owner changes their mind, one function changes, and everything agrees again.
Open questions: answered by someone else
The ledger account is not engineering’s decision. It belongs to finance, and finance has not decided. A plausible wrong account would book real money to the wrong place, and nobody would notice for a month.
- 1 · The question comes up
Claude asks which account late fees post to. Nobody in the session knows, and it is not engineering’s call.
- 2 · Do not guess
Not from the chart of accounts, not from what looks standard. A plausible wrong account books real money to the wrong place.
- 3 · Record it
OQ-07indocs/questions/, a row in the table, the owner named by role. - 4 · Build so the answer is a setting
Everything else ships. Unset, the fee is charged and shown but not posted. Set, posting starts with no deploy.
- 5 · Log the gap
Every skipped posting is logged with the question’s ID, so the gap is visible, never silent.
- 6 · When the answer comes
The words go into a
DEC-###, the setting is filled, the row is removed, the comment updated. Not done until all four.
Here are steps 4 and 5 in code:
def late_fee_account(company) -> str | None:
"""OQ-07: which ledger account late fees post to is finance's
decision, not ours. Unset: the fee is charged and shown, but not
posted, and the skip is logged. Do not pick a default."""
account = company.settings.get("accounts.late_fee")
if account is None:
log.warning("late fee not posted: OQ-07 unanswered",
extra={"company": company.id, "question": "OQ-07"})
return account
And here is everywhere that one question is written down, so no session can miss it:
Under the hood: why restate it everywhere
- The repository must be enough on its own. In the real setup this came from, the master list of questions lived in a workspace outside any repository. A clone from GitHub did not have it. So every question that bites is restated in full inside the repo, with its ID, where the code depends on it.
- The module’s
CLAUDE.mdnames it (Part 3), so Claude reads “do not guess” before it opens the file. - Prefer a setting over a release. Unset means the old, safe behaviour; set means the ruling takes effect without a deploy. A per-company switch works the same way.
- A logged fallback turns a silent divergence into a line someone can search for. The
silent-failure-hunterreviewer (Part 9) looks for fallbacks that are not logged. - The kit’s
open-questionskill walks Claude through all six steps.
When to use which
- A word is shown on more than one screen or report.
- People outside engineering use it: "overdue", "active", "in stock".
- Two people have already computed it differently.
- The answer belongs to finance, legal, the client or a manager.
- A wrong but plausible answer would do real damage.
- Claude, or you, are tempted to "just pick the standard one".
- A business word shows on several screens: A definitionOwner’s words, one row per term, one function each. Every screen reads that field.
- Nobody here can answer it: An open questionOQ-##, restated in the code, built as a setting, fallback logged.
- The owner answered: Close it properlyA DEC with their words, the setting filled, the row removed, the comment updated.
- The definition leaves a gap: Record the choiceUnder "Choices we had to make", naming the line that changes if the owner disagrees.
In the kit
docs/definitions/_TEMPLATE.mdand its README.docs/questions/README.mdwith the five rules, and the question template.
Three rules of thumb
Quote the owner. A paraphrase is where meanings drift.
No screen, report or export computes a defined term itself. It reads the field.
An unanswered question is a ruling, not a gap. Build around it; never answer it for them.
QuizFinance has not said which account late fees post to. The release is tomorrow. What ships?
Show the answer
Answer: The feature, with posting off until the setting is filled, and every skip logged with OQ-07
Everything that does not depend on the answer can ship. The part that does waits safely, visibly, and starts working the moment finance fills in one setting.
Words in this post:
- Definition: a business word written once, in its owner’s words, with one function that computes it.
- Open question (OQ): something only someone outside engineering can answer.
- Fallback: what the code does while an answer is missing. Always logged.
- Setting: a value that changes behaviour without a deploy.
- Restate: write the question in full where the code depends on it.
Next, Part 6: Feature specs and plans puts it all into one spec with numbered acceptance criteria, then a plan whose every task points back.
Setting up Claude Code or AI agents for your team?
I help teams build this: agents, RAG search and Claude Code setups that hold up in production.
Series
Spec-driven development, for real
- Spec-driven development, for realThe building blocks
- Spec-driven development, for realThe paper trail
- Spec-driven development, for realPrinciples and scoped rules
- Spec-driven development, for realDecision records
- Spec-driven development, for realDefinitions and open questionsyou are here
- Spec-driven development, for realFeature specs and plans
- Spec-driven development, for realThe contract
- Spec-driven development, for realGates that make Claude show its work
- Spec-driven development, for realSkills and reviewers
- Spec-driven development, for realGuardrail hooks
- Spec-driven development, for realProof of done
- Spec-driven development, for realMemory and handoffs
- Spec-driven development, for realOne ticket, end to end