- Add /ralph:prd command for PRD generation with clarifying questions - Add /ralph:convert command to convert PRD to executable JSON - Include templates: ralph.sh, prompt.md, prd-template.json - Include example PRD (prd-hello-api.json) - Update marketplace.json with ralph plugin v1.0.0 - Update README with ralph documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
119 lines
3.7 KiB
Markdown
119 lines
3.7 KiB
Markdown
# Ralph Plugin
|
|
|
|
**Ralph** este un loop autonom de agent AI care rulează Claude Code în mod repetat până când toate task-urile dintr-un PRD sunt complete.
|
|
|
|
Adaptat din [snarktank/ralph](https://github.com/snarktank/ralph) pentru Claude Code CLI.
|
|
|
|
## Comenzi disponibile
|
|
|
|
| Comandă | Descriere |
|
|
|---------|-----------|
|
|
| `/ralph:prd` | Generează PRD structurat cu întrebări clarificatoare |
|
|
| `/ralph:convert` | Convertește PRD markdown în prd.json pentru execuție |
|
|
|
|
## Workflow
|
|
|
|
```
|
|
1. /ralph:prd → Generează PRD markdown cu întrebări clarificatoare
|
|
2. /ralph:convert → Convertește PRD în prd.json pentru execuție
|
|
3. ./ralph.sh → Rulează loop-ul autonom
|
|
```
|
|
|
|
## Ciclul Ralph
|
|
|
|
```
|
|
┌──────────────────────────────────────────────────────────────────┐
|
|
│ CICLUL RALPH │
|
|
├──────────────────────────────────────────────────────────────────┤
|
|
│ 1. Citește prd.json → selectează story cu prioritate minimă │
|
|
│ 2. Lansează instanță fresh Claude Code (context curat) │
|
|
│ 3. Implementează story-ul selectat │
|
|
│ 4. Rulează quality checks (typecheck, tests, lint) │
|
|
│ 5. Commit dacă trece → marchează story ca "passes: true" │
|
|
│ 6. Salvează learnings în progress.txt │
|
|
│ 7. Repetă până toate story-urile sunt complete │
|
|
└──────────────────────────────────────────────────────────────────┘
|
|
```
|
|
|
|
## Utilizare
|
|
|
|
### Pas 1: Generează PRD
|
|
|
|
```
|
|
/ralph:prd
|
|
|
|
Vreau să adaug funcționalitate de export CSV pentru dashboard.
|
|
```
|
|
|
|
Claude va pune întrebări clarificatoare și va genera PRD în `/tasks/prd-export-csv.md`.
|
|
|
|
### Pas 2: Convertește în JSON
|
|
|
|
```
|
|
/ralph:convert
|
|
|
|
Convertește PRD-ul din tasks/prd-export-csv.md
|
|
```
|
|
|
|
Claude va crea structura `scripts/ralph/` și genera `prd.json`.
|
|
|
|
### Pas 3: Rulează Ralph
|
|
|
|
```bash
|
|
./scripts/ralph/ralph.sh 20 # 20 iterații max
|
|
```
|
|
|
|
### Pas 4: Monitorizare
|
|
|
|
```bash
|
|
jq '.userStories[] | {id, title, passes}' scripts/ralph/prd.json
|
|
cat scripts/ralph/progress.txt
|
|
```
|
|
|
|
## Structura proiectului
|
|
|
|
```
|
|
your-project/
|
|
├── scripts/ralph/
|
|
│ ├── ralph.sh # Script principal
|
|
│ ├── prompt.md # Instrucțiuni per iterație
|
|
│ ├── prd.json # Task-uri și status (generat)
|
|
│ ├── progress.txt # Learnings (generat)
|
|
│ └── logs/ # Logs per iterație
|
|
└── tasks/
|
|
└── prd-*.md # PRD-uri markdown
|
|
```
|
|
|
|
## Templates incluse
|
|
|
|
| Template | Descriere |
|
|
|----------|-----------|
|
|
| `ralph.sh` | Scriptul principal de loop autonom |
|
|
| `prompt.md` | Instrucțiuni pentru fiecare iterație |
|
|
| `prd-template.json` | Schema JSON pentru PRD |
|
|
|
|
## Reguli pentru stories bune
|
|
|
|
### Mărime corectă (1 context window)
|
|
- Adaugă un câmp în DB + migration
|
|
- Creează un component UI simplu
|
|
- Adaugă un endpoint API
|
|
- Scrie tests pentru o funcție
|
|
|
|
### Ordinea priorităților
|
|
1. Schema/Database (priority: 1-10)
|
|
2. Backend logic (priority: 11-20)
|
|
3. API endpoints (priority: 21-30)
|
|
4. UI components (priority: 31-40)
|
|
5. Integration/polish (priority: 41-50)
|
|
|
|
## Cerințe
|
|
|
|
- Claude Code CLI instalat și autentificat
|
|
- `jq` pentru procesare JSON
|
|
- Git repository
|
|
|
|
## Credite
|
|
|
|
- [snarktank/ralph](https://github.com/snarktank/ralph) - Ralph original pentru Amp
|