Skip to content

Commit c706cdf

Browse files
authored
Merge pull request #454 from raifdmueller/add-socratic-theory-recovery-contract
feat: add Socratic Code Theory Recovery contract + Cockburn Use Cases anchor
2 parents d32b906 + 363746a commit c706cdf

11 files changed

Lines changed: 249 additions & 30 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
= Cockburn Use Cases
2+
:categories: requirements-engineering
3+
:roles: business-analyst, software-architect, product-owner, software-developer
4+
:related: gherkin, bdd-given-when-then, ears-requirements, arc42, iso-25010
5+
:proponents: Alistair Cockburn
6+
:tags: use-cases, requirements, goal-levels, fully-dressed, actor-goal-list
7+
:tier: 3
8+
9+
[%collapsible]
10+
====
11+
Full Name:: Cockburn Use Cases (Writing Effective Use Cases)
12+
13+
Also known as:: Fully Dressed Use Cases, Goal-Level Use Cases, Cockburn Format
14+
15+
[discrete]
16+
== *Core Concepts*:
17+
18+
Fully Dressed Format::
19+
A structured textual template for describing system behavior from the actor's perspective. Each use case includes: Primary Actor, Stakeholders & Interests, Preconditions, Trigger, Main Success Scenario (numbered steps), Extensions (alternative/failure paths with step references), Postconditions (success guarantee and minimal guarantee), and Technology & Data Variations.
20+
21+
Goal Levels::
22+
Three abstraction levels that organise use cases into a hierarchy:
23+
+
24+
* *Summary* (Kite/Cloud) — business-process-level goals spanning multiple user sessions. Example: "Manage customer lifecycle."
25+
* *User Goal* (Sea Level) — the sweet spot: one actor, one sitting, one measurable outcome. Example: "Place an order." Most use cases live here.
26+
* *Subfunction* (Fish/Clam) — steps that support a user goal but are not goals in themselves. Example: "Authenticate user." Extract only when reused across multiple user-goal use cases.
27+
28+
Scope::
29+
Defines the system boundary — what is inside the "design scope" and what is an external actor. Cockburn uses icons (a box for the system, a person for actors) to make the boundary visual. Getting scope right prevents use cases from being either too vague (organisational scope) or too detailed (component scope).
30+
31+
Actor-Goal List::
32+
The discovery technique: list every actor and every goal they have against the system. This produces a candidate use case list before writing any prose. The goal level test: "Does the actor go home happy if this goal is achieved?" filters out subfunctions masquerading as user goals.
33+
34+
What Cockburn does *not* prescribe::
35+
Cockburn's format is deliberately *prose-based and notation-agnostic*. It does not mandate Activity Diagrams, Gherkin, EARS, or any formal syntax. Those are complementary representations that can be layered on top — Activity Diagrams for visual flow, Gherkin for executable acceptance criteria, EARS for structured requirement statements.
36+
37+
Key Proponents:: Alistair Cockburn (_Writing Effective Use Cases_, Addison-Wesley, 2001). The book remains the canonical reference; Cockburn also contributed to the Agile Manifesto and Crystal methodologies.
38+
39+
[discrete]
40+
== *When to Use*:
41+
42+
* Discovering what a system needs to do before deciding how to build it — the Actor-Goal List is a fast, structured brainstorm
43+
* Structuring requirements conversations with stakeholders who think in scenarios, not features
44+
* Decomposing a large system into manageable behavioural units at the right granularity (goal-level test)
45+
* Brownfield theory recovery: reconstructing what a system does by writing use cases from observed behaviour
46+
* Feeding downstream artifacts: each use case becomes a natural unit for Activity Diagrams, Gherkin scenarios, and test plans
47+
* Complementing arc42: use cases populate Section 6 (Runtime View) and inform Section 3 (Context and Scope)
48+
49+
[discrete]
50+
== *Related Anchors*:
51+
52+
* <<gherkin,Gherkin>> - Executable acceptance criteria that can be derived from each extension path in a use case
53+
* <<bdd-given-when-then,BDD Given/When/Then>> - Formalises the scenario steps that Cockburn describes in prose
54+
* <<ears-requirements,EARS Requirements>> - Structured syntax for individual requirement statements; complements Cockburn's scenario-level structure
55+
* <<arc42,arc42>> - Use cases feed Section 6 (Runtime View) and inform Section 3 (Context and Scope)
56+
* <<iso-25010,ISO 25010>> - Quality goals that use case extensions should address (error handling, performance, security)
57+
====
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
= Cockburn Use Cases
2+
:categories: requirements-engineering
3+
:roles: business-analyst, software-architect, product-owner, software-developer
4+
:related: gherkin, bdd-given-when-then, ears-requirements, arc42, iso-25010
5+
:proponents: Alistair Cockburn
6+
:tags: use-cases, anforderungen, goal-levels, fully-dressed, actor-goal-liste
7+
:tier: 3
8+
9+
[%collapsible]
10+
====
11+
Vollständiger Name:: Cockburn Use Cases (Writing Effective Use Cases)
12+
13+
Auch bekannt als:: Fully Dressed Use Cases, Goal-Level Use Cases, Cockburn-Format
14+
15+
[discrete]
16+
== *Kernkonzepte*:
17+
18+
Fully Dressed Format::
19+
Ein strukturiertes textuelles Template zur Beschreibung von Systemverhalten aus Sicht des Akteurs. Jeder Use Case enthält: Primary Actor, Stakeholders & Interests, Vorbedingungen, Trigger, Main Success Scenario (nummerierte Schritte), Extensions (alternative/Fehlerpfade mit Schrittverweisen), Nachbedingungen (Success Guarantee und Minimal Guarantee) sowie Technology & Data Variations.
20+
21+
Goal Levels::
22+
Drei Abstraktionsebenen, die Use Cases hierarchisch organisieren:
23+
+
24+
* *Summary* (Kite/Cloud) — Geschäftsprozessziele über mehrere Sitzungen. Beispiel: "Kundenlebenszyklus verwalten."
25+
* *User Goal* (Sea Level) — der Idealfall: ein Akteur, eine Sitzung, ein messbares Ergebnis. Beispiel: "Bestellung aufgeben." Die meisten Use Cases leben hier.
26+
* *Subfunction* (Fish/Clam) — Schritte, die ein User Goal unterstützen, aber selbst keine eigenständigen Ziele sind. Beispiel: "Benutzer authentifizieren." Nur extrahieren, wenn sie in mehreren User-Goal-Use-Cases wiederverwendet werden.
27+
28+
Scope::
29+
Definiert die Systemgrenze — was innerhalb des "Design Scope" liegt und was externer Akteur ist. Cockburn verwendet Ikonen (ein Kasten für das System, eine Person für Akteure), um die Grenze visuell zu machen. Den richtigen Scope zu treffen verhindert, dass Use Cases entweder zu vage (organisatorischer Scope) oder zu detailliert (Komponenten-Scope) werden.
30+
31+
Actor-Goal-Liste::
32+
Die Discovery-Technik: jeden Akteur und jedes Ziel auflisten, das er gegenüber dem System hat. Das ergibt eine Kandidatenliste für Use Cases, bevor Prosa geschrieben wird. Der Goal-Level-Test: "Geht der Akteur zufrieden nach Hause, wenn dieses Ziel erreicht ist?" filtert Subfunctions heraus, die sich als User Goals tarnen.
33+
34+
Was Cockburn *nicht* vorschreibt::
35+
Cockburns Format ist bewusst *prosabasiert und notationsagnostisch*. Es verlangt keine Activity-Diagramme, kein Gherkin, kein EARS und keine formale Syntax. Das sind komplementäre Darstellungsformen, die darauf aufbauen können — Activity-Diagramme für visuellen Fluss, Gherkin für ausführbare Akzeptanzkriterien, EARS für strukturierte Anforderungsformulierungen.
36+
37+
Schlüsselvertreter:: Alistair Cockburn (_Writing Effective Use Cases_, Addison-Wesley, 2001). Das Buch bleibt die kanonische Referenz; Cockburn ist auch Mitunterzeichner des Agilen Manifests und Begründer der Crystal-Methodologien.
38+
39+
[discrete]
40+
== *Wann zu verwenden*:
41+
42+
* Herausfinden was ein System tun muss, bevor entschieden wird wie es gebaut wird — die Actor-Goal-Liste ist ein schneller, strukturierter Brainstorm
43+
* Requirements-Gespräche mit Stakeholdern strukturieren, die in Szenarien denken, nicht in Features
44+
* Ein großes System in handhabbare Verhaltenseinheiten auf der richtigen Granularität zerlegen (Goal-Level-Test)
45+
* Brownfield-Theorie-Rekonstruktion: aus beobachtetem Verhalten Use Cases schreiben
46+
* Downstream-Artefakte befüttern: jeder Use Case wird zur natürlichen Einheit für Activity-Diagramme, Gherkin-Szenarien und Testpläne
47+
* arc42 ergänzen: Use Cases füllen Abschnitt 6 (Laufzeitsicht) und informieren Abschnitt 3 (Kontextabgrenzung)
48+
49+
[discrete]
50+
== *Verwandte Anker*:
51+
52+
* <<gherkin,Gherkin>> - Ausführbare Akzeptanzkriterien, die aus jedem Extension-Pfad eines Use Cases abgeleitet werden können
53+
* <<bdd-given-when-then,BDD Given/When/Then>> - Formalisiert die Szenario-Schritte, die Cockburn in Prosa beschreibt
54+
* <<ears-requirements,EARS Requirements>> - Strukturierte Syntax für einzelne Anforderungsformulierungen; ergänzt Cockburns szenariobasierte Struktur
55+
* <<arc42,arc42>> - Use Cases füllen Abschnitt 6 (Laufzeitsicht) und informieren Abschnitt 3 (Kontextabgrenzung)
56+
* <<iso-25010,ISO 25010>> - Qualitätsziele, die Use-Case-Extensions adressieren sollten (Fehlerbehandlung, Performance, Sicherheit)
57+
====

docs/changelog.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
A chronological record of all semantic anchors added to the catalog. Community contributors are credited with thanks.
44

5+
== 2026-05-02
6+
7+
*New anchors:*
8+
9+
* *Cockburn Use Cases* — Alistair Cockburn's structured textual use case format with Goal Levels (Summary, User Goal, Subfunction) and Actor-Goal List discovery technique
10+
11+
*New contracts:*
12+
13+
* *Socratic Code Theory Recovery* — Recover a program's "theory" (Naur 1985) from source code through recursive question refinement; composes Socratic Method, arc42, ISO 25010, Nygard ADRs, Mental Model (Naur)
14+
515
== 2026-04-20
616

717
*New anchors:*

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

skill/semantic-anchor-translator/references/catalog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,11 @@ Source: https://github.com/LLM-Coding/Semantic-Anchors
386386

387387
## Requirements Engineering
388388

389+
### Cockburn Use Cases
390+
- **Also known as:** Fully Dressed Use Cases, Goal-Level Use Cases
391+
- **Proponents:** Alistair Cockburn
392+
- **Core:** Structured textual use case format — Primary Actor, Stakeholders & Interests, Preconditions, Trigger, Main Success Scenario, Extensions, Postconditions; three Goal Levels (Summary/Kite, User Goal/Sea Level, Subfunction/Fish); Actor-Goal List as discovery technique; deliberately prose-based and notation-agnostic — does NOT prescribe Activity Diagrams, Gherkin, or EARS, which are complementary representations
393+
389394
### INVEST
390395
- **Proponents:** Bill Wake
391396
- **Core:** Independent, Negotiable, Valuable, Estimable, Small, Testable — criteria for well-formed user stories

website/public/data/anchors.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,38 @@
223223
"filePath": "docs/anchors/clean-architecture.adoc",
224224
"tier": 3
225225
},
226+
{
227+
"id": "cockburn-use-cases",
228+
"title": "Cockburn Use Cases",
229+
"categories": [
230+
"requirements-engineering"
231+
],
232+
"roles": [
233+
"business-analyst",
234+
"software-architect",
235+
"product-owner",
236+
"software-developer"
237+
],
238+
"related": [
239+
"gherkin",
240+
"bdd-given-when-then",
241+
"ears-requirements",
242+
"arc42",
243+
"iso-25010"
244+
],
245+
"proponents": [
246+
"Alistair Cockburn"
247+
],
248+
"tags": [
249+
"use-cases",
250+
"requirements",
251+
"goal-levels",
252+
"fully-dressed",
253+
"actor-goal-list"
254+
],
255+
"filePath": "docs/anchors/cockburn-use-cases.adoc",
256+
"tier": 3
257+
},
226258
{
227259
"id": "code-smells",
228260
"title": "Code Smells",

website/public/data/categories.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
"id": "requirements-engineering",
140140
"name": "Requirements Engineering",
141141
"anchors": [
142+
"cockburn-use-cases",
142143
"ears-requirements",
143144
"invest",
144145
"moscow",

0 commit comments

Comments
 (0)