Ralph - Boucle itérative avec vérification

VérifiéSûr

Boucle auto-référentielle pour itérer sur des tâches jusqu'à leur achèvement, avec vérification par un architecte. Inclut un mode PRD optionnel pour décomposer les projets en user stories et un mode ultrawork pour une exécution parallèle avec routage intelligent des modèles.

Spar Skills Guide Bot
DeveloppementAvancé
02/06/2026
Claude Code
#ralph#iterative-loop#parallel-execution#agent-routing#task-completion

Recommandé pour

Synthèse automatique

Ralph est une boucle auto-référentielle qui répète une tâche jusqu'à son achèvement, avec vérification architecte et exécution parallèle.

Points forts

  • Boucle persistante assurant la complétion
  • Mode PRD pour décomposer les tâches complexes
  • Routage intelligent des agents selon la complexité
  • Exécution parallèle pour maximiser l'efficacité

Limites

  • Nécessite une configuration initiale des agents et fichiers
  • Peut consommer beaucoup de tokens en boucle
  • Dépend de la fiabilité des agents externes
Quand l'utiliser

Pour des tâches complexes et itératives nécessitant une décomposition et une exécution parallèle avec vérification.

Quand l'éviter

Pour des tâches simples et uniques pouvant être réalisées en une seule étape sans itération.

Analyse de sécurité

Sûr
Score qualité85/100

The skill is an instruction file for task management and verification using agent tools; it does not contain any commands or instructions for destructive actions, exfiltration, or obfuscation. It uses standard development commands (npm install, etc.) in a legitimate context.

Aucun point d'attention détecté

Comment cette analyse est faite

Exemples

Build a Todo App with PRD
--prd build a todo app with React and TypeScript
Debug Race Condition
ralph debug the race condition in the auth module and fix it
Refactor with Iteration
ralph refactor the legacy payment service to use the new gateway API

name: ralph description: Self-referential loop until task completion with architect verification

Ralph Skill

[RALPH + ULTRAWORK - ITERATION {{ITERATION}}/{{MAX}}]

Your previous attempt did not output the completion promise. Continue working on the task.

PRD MODE (OPTIONAL)

If the user provides the --prd flag, initialize a PRD (Product Requirements Document) BEFORE starting the ralph loop.

Detecting PRD Mode

Check if {{PROMPT}} contains the flag pattern: --prd or --PRD

PRD Initialization Workflow

When --prd flag detected:

  1. Create PRD File Structure (.omc/prd.json and .omc/progress.txt)
  2. Parse the task (everything after --prd flag)
  3. Break down into user stories with this structure:
{
  "project": "[Project Name]",
  "branchName": "ralph/[feature-name]",
  "description": "[Feature description]",
  "userStories": [
    {
      "id": "US-001",
      "title": "[Short title]",
      "description": "As a [user], I want to [action] so that [benefit].",
      "acceptanceCriteria": ["Criterion 1", "Typecheck passes"],
      "priority": 1,
      "passes": false
    }
  ]
}
  1. Create progress.txt:
# Ralph Progress Log
Started: [ISO timestamp]

## Codebase Patterns
(No patterns discovered yet)

---
  1. Guidelines for PRD creation:

    • Right-sized stories: Each completable in one focused session
    • Verifiable criteria: Include "Typecheck passes", "Tests pass"
    • Independent stories: Minimize dependencies
    • Priority order: Foundational work (DB, types) before UI
  2. After PRD created: Proceed to normal ralph loop execution using the user stories as your task list

Example Usage

User input: --prd build a todo app with React and TypeScript

Your workflow:

  1. Detect --prd flag
  2. Extract task: "build a todo app with React and TypeScript"
  3. Create .omc/prd.json with user stories
  4. Create .omc/progress.txt
  5. Begin ralph loop using user stories as task breakdown

ULTRAWORK MODE (AUTO-ACTIVATED)

Ralph is a persistence wrapper that includes Ultrawork as a component for maximum parallel execution. You MUST follow these rules:

Parallel Execution Rules

  • PARALLEL: Fire independent calls simultaneously - NEVER wait sequentially
  • BACKGROUND FIRST: Use Task(run_in_background=true) for long operations (10+ concurrent)
  • DELEGATE: Route tasks to specialist agents immediately

Smart Model Routing (SAVE TOKENS)

| Task Complexity | Tier | Examples | |-----------------|------|----------| | Simple lookups | LOW (haiku) | "What does this function return?", "Find where X is defined" | | Standard work | MEDIUM (sonnet) | "Add error handling", "Implement this feature" | | Complex analysis | HIGH (opus) | "Debug this race condition", "Refactor auth module" |

Available Agents by Tier

FIRST ACTION: Before delegating any work, read the agent reference file:

Read file: docs/shared/agent-tiers.md

This provides the complete agent tier matrix, MCP tool assignments, and selection guidance.

CRITICAL: Always pass model parameter explicitly!

Task(subagent_type="oh-my-gemini:architect-low", model="gemini-flash-latest", prompt="...")
Task(subagent_type="oh-my-gemini:executor", model="gemini-pro-latest", prompt="...")
Task(subagent_type="oh-my-gemini:architect", model="gemini-pro-latest", prompt="...")

Background Execution Rules

Run in Background (set run_in_background: true):

  • Package installation (npm install, pip install, cargo build, etc.)
  • Build processes (project build command, make, etc.)
  • Test suites (project test command, etc.)
  • Docker operations: docker build, docker pull

Run Blocking (foreground):

  • Quick status checks: git status, ls, pwd
  • File reads, edits
  • Simple commands

COMPLETION REQUIREMENTS

Before claiming completion, you MUST:

  1. Verify ALL requirements from the original task are met
  2. Ensure no partial implementations
  3. Check that code compiles/runs without errors
  4. Verify tests pass (if applicable)
  5. TODO LIST: Zero pending/in_progress tasks

VERIFICATION BEFORE COMPLETION (IRON LAW)

NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE

Before outputting the completion promise:

Steps (MANDATORY)

  1. IDENTIFY: What command proves the task is complete?
  2. RUN: Execute verification (test, build, lint)
  3. READ: Check output - did it actually pass?
  4. ONLY THEN: Proceed to Architect verification

Red Flags (STOP and verify)

  • Using "should", "probably", "seems to"
  • About to output completion without fresh evidence
  • Expressing satisfaction before verification

Evidence Chain

  1. Fresh test run output showing pass
  2. Fresh build output showing success
  3. lsp_diagnostics showing 0 errors
  4. THEN Architect verification
  5. THEN completion promise

Skipping verification = Task NOT complete

VERIFICATION PROTOCOL (TIERED)

Ralph uses tiered verification to save tokens while maintaining quality.

Verification Tier Selection

Before spawning architect for verification, determine the appropriate tier:

| Change Profile | Tier | Agent | |----------------|------|-------| | <5 files, <100 lines, full tests | LIGHT | architect-low (haiku) | | Standard changes | STANDARD | architect-medium (sonnet) | | >20 files, security/architectural | THOROUGH | architect (opus) |

Ralph Minimum Verification Tier

Floor: STANDARD (architect-medium / sonnet)

Even for small changes (<5 files), ralph requires at least STANDARD tier verification. The LIGHT tier (haiku) is insufficient for ralph's completion guarantee. When tier selection returns LIGHT, upgrade to STANDARD.

Verification Flow

  1. Collect change metadata: Count files, lines, detect security/architectural patterns
  2. Select tier: Apply rules from /docs/shared/verification-tiers.md
  3. Spawn appropriate architect:
    // LIGHT - small, well-tested changes
    Task(subagent_type="oh-my-gemini:architect-low", model="gemini-flash-latest", prompt="Quick verification: [describe changes]")
    
    // STANDARD - most changes
    Task(subagent_type="oh-my-gemini:architect-medium", model="gemini-pro-latest", prompt="Verify implementation: [describe changes]")
    
    // THOROUGH - large/security/architectural changes
    Task(subagent_type="oh-my-gemini:architect", model="gemini-pro-latest", prompt="Full verification: [describe changes]")
    
  4. Wait for verdict
  5. If approved: Run /oh-my-gemini:cancel to cleanly exit
  6. If rejected: Fix issues and re-verify (same tier)

For complete tier selection rules, read: docs/shared/verification-tiers.md

ZERO TOLERANCE

  • NO Scope Reduction - deliver FULL implementation
  • NO Partial Completion - finish 100%
  • NO Premature Stopping - ALL TODOs must be complete
  • NO TEST DELETION - fix code, not tests

STATE CLEANUP ON COMPLETION

IMPORTANT: Use the cancel skill for proper state cleanup

When work is complete and Architect verification passes, run /oh-my-gemini:cancel to cleanly exit ralph mode. This handles:

  • Deletion of ralph state files (both local and global)
  • Cleanup of linked ultrawork or ecomode state
  • Proper termination of the ralph loop

This ensures clean state for future sessions without leaving stale state files behind.

INSTRUCTIONS

  • Review your progress so far
  • Continue from where you left off
  • Use parallel execution and background tasks
  • When FULLY complete AND Architect verified: Run /oh-my-gemini:cancel to cleanly exit and clean up all state files
  • Do not stop until the task is truly done

Original task: {{PROMPT}}

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/ralph-self-referential-iteration-with-verification-mmio71lf/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/ralph-self-referential-iteration-with-verification-mmio71lf' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/ralph-self-referential-iteration-with-verification-mmio71lf/download' --output '.skill-downloads/ralph-self-referential-iteration-with-verification-mmio71lf/SKILL.md.part' && mv '.skill-downloads/ralph-self-referential-iteration-with-verification-mmio71lf/SKILL.md.part' '.skill-downloads/ralph-self-referential-iteration-with-verification-mmio71lf/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

Claude Code
test -f '.skill-downloads/ralph-self-referential-iteration-with-verification-mmio71lf/SKILL.md' && test -s '.skill-downloads/ralph-self-referential-iteration-with-verification-mmio71lf/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/ralph' && cp -R '.skill-downloads/ralph-self-referential-iteration-with-verification-mmio71lf' '.claude/skills/ralph'

OpenSkills

OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/ralph-self-referential-iteration-with-verification-mmio71lf'

openskills read 'ralph-self-referential-iteration-with-verification-mmio71lf'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/ralph-self-referential-iteration-with-verification-mmio71lf/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires