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#
#### 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.
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.
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:
| Pattern | Shape | Example |
|---|---|---|
| Event | When <trigger>, the app shall … | When a member books a class with a free spot, the app shall use one credit. |
| Unwanted | If <condition>, then the app shall … | If the class is full, then the app shall refuse the booking and offer the waitlist. |
| State | While <state>, the app shall … | While a class is cancelled, the app shall show it struck through. |
| Option | Where <feature>, the app shall … | Where a member turned reminders off, the app shall send none. |
| Ubiquitous | The 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.
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:
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#
A test that proves a criterion carries its id and runs in the story’s Pest group:
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:
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 CIThe 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.
| Switch | Effect |
|---|---|
LARAPILOT_VERIFY_COMMAND | The 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=1800 | A longer run than the 15 minutes it allows; 0 for no limit |
LARAPILOT_VERIFY_GATE=false | Turns the review gate off on this machine |
spec-review --force | Moves 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 is | Use | What it does |
|---|---|---|
| One new capability, or a shipped one that must now behave differently | /larapilot-feature | A new FR-, or the FR edited in place |
| A defect that shows a requirement was never written | /larapilot-bug | A Done means bullet under the parent FR, or an NFR row |
| Anything else — sharpen, re-scope, re-model, re-decide, upgrade | /larapilot-prd | Shows 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.
| Kind | Systems |
|---|---|
| Laravel panels and kits | Filament 4, Laravel Nova 5, the Laravel Starter Kits (React, Vue, Svelte, Livewire/Flux), shadcn/ui |
| CSS frameworks | Bootstrap 5, AdminLTE 4, Tailwind CSS 4, Material Design 3 |
| Enterprise | Fluent 2 |
| Aesthetic | Nordic SaaS (the default), Modern, Bold California, Berlin, New York, Zen |
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.




