| name | playralph |
| description | PlayRalph - Playwright diagnostic loop for sites/apps |
| user-invocable | true |
| argument-hint | [project|URL] [context] |
| requires | {"capabilities":["playwright"]} |
PlayRalph - Diagnostic loop with Playwright
Nota: Per report client-facing, usa /radar (evoluzione di PlayRalph con report ELI5).
Scenari
| Scenario | Cosa fa | Iterazioni |
|---|
| Bug fix | Issue/bug → branch → fix → verify loop | max 5 |
| Bug verification | Screenshot e documentazione del bug | 1-2 |
| Post-fix validation | Fix gia pushato, verifico che funzioni | 1-2 |
| Post-deploy check | Check generale post-deploy | 1-3 |
| Crisis | Rotto ORA, trova e fixa | max 5 |
Regole inviolabili
- MAI cleanup su staging/dev
- Utenti test sono PERMANENTI
- MAI sed/regex su file PHP/codice
- Verifica FINALE — ultimo screenshot DOPO ogni operazione
Step 0: Parse input e carica progetto
args = "$ARGUMENTS".strip()
Step 1: Scenario detection
context_lower = context.lower()
if any(w in context_lower for w in ["non funziona", "rotto", "errore", "500", "bug", "fix"]):
scenario = "bugfix"
elif any(w in context_lower for w in ["verifica bug", "documenta", "screenshot del bug"]):
scenario = "verification"
elif any(w in context_lower for w in ["post-fix", "ho fixato", "ho pushato"]):
scenario = "postfix"
elif any(w in context_lower for w in ["deploy", "post-deploy"]):
scenario = "postdeploy"
elif any(w in context_lower for w in ["down", "crash", "urgente", "crisis"]):
scenario = "crisis"
else:
scenario = None
Step 2: Auth autonoma
Ordine: radar_auth_cmd → credenziali esplicite → artisan tinker → wp-cli → DB diretto → chiedi a Giobi
Laravel
ssh {server} "cd {path} && php artisan tinker --execute=\"...magic link...\""
WordPress
ssh {server} "cd {path} && wp user update {email} --user_pass=RadarTemp$(date +%s)!"
Timeout
domcontentloaded (non networkidle)
- Timeout 60s
asyncio.sleep(3) dopo ogni navigazione
Step 3: Analisi log
ssh {server} "grep 'local.ERROR' {path}/storage/logs/laravel-$(date +%Y-%m-%d).log | tail -5"
ssh {server} "tail -20 {path}/wp-content/debug.log"
Step 4: Report
Report HTML su public/playralph/{project}/{slug}/
Discord notifiche start/end.
Escalation
Se dopo 2 tentativi non si risolve → proponi PlayRalph in background (max 20 iterazioni).
Args Provided:
$ARGUMENTS