| type | skill |
| lifecycle | stable |
| inheritance | inheritable |
| name | ralph-loop |
| description | Iterative quality improvement — generate, evaluate, feedback, re-generate until threshold met |
| applyTo | **/*quality*,**/*eval*,**/*iterate*,**/*ralph* |
| domain | Quality Engineering |
| category | Iterative Improvement |
| tier | standard |
| dependencies | ["testing-strategies","code-review"] |
| created | 2026-04-14T00:00:00.000Z |
| author | Alex |
| source | microsoft/skills (Sensei technique by Shayne Boyer) |
| currency | 2026-04-22T00:00:00.000Z |
Ralph Loop — Iterative Quality Improvement
Generate → Evaluate → Feedback → Re-generate until quality threshold met.
Pattern Origin
Inspired by the Sensei iterative quality improvement patterns from GitHub Copilot for Azure:
"LLMs improve dramatically when given structured feedback about what went wrong and specific guidance on how to fix it."
— Shayne Boyer (@spboyer), Microsoft
Core Loop
┌─────────────────────────────────────────────────────────────┐
│ RALPH LOOP │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Generate │────▶│ Evaluate │────▶│ Analyze │ │
│ └─────────┘ └──────────┘ └──────────┘ │
│ ▲ │ │
│ │ ┌──────────────────────┘ │
│ │ ▼ │
│ │ ┌──────────┐ ┌───────────┐ │
│ └────│ Feedback │◀────│ Threshold │ │
│ └──────────┘ │ Met? │ │
│ └───────────┘ │
│ │ Yes │
│ ▼ │
│ ┌────────┐ │
│ │ Done │ │
│ └────────┘ │
└─────────────────────────────────────────────────────────────┘
Configuration
| Parameter | Default | Description |
|---|
maxIterations | 5 | Maximum iterations before stopping |
qualityThreshold | 80 | Score (0-100) to consider quality met |
improvementThreshold | 5 | Minimum improvement required per iteration |
earlyStopOnPerfect | true | Stop immediately when score reaches 100 |
includeFeedback | true | Include feedback in re-generation prompts |
Stop Conditions
- Perfect score — Score reaches 100
- Quality threshold met — Score ≥