Skip to content
zeeshare.com

writing / FDE and agents

Spec-driven development, for real

Spec-driven development, for realPart 5

Definitions and open questions

On this page
  1. Tuesday, 9:05
  2. Definitions: one word, one function
  3. Open questions: answered by someone else
  4. When to use which
  5. In the kit
  6. Three rules of thumb

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.

Definitions Open questions One function Screens and reports Claude

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

Each place works it out desk: 2 days late invoice: 1 day report: 3 days three answers One function, one field terms.days_overdue API field every screen reads it one answer The time zone, the rounding and the edge cases live in exactly one function.
Two places computing the same word will disagree within a month. One place cannot.

The head of operations already said what late means. Maya writes it down where Claude will find it:

docs/definitions/late-return.md
# 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.
The owner’s words verbatim, then one row per term, each naming the single function that answers it.

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. 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. 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. 3 · Record it

    OQ-07 in docs/questions/, a row in the table, the owner named by role.

  4. 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. 5 · Log the gap

    Every skipped posting is logged with the question’s ID, so the gap is visible, never silent.

  6. 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:

src/billing/accounts.py
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
The question is restated in full where it bites, the safe behaviour is explicit, and the gap shows up in the logs.

And here is everywhere that one question is written down, so no session can miss it:

questions/READMEthe table ownerfinance code commentaccounts.py billing/CLAUDE.md"do not guess" settingaccounts.late_fee log lineskipped: OQ-07 OQ-07which ledger account?
One question, six places, all saying the same thing: this is open on purpose, and here is what happens meanwhile.
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.md names 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-hunter reviewer (Part 9) looks for fallbacks that are not logged.
  • The kit’s open-question skill walks Claude through all six steps.

When to use which

Write a definition when
  • 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.
Open a question when
  • 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

Three rules of thumb

Their words, verbatim

Quote the owner. A paraphrase is where meanings drift.

One term, one function

No screen, report or export computes a defined term itself. It reads the field.

Open on purpose

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.

See services
Next in this seriesSpec-driven development, for realFeature specs and plans4 min read