A5.4.2 · dive 2/3
The first two stories
Walk the first two stories end to end before any agent runs — to confirm the path from a user story to a verified change is short, and leaves no decision the spec has not already fixed.
A directive plus a gate makes one agent story closeable. The brief's
## Execution plan — first two stories walks the first one or two stories all
the way through: story → agent story → tasks → files → command → gate. An
agent runs the steps top to bottom and stops at the gate. Step the chain on the right to follow Plan A from
a user story to its closing check.
Plan A · step the chain from a user story to its gate
The execution plan
A5.4.1 made one agent story closeable: a Directive the agent runs and an Acceptance gate that closes it. The next question is whether the whole path — from a user story, through its agent story, to a verified change — is short enough that the agent has nothing left to decide. The brief answers it on paper, with a worked trace, before any agent runs.
The Portal's web bootstrap brief, f6.1.llms.md, ends its agent stories with a
section titled ## Execution plan — first two stories. Its own words:
“a worked trace of how the framework turns a user story into a verified change, to confirm the
path is short and leaves no decision to the agent that the spec has not already fixed. Each plan is
story → agent story → tasks → files → command → gate; an agent runs the steps
top to bottom and stops at the gate.” Two plans are walked — one per story.
# f6.1.llms.md — ## Execution plan — first two stories # # Plan A — F6.1-US1 (serve the Portal as a Phoenix app) · via F6.1-AS1 tasks → T1 → T2 → T3 (foundation → endpoint → supervision) files → the new apps/portal_web foundation/endpoint/supervision files (+ two core touches) command → mix deps.get && mix compile && mix phx.server, then curl -i localhost:4000/health gate → 200 ok from /health; the :portal tree boots store → engine before :portal_web (telemetry → endpoint) # # Plan B — F6.1-US2 (see a user's courses) · via F6.1-AS2 tasks → T4 → T5 → T6 (browser pipeline + route → controller → view) files → router, controller, view, index.html.heex, error.html.heex command → mix test …course_controller_test.exs, then curl localhost:4000/courses/USR_known gate → a known user renders; empty state for none/unknown (200); injected %Portal.Error{} → 422
The principle
Walk the first one or two stories end to end before the agent runs — story → agent story → tasks → files → command → gate — to confirm the path is short and fixes no decision the spec has not.
On the Portal
f6.1.llms.md's Plan A maps F6.1-US1 to
F6.1-AS1, T1–T3, its files, one command, and one
gate; Plan B does the same for F6.1-US2 via F6.1-AS2.
The task order the plans run in — T1→T7 — was fixed in
A5.3's task DAG; each plan walks a contiguous run of it (T1–T3, then
T4–T6).
Files behind one gate
The plan's payoff is in its closing line. The brief ends the section with an efficiency check: “each story is two-to-six files behind one command and one gate, and every branch (empty state, injected-error render) is already specified — so the agent implements rather than decides.” That is the whole point of walking the plan: not the steps, but their shortness. A story whose path is a handful of files behind a single command and a single gate is a story the agent can implement; a story whose path sprawls is one it must navigate, and navigating means deciding.
Toggle the meter below between Plan A and Plan B. Each shows the files it touches and confirms one command and one gate stand behind them. Both plans land inside the two-to-six band.
How many files stand behind one command and one gate · toggle the plan
If the first two stories run short and gated on paper, the rest will run short and gated in practice.
On the Portal
Plan A and Plan B are not summaries; they are the literal steps an agent runs. Plan A builds the
application as a Phoenix app: tasks T1→T3, the new
apps/portal_web foundation and endpoint plus the two core edits that drop Bandit,
one command (mix compile && mix phx.server, then a
curl of /health), and one gate —
200 ok from /health with the
:portal tree booting store → engine before the endpoint. Plan B renders a
user's courses: tasks T4→T6, the router, controller, view, and two
.heex templates, one command (the controller test plus a
curl of /courses/USR_known), and one gate — a known
user renders, an unknown or empty id renders the empty state at 200, and an
injected %Portal.Error{} renders 422.
The path each plan walks is short because every branch it would otherwise have to invent — the empty state, the injected-error render — is already specified upstream. That is why the brief closes on its efficiency check, and why this dive sits before the prompt that runs the plans. The companion course walks the same path the running system takes for a request: the Phoenix request path the ordered build assembles.
The principle
A worked first-two-stories trace is a confidence check: it proves the path from a user story to a verified change is a handful of files behind one command and one gate, with no branch left for the agent to invent.
On the Portal
f6.1.llms.md's Plan A (T1–T3) and Plan B
(T4–T6) each run two-to-six files behind one command and one gate; the
efficiency check confirms the agent implements rather than decides.
A short, fully specified path is what lets the agent build the plan instead of inventing one.
Recap — the path is short, on paper first
A first-two-stories execution plan walks the opening stories from a user story through its agent story, the
tasks, the exact files, one command, and one gate — before any agent runs. Plan A serves the Portal as
a Phoenix app over T1→T3; Plan B renders a user's courses over
T4→T6. Each is two-to-six files behind a single command and a single gate, and
every branch is already specified, so the agent implements rather than decides. The next dive turns to the
gate itself: the runnable check that closes a story, and what it means when one is missing.
Next in A5.4: Acceptance gates — the check that closes a story; a story with no gate can never close, and is flagged.
References
Primary sources for turning a user story into a short, gated path, and where the stories this plan walks and the request path it assembles are defined in the companion course.
Sources
- Cohn, M. — User Stories Applied — the user story whose executable counterpart each plan walks to a verified change.
- Wake, B. — INVEST in Good Stories, and SMART Tasks — a small, testable story is one whose path to done is short and gated, which the plan confirms.
- Hunt, A. & Thomas, D. — The Pragmatic Programmer — tracer bullets: walk a thin path end to end first to prove it is short before building it out.
Related in this course
- A5.4 · Agent stories — the module hub.
- A5.4.1 · Directive and gate — one agent story made closeable.
- A5.3.2 · The task DAG — the
T1→T7order the plans run in. - A4 · The spec layer — the spec the plan fixes no decision beyond.
- Companion · The request lifecycle (F6) — the chapter whose
f6.1.llms.mdthis dive grounds on.