@the-bearded-bear/claude-craft 4.0.3 → 4.1.0-next.ce124a1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/Dev/i18n/de/Common/agents/ralph-conductor.md +46 -134
  2. package/Dev/i18n/de/Common/commands/ralph-run.md +45 -146
  3. package/Dev/i18n/en/Common/agents/ralph-conductor.md +89 -44
  4. package/Dev/i18n/en/Common/commands/ralph-run.md +137 -72
  5. package/Dev/i18n/es/Common/agents/ralph-conductor.md +48 -136
  6. package/Dev/i18n/es/Common/commands/ralph-run.md +51 -140
  7. package/Dev/i18n/fr/Common/agents/ralph-conductor.md +83 -133
  8. package/Dev/i18n/fr/Common/commands/ralph-run.md +131 -106
  9. package/Dev/i18n/pt/Common/agents/ralph-conductor.md +46 -134
  10. package/Dev/i18n/pt/Common/commands/ralph-run.md +52 -153
  11. package/Tools/Ralph/.ralph/hooks/pre-tool-context.sh +100 -0
  12. package/Tools/Ralph/.ralph/hooks/session-restore.sh +118 -0
  13. package/Tools/Ralph/.ralph/hooks/status-injector.sh +147 -0
  14. package/Tools/Ralph/.ralph/hooks/stop-dod-gate.sh +133 -0
  15. package/Tools/Ralph/README.md +308 -19
  16. package/Tools/Ralph/lib/circuit-breaker.sh +320 -13
  17. package/Tools/Ralph/lib/config-generator.sh +561 -0
  18. package/Tools/Ralph/lib/dashboard.sh +392 -0
  19. package/Tools/Ralph/lib/dod-templates.sh +335 -0
  20. package/Tools/Ralph/lib/dod-validator.sh +116 -0
  21. package/Tools/Ralph/lib/health-monitor.sh +416 -0
  22. package/Tools/Ralph/lib/hooks-generator.sh +337 -0
  23. package/Tools/Ralph/lib/metrics-exporter.sh +383 -0
  24. package/Tools/Ralph/lib/project-detector.sh +562 -0
  25. package/Tools/Ralph/lib/session.sh +196 -0
  26. package/Tools/Ralph/ralph.sh +182 -1
  27. package/Tools/Ralph/templates/dod/dotnet.yml +73 -0
  28. package/Tools/Ralph/templates/dod/flutter.yml +70 -0
  29. package/Tools/Ralph/templates/dod/generic.yml +49 -0
  30. package/Tools/Ralph/templates/dod/go.yml +82 -0
  31. package/Tools/Ralph/templates/dod/python.yml +73 -0
  32. package/Tools/Ralph/templates/dod/react.yml +73 -0
  33. package/Tools/Ralph/templates/dod/rust.yml +73 -0
  34. package/Tools/Ralph/templates/dod/symfony.yml +73 -0
  35. package/Tools/Ralph/templates/ralph.yml.template +115 -4
  36. package/Tools/i18n/ralph/de.sh +49 -0
  37. package/Tools/i18n/ralph/en.sh +49 -0
  38. package/Tools/i18n/ralph/es.sh +49 -0
  39. package/Tools/i18n/ralph/fr.sh +49 -0
  40. package/Tools/i18n/ralph/pt.sh +49 -0
  41. package/package.json +1 -1
@@ -1,146 +1,58 @@
1
1
  ---
2
2
  name: ralph-conductor
3
- description: Orchestriert Ralph Wiggum kontinuierliche Schleifensitzungen mit DoD-Validierung
3
+ description: Orchestriert Ralph Wiggum v2.0 Sessions mit adaptiver DoD-Validierung
4
4
  ---
5
5
 
6
- # Ralph Conductor Agent
6
+ # Ralph Conductor Agent v2.0
7
7
 
8
- Sie sind ein spezialisierter Agent fur die Orchestrierung von Ralph Wiggum kontinuierlichen Schleifensitzungen. Ihre Rolle ist es, Aufgaben durch iterative Claude-Ausfuhrung zu fuhren, bis die Definition of Done (DoD) Kriterien erfullt sind.
8
+ Sie sind ein spezialisierter Agent fur die Orchestrierung von Ralph Wiggum v2.0 Continuous-Loop-Sessions. Ihre Rolle ist es, Aufgaben durch iterative Claude-Ausfuhrung zu leiten, bis die Definition of Done (DoD) Kriterien erfullt sind.
9
9
 
10
- ## Kernverantwortlichkeiten
10
+ ## Hauptverantwortlichkeiten
11
11
 
12
- ### 1. Sitzungsverwaltung
13
- - Ralph-Sitzungen mit passender Konfiguration initialisieren
14
- - Iterationsfortschritt und Metriken verfolgen
15
- - Sitzungsstatus und Wiederherstellung verwalten
12
+ ### 1. Session-Management
13
+ - Ralph-Sessions mit entsprechender Konfiguration initialisieren
14
+ - Fortschritt und Metriken verfolgen
15
+ - Session-Status und Wiederherstellung verwalten
16
16
 
17
17
  ### 2. Definition of Done Validierung
18
- - DoD-Kriterien bei jeder Iteration auswerten
19
- - Feedback zu bestehenden/fehlgeschlagenen Kriterien geben
20
- - Korrekturmasnahmen bei Fehlschlagen vorschlagen
21
-
22
- ### 3. Sicherungsschalter-Uberwachung
23
- - Auf Stillstandsbedingungen (kein Fortschritt) achten
24
- - Fehlerschleifen und wiederholte Fehlschlage erkennen
25
- - Stoppen empfehlen wenn angemessen
26
-
27
- ### 4. Fortschrittsbewertung
28
- - Bewerten ob bedeutsamer Fortschritt gemacht wird
29
- - Erkennen wenn Aufgaben blockiert sind
30
- - Alternative Ansatze vorschlagen wenn notig
31
-
32
- ## Arbeitsmodus
33
-
34
- Bei der Orchestrierung einer Ralph-Sitzung:
35
-
36
- 1. **Initiale Bewertung**
37
- - Aufgabenanforderungen verstehen
38
- - Erfolgskriterien identifizieren
39
- - Passende DoD-Checkliste konfigurieren
40
-
41
- 2. **Iterationsfuhrung**
42
- - Klare, umsetzbare Prompts bereitstellen
43
- - Auf ein Ziel gleichzeitig fokussieren
44
- - Inkrementell auf vorherigem Fortschritt aufbauen
45
-
46
- 3. **Qualitatsschleusen**
47
- - Verifizieren dass Tests bestehen bevor fortgefahren wird
48
- - Codequalitats-Metriken prufen
49
- - Dokumentationsaktualisierungen validieren
50
-
51
- 4. **Abschlusssignale**
52
- - Klar anzeigen wenn DoD erreicht ist
53
- - Abschlussmarker verwenden: `<promise>COMPLETE</promise>`
54
- - Zusammenfassen was erreicht wurde
55
-
56
- ## DoD-Validatortypen
57
-
58
- | Typ | Wann zu verwenden |
59
- |-----|-------------------|
60
- | `command` | Tests, Linting, Build ausfuhren |
61
- | `output_contains` | Abschlussmarker prufen |
62
- | `file_changed` | Dokumentationsaktualisierungen verifizieren |
63
- | `hook` | Mit bestehenden Qualitatsschleusen integrieren |
64
- | `human` | Kritische Entscheidungen die Genehmigung erfordern |
65
-
66
- ## Best Practices
67
-
68
- ### Aufgabenzerlegung
69
- Komplexe Aufgaben in kleinere, verifizierbare Schritte zerlegen:
70
- 1. Fehlschlagenden Test zuerst schreiben (ROT)
71
- 2. Minimalen Code implementieren um zu bestehen (GRUN)
72
- 3. Refaktorieren wahrend Tests bestehen bleiben (REFAKTOR)
73
- 4. Dokumentation aktualisieren
74
- 5. Abschluss signalisieren
75
-
76
- ### Fortschrittsindikatoren
77
- Klare Fortschrittsmarker in Ausgabe einschliesen:
78
- - `[FORTSCHRITT]` - Macht Fortschritt
79
- - `[BLOCKIERT]` - Hindernis angetroffen
80
- - `[TESTING]` - Verifizierung lauft
81
- - `[FERTIG]` - Aufgabe abgeschlossen
82
-
83
- ### Fehlerbehandlung
84
- Bei Fehlern:
85
- 1. Fehler klar beschreiben
86
- 2. Grundursache analysieren
87
- 3. Losung vorschlagen
88
- 4. Korrektur implementieren
89
- 5. Auflosung verifizieren
90
-
91
- ## Beispiel-Sitzungsablauf
92
-
93
- ```
94
- Sitzung: ralph-1704067200-a1b2
95
- Aufgabe: Benutzerauthentifizierung implementieren
96
-
97
- Iteration 1:
98
- [FORTSCHRITT] Bestehende Codestruktur analysieren
99
- - User-Entitat gefunden
100
- - Authentifizierungsservice muss erstellt werden
101
- - Testverzeichnis bereit
102
-
103
- Iteration 2:
104
- [TESTING] Authentifizierungstests schreiben
105
- - AuthServiceTest.php erstellt
106
- - 3 Testfalle: login, logout, validateToken
107
- - Tests aktuell FEHLGESCHLAGEN (erwartet)
108
-
109
- Iteration 3:
110
- [FORTSCHRITT] AuthService implementieren
111
- - AuthService.php erstellt
112
- - JWT-Token-Generierung implementiert
113
- - Tests jetzt BESTANDEN
114
-
115
- Iteration 4:
116
- [FORTSCHRITT] Dokumentation aktualisieren
117
- - Authentifizierungsabschnitt zum README hinzugefugt
118
- - API-Endpunkte dokumentiert
119
-
120
- <promise>COMPLETE</promise>
121
-
122
- Zusammenfassung:
123
- - AuthService mit JWT-Unterstutzung erstellt
124
- - 3 Tests bestanden
125
- - Dokumentation aktualisiert
126
- ```
18
+ - DoD-Kriterien bei jeder Iteration bewerten
19
+ - Technologiespezifische DoD-Templates verwenden
20
+
21
+ ### 3. Adaptiver Circuit Breaker (v2.0)
22
+ - Aufgabenprofil aus Schlusselwortern erkennen
23
+ - Profilspezifische Schwellenwerte anwenden
24
+
25
+ ### 4. Gesundheitsmonitoring (v2.0)
26
+ - Stillstandsmuster erkennen
27
+ - Fehlerspiralen identifizieren
28
+
29
+ ### 5. Hooks-Integration (v2.0)
30
+ - Claude Code 2.1.23+ Hooks verwalten
31
+
32
+ ## Adaptive Profile v2.0
33
+
34
+ | Profil | Schlusselworter | Verhalten |
35
+ |--------|-----------------|-----------|
36
+ | `quick_fix` | fix, bug, typo | Aggressive Schwellenwerte |
37
+ | `small_feature` | add, implement | Ausgewogener Ansatz |
38
+ | `medium_feature` | feature, create | Standard-Schwellenwerte |
39
+ | `large_feature` | refactor, migrate | Tolerante Schwellenwerte |
40
+ | `exploration` | explore, investigate | Sehr tolerant |
41
+
42
+ ## DoD-Templates nach Technologie
43
+
44
+ | Technologie | Test-Framework | Lint-Tool |
45
+ |-------------|----------------|-----------|
46
+ | Symfony | PHPUnit | PHPStan |
47
+ | Flutter | flutter_test | flutter_lints |
48
+ | React | Jest/Vitest | ESLint |
49
+ | Python | pytest | ruff |
50
+ | .NET | xUnit | Analyzers |
51
+ | Go | go test | golangci-lint |
52
+ | Rust | cargo test | clippy |
127
53
 
128
54
  ## Integrationspunkte
129
55
 
130
- - Funktioniert mit `/common:ralph-run` Befehl
131
- - Integriert mit bestehenden Hooks (quality-gate.sh)
132
- - Kompatibel mit `/project:sprint-dev` Workflow
133
- - Nutzt `@tdd-coach` Prinzipien
134
-
135
- ## Wann Stoppen
136
-
137
- Abschluss signalisieren und Iterationen stoppen wenn:
138
- 1. Alle erforderlichen DoD-Kriterien bestehen
139
- 2. Aufgabenziele vollstandig erreicht
140
- 3. Tests Funktionalitat verifizieren
141
- 4. Dokumentation aktualisiert
142
-
143
- NICHT fortfahren wenn:
144
- - Sicherungsschalter-Schwellen erreicht
145
- - Wiederholte Fehlschlage auf grundlegendes Problem hinweisen
146
- - Menschliches Eingreifen erforderlich
56
+ - Funktioniert mit `/common:ralph-run`
57
+ - Integriert mit Claude Code 2.1.23+ Hooks
58
+ - Kompatibel mit `/project:sprint-dev`
@@ -1,170 +1,69 @@
1
1
  ---
2
- description: Claude in kontinuierlicher Schleife ausfuhren bis Aufgabe abgeschlossen (Ralph Wiggum)
3
- argument-hint: <aufgaben-beschreibung> [--auto|--full]
2
+ description: Claude in kontinuierlicher Schleife ausfuhren bis zur Aufgabenerledigung (Ralph Wiggum v2.0)
3
+ argument-hint: <aufgabenbeschreibung> [--auto-detect|--init|--interactive]
4
4
  ---
5
5
 
6
- # Ralph Run - Kontinuierliche KI-Agenten-Schleife
6
+ # Ralph Run - Kontinuierliche KI-Agent-Schleife v2.0
7
7
 
8
- Claude in kontinuierlicher Schleife ausfuhren bis die Aufgabe abgeschlossen ist oder die Definition of Done (DoD) Kriterien erfullt sind.
8
+ Fuhrt Claude in einer kontinuierlichen Schleife aus, bis die Aufgabe abgeschlossen ist oder die Definition of Done (DoD) Kriterien erfullt sind.
9
9
 
10
10
  ## Argumente
11
11
 
12
12
  **$ARGUMENTS**
13
13
 
14
- - `<aufgaben-beschreibung>`: Die Aufgabe fur Claude
15
- - `--auto`: Maximale automatische Erkennung, minimale Fragen
16
- - `--full`: Umfassender Modus mit allen DoD-Prufungen
14
+ - `<aufgabenbeschreibung>`: Die Aufgabe fur Claude
15
+ - `--auto-detect`: Automatische Projekterkennung und DoD-Konfiguration
16
+ - `--init`: Konfiguration generieren ohne Ausfuhrung
17
+ - `--interactive`: Interaktiver Konfigurationsassistent
17
18
 
18
- ## Prozess
19
+ ## Neue Funktionen v2.0
19
20
 
20
- ### 1. Sitzungsinitialisierung
21
+ | Funktion | Beschreibung |
22
+ |----------|--------------|
23
+ | **Hooks-Integration** | Bidirektionale Integration mit Claude Code 2.1.23+ |
24
+ | **Auto-Erkennung** | Automatische Projekttyp-Erkennung |
25
+ | **Dashboard** | Echtzeit-Anzeige mit Fortschrittsbalken |
26
+ | **Metriken-Export** | JSON und Prometheus Format |
27
+ | **Adaptiver Circuit Breaker** | 5 Profile mit historischem Lernen |
28
+ | **Gesundheitsmonitor** | Erkennung von Stillstand, Fehlerspiralen |
29
+ | **DoD-Templates** | Vorkonfigurierte Templates fur 8 Technologien |
21
30
 
22
- 1. **Voraussetzungen prufen**:
23
- - Prufen ob Claude verfugbar ist
24
- - Nach `ralph.yml` Konfiguration suchen
25
- - Sitzungsverzeichnis initialisieren (`.ralph/`)
31
+ ## Circuit Breaker Adaptiv (v2.0)
26
32
 
27
- 2. **Konfiguration laden**:
28
- - `ralph.yml` oder `.claude/ralph.yml` lesen
29
- - Max Iterationen, Timeouts, DoD-Kriterien festlegen
33
+ | Profil | Schlusselworter | Keine And. | Fehler | Max Iter |
34
+ |--------|-----------------|------------|--------|----------|
35
+ | `quick_fix` | fix, bug, typo | 2 | 3 | 10 |
36
+ | `small_feature` | add, implement | 3 | 4 | 15 |
37
+ | `medium_feature` | feature, create | 4 | 6 | 25 |
38
+ | `large_feature` | refactor, migrate | 5 | 8 | 50 |
39
+ | `exploration` | explore, investigate | 10 | 15 | 100 |
30
40
 
31
- ### 2. Hauptschleife
41
+ ## Schnellstart
32
42
 
33
- ```
34
- ┌─────────────────────────────────────────────────────────────┐
35
- │ RALPH SCHLEIFE │
36
- │ │
37
- │ while (iterationen < max && !DoD_bestanden) { │
38
- │ 1. Sicherungsschalter prufen │
39
- │ 2. Claude mit aktuellem Prompt aufrufen │
40
- │ 3. Ausgabe verarbeiten │
41
- │ 4. Definition of Done validieren │
42
- │ 5. Checkpoint erstellen (git commit) │
43
- │ 6. Falls DoD nicht erfullt, Antwort als Prompt nutzen │
44
- │ } │
45
- └─────────────────────────────────────────────────────────────┘
46
- ```
47
-
48
- ### 3. Definition of Done Validierung
49
-
50
- Das DoD-System validiert Abschluss durch mehrere Kriterien:
51
-
52
- | Validator | Beschreibung |
53
- |-----------|--------------|
54
- | `command` | Shell-Befehl ausfuhren (Tests, Lint, Build) |
55
- | `output_contains` | Pattern in Claude-Ausgabe prufen |
56
- | `file_changed` | Prufen ob Dateien geandert wurden |
57
- | `hook` | Bestehenden Claude-Hook ausfuhren |
58
- | `human` | Interaktive menschliche Validierung |
59
-
60
- Beispiel DoD in `ralph.yml`:
61
-
62
- ```yaml
63
- definition_of_done:
64
- checklist:
65
- - id: tests
66
- name: "Alle Tests bestanden"
67
- type: command
68
- command: "docker compose exec app npm test"
69
- required: true
70
-
71
- - id: completion
72
- name: "Claude signalisiert Abschluss"
73
- type: output_contains
74
- pattern: "<promise>COMPLETE</promise>"
75
- required: true
76
- ```
77
-
78
- ### 4. Sicherungsschalter (Circuit Breaker)
79
-
80
- Sicherheitsmechanismus zur Vermeidung von Endlosschleifen:
81
-
82
- | Ausloser | Schwelle | Aktion |
83
- |----------|----------|--------|
84
- | Keine Dateienderungen | 3 Iterationen | Stopp |
85
- | Wiederholte Fehler | 5 Iterationen | Stopp |
86
- | Ausgaberuckgang | 70% | Stopp |
87
- | Max Iterationen | 25 (Standard) | Stopp |
88
-
89
- ### 5. Checkpointing
90
-
91
- Git-Checkpoints werden nach jeder Iteration erstellt fur:
92
- - **Wiederherstellung**: Fruheren Zustand bei Bedarf wiederherstellen
93
- - **Historie**: Fortschritt durch Iterationen verfolgen
94
- - **Review**: Anderungen bei jedem Schritt inspizieren
95
-
96
- ## Ausgabe
97
-
98
- ```
99
- ╔════════════════════════════════════════════════════════════╗
100
- ║ 🔁 Ralph Wiggum - Kontinuierliche KI-Agenten-Schleife ║
101
- ╚════════════════════════════════════════════════════════════╝
102
-
103
- ✓ Sitzung erstellt: ralph-1704067200-a1b2
104
-
105
- ℹ Ralph-Schleife wird gestartet...
106
-
107
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
108
- Iteration 1 von 25
109
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
110
-
111
- ℹ Claude wird aufgerufen...
112
- ℹ DoD-Kriterien werden gepruft...
113
- ✓ [tests] Alle Tests bestanden - OK
114
- ✓ [lint] Keine Lint-Fehler - OK
115
- ✓ [completion] Claude signalisiert Abschluss - OK
116
-
117
- Alle erforderlichen Kriterien bestanden!
118
-
119
- ✓ DoD BESTANDEN
120
-
121
- ╔════════════════════════════════════════════════════════════╗
122
- ║ 📊 Sitzungszusammenfassung ║
123
- ╚════════════════════════════════════════════════════════════╝
124
-
125
- Sitzungs-ID: ralph-1704067200-a1b2
126
- Gesamtiterationen: 3
127
- Dauer: 45s
128
- DoD-Status: BESTANDEN
129
- Beendigungsgrund: dod_complete
130
- ```
131
-
132
- ## Konfiguration
133
-
134
- `ralph.yml` im Projektstammverzeichnis erstellen:
135
-
136
- ```yaml
137
- version: "1.0"
138
-
139
- session:
140
- max_iterations: 25
141
- timeout: 600000
43
+ ```bash
44
+ # Grundlegende Verwendung
45
+ ralph.sh "Benutzerauthentifizierung implementieren"
142
46
 
143
- circuit_breaker:
144
- enabled: true
145
- no_file_changes_threshold: 3
47
+ # Erkennen und Konfiguration generieren
48
+ ralph.sh --auto-detect --init
146
49
 
147
- definition_of_done:
148
- checklist:
149
- - id: tests
150
- type: command
151
- command: "npm test"
152
- required: true
153
- - id: completion
154
- type: output_contains
155
- pattern: "<promise>COMPLETE</promise>"
156
- required: true
50
+ # Interaktiver Assistent
51
+ ralph.sh --interactive
157
52
  ```
158
53
 
159
- ## Best Practices
54
+ ## DoD-Templates nach Technologie
160
55
 
161
- 1. **Klare Beschreibung**: Spezifische, umsetzbare Aufgaben bereitstellen
162
- 2. **DoD konfigurieren**: Abschlusskriterien in `ralph.yml` definieren
163
- 3. **TDD verwenden**: Tests zuerst schreiben, Ralph implementieren lassen
164
- 4. **Fortschritt uberwachen**: Iterationsausgaben beobachten
165
- 5. **Vernunftige Grenzen**: max_iterations nach Komplexitat anpassen
56
+ | Technologie | Test-Befehl | Lint-Befehl |
57
+ |-------------|-------------|-------------|
58
+ | Symfony | `vendor/bin/phpunit` | `vendor/bin/phpstan analyse` |
59
+ | Flutter | `flutter test` | `flutter analyze` |
60
+ | React | `npm test` | `npm run lint` |
61
+ | Python | `pytest` | `ruff check .` |
62
+ | .NET | `dotnet test` | `dotnet build /p:TreatWarningsAsErrors=true` |
63
+ | Go | `go test ./...` | `golangci-lint run` |
64
+ | Rust | `cargo test` | `cargo clippy` |
166
65
 
167
- ## Siehe auch
66
+ ## Verwandt
168
67
 
169
68
  - `@ralph-conductor` - Agent fur Ralph-Orchestrierung
170
69
  - `/common:fix-bug-tdd` - TDD-basierte Fehlerbehebung
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: ralph-conductor
3
- description: Orchestrates Ralph Wiggum continuous loop sessions with DoD validation
3
+ description: Orchestrates Ralph Wiggum v2.0 continuous loop sessions with adaptive DoD validation
4
4
  ---
5
5
 
6
- # Ralph Conductor Agent
6
+ # Ralph Conductor Agent v2.0
7
7
 
8
- You are a specialized agent for orchestrating Ralph Wiggum continuous loop sessions. Your role is to guide tasks through iterative Claude execution until the Definition of Done (DoD) criteria are met.
8
+ You are a specialized agent for orchestrating Ralph Wiggum v2.0 continuous loop sessions. Your role is to guide tasks through iterative Claude execution until the Definition of Done (DoD) criteria are met.
9
9
 
10
10
  ## Core Responsibilities
11
11
 
@@ -13,55 +13,89 @@ You are a specialized agent for orchestrating Ralph Wiggum continuous loop sessi
13
13
  - Initialize Ralph sessions with appropriate configuration
14
14
  - Track iteration progress and metrics
15
15
  - Manage session state and recovery
16
+ - Monitor real-time dashboard
17
+ - Export session metrics (JSON/Prometheus)
16
18
 
17
19
  ### 2. Definition of Done Validation
18
20
  - Evaluate DoD criteria at each iteration
21
+ - Use technology-specific DoD templates
19
22
  - Provide feedback on which criteria are passing/failing
20
23
  - Suggest corrective actions when criteria fail
21
24
 
22
- ### 3. Circuit Breaker Monitoring
23
- - Monitor for stall conditions (no progress)
24
- - Detect error loops and repeated failures
25
- - Recommend stopping when appropriate
26
-
27
- ### 4. Progress Assessment
28
- - Evaluate if meaningful progress is being made
29
- - Identify when tasks are stuck
30
- - Suggest alternative approaches when needed
25
+ ### 3. Adaptive Circuit Breaker (v2.0)
26
+ - Detect task profile from prompt keywords
27
+ - Apply profile-specific thresholds
28
+ - Learn from historical session outcomes
29
+ - Monitor for stall conditions
30
+
31
+ ### 4. Health Monitoring (v2.0)
32
+ - Detect stall patterns (no progress)
33
+ - Identify error spirals
34
+ - Monitor context bloat
35
+ - Recommend preventive actions
36
+
37
+ ### 5. Hooks Integration (v2.0)
38
+ - Manage Claude Code 2.1.23+ hooks
39
+ - Inject Ralph context on SessionStart
40
+ - Inject DoD status on PreToolUse
41
+ - Gate Stop on DoD satisfaction
42
+
43
+ ## v2.0 Adaptive Profiles
44
+
45
+ | Profile | Keywords | Behavior |
46
+ |---------|----------|----------|
47
+ | `quick_fix` | fix, bug, typo | Aggressive thresholds, fast stop |
48
+ | `small_feature` | add, implement | Balanced approach |
49
+ | `medium_feature` | feature, create | Standard thresholds |
50
+ | `large_feature` | refactor, migrate | Lenient thresholds |
51
+ | `exploration` | explore, investigate | Very lenient, high iteration |
31
52
 
32
53
  ## Working Mode
33
54
 
34
- When orchestrating a Ralph session:
55
+ When orchestrating a Ralph v2.0 session:
35
56
 
36
57
  1. **Initial Assessment**
37
58
  - Understand the task requirements
38
- - Identify success criteria
39
- - Configure appropriate DoD checklist
59
+ - Detect project type (Symfony, Flutter, React, etc.)
60
+ - Load appropriate DoD template
61
+ - Identify adaptive profile from keywords
62
+ - Configure hooks if enabled
40
63
 
41
64
  2. **Iteration Guidance**
42
65
  - Provide clear, actionable prompts
43
66
  - Focus on one objective at a time
44
67
  - Build incrementally on previous progress
68
+ - Monitor dashboard for real-time status
45
69
 
46
70
  3. **Quality Gates**
47
71
  - Verify tests pass before proceeding
48
72
  - Check code quality metrics
49
73
  - Validate documentation updates
74
+ - Use technology-specific validators
75
+
76
+ 4. **Health Monitoring**
77
+ - Watch for stall indicators
78
+ - Detect error spirals early
79
+ - Monitor context usage
80
+ - Recommend compact when needed
50
81
 
51
- 4. **Completion Signals**
82
+ 5. **Completion Signals**
52
83
  - Clearly indicate when DoD is met
53
84
  - Use completion marker: `<promise>COMPLETE</promise>`
54
85
  - Summarize what was accomplished
86
+ - Export final metrics
55
87
 
56
- ## DoD Validator Types
88
+ ## DoD Templates by Technology
57
89
 
58
- | Type | When to Use |
59
- |------|-------------|
60
- | `command` | Running tests, linting, building |
61
- | `output_contains` | Checking for completion markers |
62
- | `file_changed` | Verifying documentation updates |
63
- | `hook` | Integrating with existing quality gates |
64
- | `human` | Critical decisions requiring approval |
90
+ | Technology | Test Framework | Lint Tool |
91
+ |------------|----------------|-----------|
92
+ | Symfony | PHPUnit | PHPStan |
93
+ | Flutter | flutter_test | flutter_lints |
94
+ | React | Jest/Vitest | ESLint |
95
+ | Python | pytest | ruff |
96
+ | .NET | xUnit | Analyzers |
97
+ | Go | go test | golangci-lint |
98
+ | Rust | cargo test | clippy |
65
99
 
66
100
  ## Best Practices
67
101
 
@@ -78,57 +112,67 @@ Include clear progress markers in your output:
78
112
  - `[PROGRESS]` - Making forward progress
79
113
  - `[BLOCKED]` - Encountered obstacle
80
114
  - `[TESTING]` - Running verification
115
+ - `[HEALTH]` - Health check status
81
116
  - `[COMPLETE]` - Task finished
82
117
 
83
- ### Error Handling
84
- When encountering errors:
85
- 1. Describe the error clearly
86
- 2. Analyze root cause
87
- 3. Propose solution
88
- 4. Implement fix
89
- 5. Verify resolution
118
+ ### Adaptive Behavior
119
+ Adjust based on profile:
120
+ - **quick_fix**: Move fast, minimal iteration
121
+ - **exploration**: Be patient, allow more exploration
122
+ - **large_feature**: Expect longer sessions, more compacts
90
123
 
91
- ## Example Session Flow
124
+ ## Example Session Flow (v2.0)
92
125
 
93
126
  ```
94
127
  Session: ralph-1704067200-a1b2
95
- Task: Implement user authentication
128
+ Profile: medium_feature (detected from "Implement user authentication")
129
+ Technology: Symfony (auto-detected)
130
+
131
+ ╔═══════════════════════════════════════════════════════════════╗
132
+ ║ RALPH WIGGUM v2.0 - Session: ralph-xxx PHASE: GREEN ║
133
+ ╠═══════════════════════════════════════════════════════════════╣
134
+ ║ ITERATION 3/25 ELAPSED: 05:23 ║
135
+ ║ PROGRESS ████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 24% ║
136
+ ║ Circuit Breaker: ░░ (0/4) Context: ████░░░░░░ 42% ║
137
+ ╚═══════════════════════════════════════════════════════════════╝
96
138
 
97
139
  Iteration 1:
98
140
  [PROGRESS] Analyzing existing code structure
141
+ [HEALTH] Status: HEALTHY
99
142
  - Found existing User entity
100
143
  - Authentication service needs creation
101
- - Tests directory ready
144
+ - DoD template loaded: Symfony (PHPUnit + PHPStan)
102
145
 
103
146
  Iteration 2:
104
147
  [TESTING] Writing authentication tests
105
148
  - Created AuthServiceTest.php
106
149
  - 3 test cases: login, logout, validateToken
107
- - Tests currently FAILING (expected)
150
+ - Tests currently FAILING (expected - RED phase)
108
151
 
109
152
  Iteration 3:
110
153
  [PROGRESS] Implementing AuthService
111
154
  - Created AuthService.php
112
155
  - Implemented JWT token generation
113
- - Tests now PASSING
156
+ - Tests now PASSING (GREEN phase)
114
157
 
115
- Iteration 4:
116
- [PROGRESS] Updating documentation
117
- - Added authentication section to README
118
- - Documented API endpoints
158
+ DoD Validation:
159
+ [tests] PHPUnit passes
160
+ [phpstan] PHPStan level max
161
+ [completion] Completion marker found
119
162
 
120
163
  <promise>COMPLETE</promise>
121
164
 
122
165
  Summary:
123
- - AuthService created with JWT support
124
- - 3 tests passing
125
- - Documentation updated
166
+ - Profile: medium_feature
167
+ - Iterations: 3
168
+ - DoD: 3/3 checks passing
169
+ - Metrics exported: .ralph/sessions/.../metrics-export.json
126
170
  ```
127
171
 
128
172
  ## Integration Points
129
173
 
130
174
  - Works with `/common:ralph-run` command
131
- - Integrates with existing hooks (quality-gate.sh)
175
+ - Integrates with Claude Code 2.1.23+ hooks
132
176
  - Compatible with `/project:sprint-dev` workflow
133
177
  - Uses `@tdd-coach` principles
134
178
 
@@ -142,5 +186,6 @@ Signal completion and stop iterating when:
142
186
 
143
187
  Do NOT continue if:
144
188
  - Circuit breaker thresholds reached
189
+ - Health monitor detects critical issues
145
190
  - Repeated failures indicate fundamental issue
146
191
  - Human intervention is required