Stories you can see and prove

A story is read by a client, a PM, a developer, and an agent. Larapilot writes it so each of them sees it before reading it — and so that “done” can be proven, not claimed.

The PRD#

Every story comes from the PRD in .larapilot/docs/PRD.md, written by /larapilot-inception (or reverse-engineered from a running app by /larapilot-adopt). It is a contract a story can be cut from, not a pitch:

  • User journeys (J-001) — one per way a persona gets value: the unit a story is cut from.
  • A domain model — entities, states, relations, and a glossary, before any feature.
  • Functional requirements (FR-004) — each with an actor, a MoSCoW priority, and Done means bullets.
  • Non-functional requirements (NFR-001) — each with a target and how it is verified.
  • Risks & assumptions — the riskiest one, the kill condition, the open questions (Q-003) with an owner.

Ids are permanent: never renumbered, never reused. A retired requirement keeps its heading with Won’t. Read it by the piece from the shell — larapilot:prd-show --ids=FR-004,J-001 — or on the dashboard, where it is searchable.

The anatomy of a story#

The anatomy of a Larapilot storyA story says who wants what and why, shows the screens as wireframes and the path of a request as a diagram, lists numbered EARS acceptance criteria with how each is proven, and keeps the open questions that hold the plan.US-006Waitlist with automatic promotionAC-1testAC-2testAC-3testAC-4manualQ-1answeredwho wants what,and whythe screens,as wireframescriteria anyonecan test (EARS)questions first:the plan waitsthe path ofa request```mermaidhow each oneis provenverify: testlarapilot:verify
.larapilot/specs/US-006 · body
#### US-006: Waitlist with automatic promotion

**Epic:** EP-002 | **Priority:** HIGH | **Points:** 5 | **Status:** TODO
**Blocked by:** US-005
**Traces to:** J-002 · FR-006 (Must)

**TL;DR**
A member joins the waitlist of a full class and is booked, and told,
the moment a spot frees up.

**Summary**
Evening classes fill in minutes and members refresh the page hoping for
a cancellation. With a waitlist they queue once; a cancelled booking goes
to the first in line, who has two hours to confirm. Paid packs and the
late-cancellation fee are not part of it.

**User Story**
As a member,
I want to join the waitlist of a full class and be moved in automatically,
so that I do not have to refresh the page hoping for a spot.

**Demonstrates**
After implementing this spec, the 18:30 class is full; Aisha joins at
position 3; two members cancel; Aisha is booked and told by email.

**Business rules**
1. **BR-1** — One waitlist per class, first in, first promoted.
2. **BR-2** — A promoted member has 2 hours to confirm, then the next one is.

**Screens**
```text
┌─ Power Vinyasa · Wed 18:30 ──────────────┐
│ Full · 20/20                             │
│ You are 3rd on the waitlist      ← AC-1  │
│ [ Leave the waitlist ]                   │
└──────────────────────────────────────────┘
```

**How it works**
```mermaid
sequenceDiagram
    actor Member
    Member->>App: cancel booking
    App->>Queue: dispatch PromoteWaitlist (AC-2)
```

**Acceptance Criteria**
- [ ] **AC-1** — When a member joins the waitlist of a full class, the app shall show their position in it. `verify: test` `traces: FR-006`
- [ ] **AC-2** — When a booking of a full class is cancelled, the app shall promote the first member of the waitlist in a queued job. `verify: test`
- [ ] **AC-5** — The promotion email shall read well on a phone, plain-text part included. `verify: manual`

**Open questions**
- [ ] **Q-1** — Does a promoted member pay a late-cancellation fee? (blocks AC-3 — Priya)

Three passes: TL;DR, summary, detail#

A story is read by a client, a PM, a developer, and an agent — so it is written in three passes. The TL;DR says it in ten seconds and leads the story’s page on the dashboard; the Summary gives the context in a minute, in plain language; then the detail: Scope (in and out), Business rules numbered BR-n and cited by the criteria, the Data it touches, the screens and the diagrams, the Edge cases, the criteria, and the Notes for the plan — what another story already brings, so nobody installs it twice. larapilot:spec-list --tldr gives an agent the whole backlog in one line a story.

A story is sized to its work. The header, the TL;DR, the summary, the user story, the scope, and the numbered criteria are always there; every other section is written only when it says something the criteria do not. A fix or a one-step back-end story is its TL;DR, its scope, and its criteria — no diagram for the sake of one — and under effort: ECO a story gets one picture at most. Detailed means precise, not long: it is what keeps a backlog of forty stories readable, and cheap to write and to read again.

Screens#

Every story with a screen gets one functional wireframe per screen in a ```text block: boxes drawn with ┌─┐│└┘, inputs as [ … ], buttons as [ Label ], links as →, and the criterion a state proves marked ← AC-n. It shows what is on the screen and what can be done there, not the look — that is the mockup’s job, and when /larapilot-design made one, the story links it instead. On the dashboard every screen of the story opens inside the story, in a frame you can switch to tablet or phone width, with Open externally for a tab of its own.

The mockup of US-006 inside the story, at tablet width, with Open externally

How it works and Architecture#

A story with more than one actor or step gets How it works: a Mermaid sequenceDiagram, flowchart, or stateDiagram-v2. A story that adds a part of the system — a queue, a third-party API, a table — gets Architecture: a flowchart LR with the new parts marked :::new. The dashboard draws both on the story, the plan, and the PRD — by hand, like the drawings of this site: rough strokes on paper, handwriting, and the yellow marker on what the story adds, whatever colours the source gives it. So the skills draw for a whiteboard, not a spec sheet: one idea per diagram, four to ten nodes, labels of a few plain words, no styling of their own; a diagram that needs a legend is two diagrams.

US-006 on the dashboard: the sequence diagram of a cancellation promoting the first member of the waitlist

Acceptance criteria are EARS requirements#

Each criterion is one observable behaviour, numbered AC-1, AC-2… in order and never renumbered once the story is planned. It follows the EARS patterns, which a client, a tester, and an agent all read the same way:

PatternShapeExample
EventWhen <trigger>, the app shall …When a member books a class with a free spot, the app shall use one credit.
UnwantedIf <condition>, then the app shall …If the class is full, then the app shall refuse the booking and offer the waitlist.
StateWhile <state>, the app shall …While a class is cancelled, the app shall show it struck through.
OptionWhere <feature>, the app shall …Where a member turned reminders off, the app shall send none.
UbiquitousThe app shall …The timetable shall answer in under 400 ms at p95.

Each one says how it is proven — verify: test (a Pest test, the default), verify: benchmark (a measured number), or verify: manual (a person looks) — and, when the PRD has ids, what it keeps: traces: FR-006. In the language of the PRD the verb follows it: il sistema deve, la app debe, l’application doit.

The numbered EARS criteria of US-006 on the dashboard, with verify and traces

Open questions hold the plan#

A question nobody can answer from the PRD, the client materials, or the code goes under Open questions — never guessed into a criterion. spec-plan refuses a story with a question still open; the answer is recorded with one command, which ticks it, writes it beside the question, and journals it as a decision:

Terminal
php artisan larapilot:spec-answer US-014 Q-1 --answer="Twilio — the studios already have accounts"

/larapilot-spec asks every open question of its batch in one round before it finishes, and /larapilot-autopilot asks all of them before it starts — then runs without stopping.

Proven, not ticked#

How a story is provenEach test names the criterion it proves and runs in the story's Pest group. larapilot:verify runs the group, or reads the JUnit report from CI, maps every test to its criterion, checks the evidence of benchmarks and manual checks, and keeps the table beside the story. spec-review waits for every criterion to be proven.it('AC-2 promotes the first member', …) ->group('US-006');a test names its criterionlarapilot:verify US-006AC-1passAC-2passAC-3passAC-4passAC-5evidenceverify.md beside the storyREVIEWopens only whenall are provenbenchmark & manual:an evidence file

A test that proves a criterion carries its id and runs in the story’s Pest group:

tests/Feature/WaitlistTest.php
it('AC-2 promotes the first member of the waitlist', function () {
    // …
})->group('US-006');

larapilot:verify runs that group, reads the JUnit report, maps every test to the criterion its name carries, and checks the evidence of each benchmark or manual criterion in .larapilot/docs/test-results/US-006/AC-n*.md. A criterion whose test runs somewhere else — the frontend repository, a browser run — is proven the same way, by an evidence file that says the command, where it ran, and its result; a test of the suite that names the criterion always has the last word:

Terminal
php artisan larapilot:verify US-006                       # runs the group
php artisan larapilot:verify US-006 --junit=build/junit.xml  # or reads the report of your CI

The table — criterion, tests, result — is kept beside the evidence (verify.json, verify.md), shown on the story in the dashboard, and read by /larapilot-review. spec-review refuses a story whose criteria are not all proven, unless testing is MINIMAL. When the criteria change after a verification, the dashboard marks the table as stale.

The Verification table of US-006: five criteria proven by four tests and one evidence file
SwitchEffect
LARAPILOT_VERIFY_COMMANDThe command that runs a story’s group — {php} vendor/bin/pest --group={group} --log-junit={junit} by default (PHPUnit when Pest is not installed); {php} is the PHP that runs Artisan, so it works on Windows and under Sail
larapilot:verify --timeout=1800A longer run than the 15 minutes it allows; 0 for no limit
LARAPILOT_VERIFY_GATE=falseTurns the review gate off on this machine
spec-review --forceMoves one story to review anyway — your call, on the record

validate-spec warns about a criterion with no id or not in EARS form, and about a story with no picture. A story written before 6.0 still passes, and is not gated.

Changing the PRD#

The PRD changes through three doors, and each one leaves a row in its revision history:

The change isUseWhat it does
One new capability, or a shipped one that must now behave differently/larapilot-featureA new FR-, or the FR edited in place
A defect that shows a requirement was never written/larapilot-bugA Done means bullet under the parent FR, or an NFR row
Anything else — sharpen, re-scope, re-model, re-decide, upgrade/larapilot-prdShows before → after, then Apply · Revise · Cancel

The backlog follows: larapilot:prd-impact --ids=FR-004 lists the stories that cite what changed and the action each needs — a TODO re-issued, a story in review sent back, a DONE one never reopened. Edited PRD.md by hand? /larapilot-prd "I edited the PRD by hand" reads the diff and adds what a hand edit skips.

Mockups and design systems#

/larapilot-design draws static HTML mockups in a design system — one of the 15 packaged, one built for the client from an interview, or the system of an adopted app as it is. They are the contract of the frontend: every UI task of a plan names the screens it mirrors, implement opens them before the first line of Blade, a deviation is asked before it is coded, and a silent one is a High review finding.

KindSystems
Laravel panels and kitsFilament 4, Laravel Nova 5, the Laravel Starter Kits (React, Vue, Svelte, Livewire/Flux), shadcn/ui
CSS frameworksBootstrap 5, AdminLTE 4, Tailwind CSS 4, Material Design 3
EnterpriseFluent 2
AestheticNordic SaaS (the default), Modern, Bold California, Berlin, New York, Zen
The Design page: every screen of the Fernway mockups as a card

Every system has the same shape: a README mapping it to real code, the components, the sources it was checked against, one tokens.css, and static screens in light and dark that render offline. Pick several and each becomes a style of the same screens; Use this style keeps one.