Skip to content

Commit 363746a

Browse files
raifdmuellerclaude
andcommitted
feat: integrate Cockburn Use Cases into spec-driven workflow
Step 4 now starts with an Actor-Goal List discovery prompt before writing full use cases. Use case template updated to Cockburn's Fully Dressed format (Primary Actor, Stakeholders & Interests, Trigger, Preconditions, Main Success Scenario, Extensions with step references, Success/Minimal Guarantee, Business Rules). Activity Diagrams and Gherkin explicitly framed as complementary representations layered on top of Cockburn's prose-based format — not part of Cockburn, but retained from our contract. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b19d8d9 commit 363746a

2 files changed

Lines changed: 64 additions & 22 deletions

File tree

docs/spec-driven-workflow.adoc

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -205,36 +205,57 @@ Write a PRD based on our discussion. Save it as src/docs/specs/prd.adoc.
205205

206206
=== Step 4: Create Detailed Specification
207207

208-
From the PRD, generate a full specification:
208+
Start by discovering scope with an ⚓ link:#/anchor/cockburn-use-cases[*Actor-Goal List*]:
209209

210210
[source]
211211
----
212-
Create a detailed specification from the PRD. Include:
213-
- Use Cases (Trigger, Main Flow, Alternative Flows, Postconditions, Business Rules)
214-
- Activity Diagrams for all flows (not just the happy path)
215-
- Acceptance criteria in Gherkin format
212+
Create an Actor-Goal List from the PRD.
213+
For each actor, list every goal they have against the system.
214+
Apply the Goal Level test: "Does the actor go home happy if this goal
215+
is achieved?" — if yes, it's a User Goal. If not, it's a Subfunction
216+
(extract only when reused). Save as src/docs/specs/actor-goal-list.adoc.
217+
----
218+
219+
Then generate the full specification from the Actor-Goal List:
220+
221+
[source]
222+
----
223+
Create a detailed specification from the PRD and Actor-Goal List.
224+
For each User Goal, write a Use Case in Cockburn's Fully Dressed format:
225+
- Primary Actor and Stakeholders & Interests
226+
- Trigger, Preconditions
227+
- Main Success Scenario (numbered steps)
228+
- Extensions (alternative/failure paths, referencing step numbers)
229+
- Postconditions (Success Guarantee and Minimal Guarantee)
230+
- Business Rules (BR-001, BR-002, ...)
231+
Then add for each Use Case:
232+
- Activity Diagram covering all flows (not just the happy path)
233+
- Acceptance criteria in Gherkin format (Given/When/Then)
216234
Save as .adoc files in src/docs/specs/.
217235
----
218236

219-
Each Use Case must define four elements:
237+
Each Use Case in ⚓ link:#/anchor/cockburn-use-cases[*Cockburn's Fully Dressed format*] defines:
220238

239+
* *Primary Actor*: Who initiates the use case and has the goal.
240+
* *Stakeholders & Interests*: Who else cares about the outcome and what they need from it.
221241
* *Trigger*: The specific event that starts the use case ("User clicks Submit", "System receives webhook").
222242
Without a trigger, neither the AI nor a tester knows when the use case begins.
223-
* *Main Flow*: The numbered steps of the happy path, each describing observable system behavior.
224-
* *Alternative Flows*: Named branches (A1, A2, ...) for error handling, validation failures, and edge cases.
225-
* *Postconditions*: The guaranteed system state after successful completion.
243+
* *Main Success Scenario*: The numbered steps of the happy path, each describing observable system behavior.
244+
* *Extensions*: Named branches (3a, 4b, ...) for error handling, validation failures, and edge cases — referencing the step they branch from.
245+
* *Postconditions*: The guaranteed system state after successful completion (Success Guarantee) and the minimum guarantee even when the use case fails (Minimal Guarantee).
226246
Postconditions are what your tests assert.
227247
* *Business Rules*: Numbered rules (BR-001, BR-002, ...) that capture validation constraints, calculation logic, or domain invariants.
228248
Business rules make implicit knowledge explicit.
229249
Without them, the AI invents its own validation logic -- or skips it entirely.
230250

231-
This structure follows Alistair Cockburn's Use Case format, which LLMs recognize reliably.
232251
The more precise the use case, the less the AI has to guess during implementation.
252+
Cockburn's format is deliberately prose-based — it does not prescribe any specific notation.
253+
Activity Diagrams and Gherkin are complementary representations we layer on top:
233254

234255
⚓ link:#/anchor/gherkin[*Gherkin*] (Given/When/Then) provides acceptance criteria that are both human-readable and machine-testable.
235256
These criteria become the foundation for TDD later.
236257

237-
Activity Diagrams are an important part of the specification because they define flows, error paths, and edge cases in a way the AI can follow during implementation.
258+
Activity Diagrams define flows, error paths, and edge cases visually — the AI can follow them during implementation to cover all branches, not just the happy path.
238259

239260
== Phase 2: Architecture
240261

docs/spec-driven-workflow.de.adoc

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -215,36 +215,57 @@ Write a PRD based on our discussion. Save it as src/docs/specs/prd.adoc.
215215

216216
=== Schritt 4: Detaillierte Spezifikation erstellen
217217

218-
Aus dem PRD eine vollständige Spezifikation generieren:
218+
Zuerst den Scope mit einer ⚓ link:#/anchor/cockburn-use-cases[*Actor-Goal-Liste*] entdecken:
219219

220220
[source]
221221
----
222-
Create a detailed specification from the PRD. Include:
223-
- Use Cases (Trigger, Main Flow, Alternative Flows, Postconditions, Business Rules)
224-
- Activity Diagrams for all flows (not just the happy path)
225-
- Acceptance criteria in Gherkin format
222+
Create an Actor-Goal List from the PRD.
223+
For each actor, list every goal they have against the system.
224+
Apply the Goal Level test: "Does the actor go home happy if this goal
225+
is achieved?" — if yes, it's a User Goal. If not, it's a Subfunction
226+
(extract only when reused). Save as src/docs/specs/actor-goal-list.adoc.
227+
----
228+
229+
Dann aus der Actor-Goal-Liste die vollständige Spezifikation generieren:
230+
231+
[source]
232+
----
233+
Create a detailed specification from the PRD and Actor-Goal List.
234+
For each User Goal, write a Use Case in Cockburn's Fully Dressed format:
235+
- Primary Actor and Stakeholders & Interests
236+
- Trigger, Preconditions
237+
- Main Success Scenario (numbered steps)
238+
- Extensions (alternative/failure paths, referencing step numbers)
239+
- Postconditions (Success Guarantee and Minimal Guarantee)
240+
- Business Rules (BR-001, BR-002, ...)
241+
Then add for each Use Case:
242+
- Activity Diagram covering all flows (not just the happy path)
243+
- Acceptance criteria in Gherkin format (Given/When/Then)
226244
Save as .adoc files in src/docs/specs/.
227245
----
228246

229-
Jeder Use Case muss fünf Elemente definieren:
247+
Jeder Use Case in ⚓ link:#/anchor/cockburn-use-cases[*Cockburns Fully Dressed Format*] definiert:
230248

249+
* *Primary Actor*: Wer den Use Case initiiert und das Ziel hat.
250+
* *Stakeholders & Interests*: Wer noch am Ergebnis beteiligt ist und was sie davon brauchen.
231251
* *Trigger*: Das spezifische Ereignis, das den Use Case auslöst ("Benutzer klickt auf Absenden", "System empfängt Webhook").
232252
Ohne Trigger weiß weder die KI noch ein Tester, wann der Use Case beginnt.
233-
* *Hauptablauf (Main Flow)*: Die nummerierten Schritte des Happy Path, jeder beschreibt beobachtbares Systemverhalten.
234-
* *Alternativabläufe (Alternative Flows)*: Benannte Verzweigungen (A1, A2, ...) für Fehlerbehandlung, Validierungsfehler und Randfälle.
235-
* *Nachbedingungen (Postconditions)*: Der garantierte Systemzustand nach erfolgreicher Ausführung.
253+
* *Main Success Scenario*: Die nummerierten Schritte des Happy Path, jeder beschreibt beobachtbares Systemverhalten.
254+
* *Extensions*: Benannte Verzweigungen (3a, 4b, ...) für Fehlerbehandlung, Validierungsfehler und Randfälle — mit Verweis auf den Schritt, von dem sie abzweigen.
255+
* *Nachbedingungen (Postconditions)*: Der garantierte Systemzustand nach erfolgreicher Ausführung (Success Guarantee) und die minimale Garantie auch bei Fehlschlag (Minimal Guarantee).
236256
Nachbedingungen sind das, was die Tests prüfen.
237257
* *Geschäftsregeln (Business Rules)*: Nummerierte Regeln (BR-001, BR-002, ...) für Validierungslogik, Berechnungen oder Domäneninvarianten.
238258
Geschäftsregeln machen implizites Wissen explizit.
239259
Ohne sie erfindet die KI eigene Validierungslogik -- oder lässt sie komplett weg.
240260

241-
Diese Struktur folgt dem Use-Case-Format von Alistair Cockburn, das LLMs zuverlässig erkennen.
242261
Je präziser der Use Case, desto weniger muss die KI bei der Implementierung raten.
262+
Cockburns Format ist bewusst prosabasiert — es schreibt keine bestimmte Notation vor.
263+
Activity-Diagramme und Gherkin sind komplementäre Darstellungsformen, die wir darauf aufsetzen:
243264

244265
⚓ link:#/anchor/gherkin[*Gherkin*] (Given/When/Then) liefert Akzeptanzkriterien, die sowohl für Menschen lesbar als auch maschinell testbar sind.
245266
Diese Kriterien werden später die Grundlage für TDD.
246267

247-
Activity Diagrams sind ein wichtiger Teil der Spezifikation, weil sie Abläufe, Fehlerpfade und Randfälle so definieren, dass die KI ihnen bei der Implementierung folgen kann.
268+
Activity Diagrams definieren Abläufe, Fehlerpfade und Randfälle visuell — die KI kann ihnen bei der Implementierung folgen, um alle Zweige abzudecken, nicht nur den Happy Path.
248269

249270
== Phase 2: Architektur
250271

0 commit comments

Comments
 (0)