jonnifyagile agents
jonnify / Agile Agent Workflow / A4 · Spec / A4.3 / A4.3.1 · The six sections

A4.3 · Anatomy of a spec · dive 1

The six sections

A spec is six named sections in a fixed order — and reading them on a real one turns the order into a template for any rung.

Goal sets the destination, Rationale gives the five Ws, Scope draws the boundary, Deliverables list the artifacts, Invariants name what must always hold, and the Definition of Done closes it as a checklist. Pick a section on the right to read its question and a verbatim phrase, drawn from the spec settled at .

Pick a section · read it on f6.1.md

1 · Goal 2 · Rationale (5W) 3 · Scope (In / Out) 4 · Deliverables 5 · Invariants 6 · Definition of Done
Goal · question: where does this rung land? · verbatim: "After F6.1, the Portal runs as a Phoenix app".

The six, named

A spec is not free prose. The Portal's real rung spec f6.1.md carries six named sections, each a heading, each answering a different question. Read in order, they are the whole anatomy: the Goal states where the rung lands; the Rationale gives the reason in five Ws; the Scope draws an In/Out boundary; the Deliverables list concrete artifacts; the Invariants name what must always hold; and the Definition of Done closes the spec as a checklist.

The hero figure walks the six. Below, each is named with a verbatim phrase from the file — nothing is paraphrased, because a spec's exact words are its contract.

Goal
Where the rung lands, in prose, verbatim: “After F6.1, the Portal runs as a Phoenix app. A browser request travels through the endpoint's plug stack…”.
Rationale
The five Ws — Why “F5 produced a correct engine but no way for a human to reach it over HTTP”; and What, Who, When, Where (the A4.3.2 dive).
Scope
The boundary. In: “the endpoint and its plug stack; the one supervision-tree change; a :browser pipeline…”. Out: “Ecto persistence (→ F6.3) … LiveView (→ F6.6)”.
Deliverables
F6.1-D1…D7. D6: “a liveness route get "/health", … returning 200 (a plain "ok")”. D4: the controller calling only Portal.courses_of/1.
Invariants
F6.1-INV1 (master): “PortalWeb calls only the Portal facade and renders only the closed %Portal.Error{} set”. INV4: an expected failure renders as a status from the closed set, never a 500.
Definition of Done
A checkbox list, closing verbatim: “Every deliverable maps to a user story and every invariant is exercised by a check”.

Portal.courses_of/1 returns the courses a user is enrolled in — the one facade call this rung's controller makes. The spec names the call; it shows none of its code.

The order is the template

The six sections sit in a fixed order, and the order is not decorative. Each section assumes the one above it: the Rationale explains the Goal; the Scope bounds what the Rationale promised; the Deliverables realize what is in Scope; the Invariants constrain the Deliverables; and the Definition of Done closes over all of them. Read top to bottom, a spec moves from where to why to how far to what to what must hold to how we know.

Step the order below. The figure names each position and the role it plays — the move this dive teaches is the sequence, distinct from the hero, which reads a single section's words. A spec written to this order is filling in six known questions, never a blank page.

Step the order · each section assumes the one above

1 2 3 4 5 6 each section assumes the one above · where → why → how far → what → what holds → how we know
Position 1 · Goal — states where the rung lands, the destination every later section is measured against.

Six sections, one fixed order — where, why, how far, what, what holds, how we know — and each section assumes the one above it.

The six sections on the Portal

On the Portal — the learning platform this course builds — the real artifact is f6.1.md, the spec for the first rung of the web chapter: stand the headless engine up as a Phoenix app. Its six headings are the anatomy, byte for byte. The Goal names the destination; the Rationale gives the five Ws; the Scope's Out defers Ecto and LiveView to later rungs; the Deliverables list seven artifacts including the /health liveness route; the Invariants name the master rule; the Definition of Done closes on traceability.

The fragment below is the six headings in order — the document's skeleton, with each heading's question in a comment. It is markdown, not code: a spec's body is prose and lists, and the dives read those words. The skeleton is the part you reuse to write a spec of your own.

# f6.1.md — the six sections, in order (headings verbatim; questions in comment).

## Goal             — where does this rung land?
"After F6.1, the Portal runs as a Phoenix app."

## Rationale (5W)   — why, what, who, when, where?
"F5 produced a correct engine but no way for a human to reach it over HTTP."

## Scope            — what is in, and what is deferred?
"Out: ... Ecto persistence (→ F6.3) ... LiveView (→ F6.6)."

## Deliverables     — which concrete artifacts ship?
"F6.1-D6 — a liveness route get \"/health\", ... returning 200 (a plain \"ok\")."

## Invariants       — what must always hold?
"PortalWeb calls only the Portal facade and renders only %Portal.Error{}."

## Definition of Done — how do we know it is done?
"Every deliverable maps to a user story and every invariant is exercised by a check."
the principle

A spec is six named sections in a fixed order — Goal, Rationale, Scope, Deliverables, Invariants, Definition of Done — each answering one question the one above it sets up.

on the Portal

f6.1.md carries all six headings, byte for byte. Read in order they are a template — write a spec of your own by filling in the same six questions.

The six sections, read in order on a real spec, stop being a blank page and become a template for any rung.

Recap — six headings, one order

A spec carries six named sections: Goal, Rationale, Scope, Deliverables, Invariants, and Definition of Done. They sit in a fixed order, each assuming the one above it — where, why, how far, what, what holds, how we know. Read on the Portal's real f6.1.md, the order is a template you fill in to write any rung. With the headings in hand, the next dive reads the section that carries the reason: the Rationale's five Ws.

Next in A4.3: A4.3.2 · The five Ws — the Rationale answers why, what, who, when, and where, fixing a rung's intent before its definition.

References

The specification sources behind the anatomy, and where the six sections connect in the course.

Sources

Related in this course