feat(ralph): Add ralph plugin for autonomous PRD implementation
- 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>
This commit is contained in:
142
plugins/ralph/commands/convert.md
Normal file
142
plugins/ralph/commands/convert.md
Normal file
@@ -0,0 +1,142 @@
|
||||
---
|
||||
description: Convertește un PRD markdown în format prd.json pentru loop-ul autonom Ralph. Folosește acest skill când utilizatorul are un PRD generat și vrea să-l convertească pentru execuție autonomă cu Ralph.
|
||||
---
|
||||
|
||||
# Skill: Ralph PRD Converter
|
||||
|
||||
Convertește un PRD markdown existent în format `prd.json` pentru sistemul Ralph de execuție autonomă.
|
||||
|
||||
## Când să folosești acest skill
|
||||
|
||||
- Utilizatorul are deja un PRD markdown generat (în `/tasks/prd-*.md`)
|
||||
- Vrea să pregătească task-urile pentru execuție autonomă cu Ralph
|
||||
- Sau vrea să inițializeze structura Ralph într-un proiect
|
||||
|
||||
## Workflow
|
||||
|
||||
### Pas 1: Verifică PRD-ul existent
|
||||
|
||||
```bash
|
||||
ls tasks/prd-*.md
|
||||
```
|
||||
|
||||
Dacă nu există un PRD, sugerează să folosească skill-ul `/ralph:prd` mai întâi.
|
||||
|
||||
### Pas 2: Citește PRD-ul și extrage user stories
|
||||
|
||||
Citește fișierul PRD și identifică:
|
||||
- Numele proiectului
|
||||
- User stories cu acceptance criteria
|
||||
- Dependențe între stories
|
||||
|
||||
### Pas 3: Creează structura Ralph
|
||||
|
||||
```bash
|
||||
mkdir -p scripts/ralph/logs scripts/ralph/archive
|
||||
```
|
||||
|
||||
### Pas 4: Generează prd.json
|
||||
|
||||
Convertește user stories în format JSON cu următoarea structură:
|
||||
|
||||
```json
|
||||
{
|
||||
"projectName": "feature-name",
|
||||
"branchName": "ralph/feature-name",
|
||||
"description": "Descriere din PRD",
|
||||
"userStories": [
|
||||
{
|
||||
"id": "US-001",
|
||||
"title": "Titlu story",
|
||||
"description": "As a [user], I want [feature] so that [benefit]",
|
||||
"priority": 1,
|
||||
"acceptanceCriteria": [
|
||||
"Criteriu specific și verificabil",
|
||||
"npm run typecheck passes"
|
||||
],
|
||||
"passes": false,
|
||||
"notes": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Pas 5: Validează mărimea stories
|
||||
|
||||
**CRITIC**: Fiecare story trebuie să fie completabil într-un singur context window.
|
||||
|
||||
#### Story de mărime corectă:
|
||||
- Adaugă un câmp în baza de date
|
||||
- Creează un component UI simplu
|
||||
- Adaugă un endpoint API
|
||||
- Scrie tests pentru o funcție specifică
|
||||
|
||||
#### Story prea mare (trebuie spart):
|
||||
- "Implementează autentificarea completă"
|
||||
- "Creează dashboard-ul admin"
|
||||
- "Adaugă sistem de notificări end-to-end"
|
||||
|
||||
Dacă găsești stories prea mari, sparge-le în sub-stories mai mici.
|
||||
|
||||
### Pas 6: Setează prioritățile
|
||||
|
||||
Ordinea recomandată:
|
||||
1. Schema/Database changes (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)
|
||||
|
||||
Stories care depind de altele trebuie să aibă prioritate mai mare (număr mai mare).
|
||||
|
||||
### Pas 7: Verifică acceptance criteria
|
||||
|
||||
Fiecare story TREBUIE să aibă:
|
||||
- Criterii specifice și verificabile (NU vagi ca "funcționează bine")
|
||||
- `npm run typecheck passes` (sau echivalent)
|
||||
- Pentru UI: `Verify in browser that [specific behavior]`
|
||||
|
||||
### Pas 8: Copiază fișierele Ralph
|
||||
|
||||
Dacă nu există deja, copiază template-urile din plugin:
|
||||
- `scripts/ralph/ralph.sh` - scriptul principal (din templates/ralph.sh)
|
||||
- `scripts/ralph/prompt.md` - instrucțiunile per iterație (din templates/prompt.md)
|
||||
|
||||
### Pas 9: Inițializează progress.txt
|
||||
|
||||
```bash
|
||||
echo "# Ralph Progress Log" > scripts/ralph/progress.txt
|
||||
echo "Started: $(date)" >> scripts/ralph/progress.txt
|
||||
echo "Project: [project-name]" >> scripts/ralph/progress.txt
|
||||
echo "---" >> scripts/ralph/progress.txt
|
||||
```
|
||||
|
||||
### Pas 10: Instrucțiuni finale
|
||||
|
||||
După completare, informează utilizatorul:
|
||||
|
||||
```
|
||||
PRD convertit în scripts/ralph/prd.json
|
||||
|
||||
Pentru a rula Ralph:
|
||||
cd [project-directory]
|
||||
./scripts/ralph/ralph.sh [max_iterations]
|
||||
|
||||
Monitorizare:
|
||||
cat scripts/ralph/prd.json | jq '.userStories[] | {id, title, passes}'
|
||||
cat scripts/ralph/progress.txt
|
||||
```
|
||||
|
||||
## Output așteptat
|
||||
|
||||
- `scripts/ralph/prd.json` - task-urile în format JSON
|
||||
- `scripts/ralph/progress.txt` - log inițializat
|
||||
- Structura de directoare completă
|
||||
|
||||
## Reguli importante
|
||||
|
||||
1. **NU începe implementarea** - acest skill doar convertește PRD-ul
|
||||
2. **Validează mărimea stories** - sparge-le dacă sunt prea mari
|
||||
3. **Prioritizează corect** - dependențele trebuie respectate
|
||||
4. **Criterii verificabile** - nu vagi, ci specifice
|
||||
5. **Inițializează `passes: false`** pentru toate stories
|
||||
Reference in New Issue
Block a user