You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
- 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)
216
234
Save as .adoc files in src/docs/specs/.
217
235
----
218
236
219
-
Each Use Case must define four elements:
237
+
Each Use Case in ⚓ link:#/anchor/cockburn-use-cases[*Cockburn's Fully Dressed format*] defines:
220
238
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.
221
241
* *Trigger*: The specific event that starts the use case ("User clicks Submit", "System receives webhook").
222
242
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).
226
246
Postconditions are what your tests assert.
227
247
* *Business Rules*: Numbered rules (BR-001, BR-002, ...) that capture validation constraints, calculation logic, or domain invariants.
228
248
Business rules make implicit knowledge explicit.
229
249
Without them, the AI invents its own validation logic -- or skips it entirely.
230
250
231
-
This structure follows Alistair Cockburn's Use Case format, which LLMs recognize reliably.
232
251
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:
233
254
234
255
⚓ link:#/anchor/gherkin[*Gherkin*] (Given/When/Then) provides acceptance criteria that are both human-readable and machine-testable.
235
256
These criteria become the foundation for TDD later.
236
257
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.
- 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)
226
244
Save as .adoc files in src/docs/specs/.
227
245
----
228
246
229
-
Jeder Use Case muss fünf Elemente definieren:
247
+
Jeder Use Case in ⚓ link:#/anchor/cockburn-use-cases[*Cockburns Fully Dressed Format*] definiert:
230
248
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.
231
251
* *Trigger*: Das spezifische Ereignis, das den Use Case auslöst ("Benutzer klickt auf Absenden", "System empfängt Webhook").
232
252
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).
236
256
Nachbedingungen sind das, was die Tests prüfen.
237
257
* *Geschäftsregeln (Business Rules)*: Nummerierte Regeln (BR-001, BR-002, ...) für Validierungslogik, Berechnungen oder Domäneninvarianten.
Ohne sie erfindet die KI eigene Validierungslogik -- oder lässt sie komplett weg.
240
260
241
-
Diese Struktur folgt dem Use-Case-Format von Alistair Cockburn, das LLMs zuverlässig erkennen.
242
261
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:
243
264
244
265
⚓ link:#/anchor/gherkin[*Gherkin*] (Given/When/Then) liefert Akzeptanzkriterien, die sowohl für Menschen lesbar als auch maschinell testbar sind.
245
266
Diese Kriterien werden später die Grundlage für TDD.
246
267
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.
0 commit comments