# Iterate

Use when the workflow needs to self-correct, improve over time, or establish feedback...

- Repository: https://github.com/sharpdeveye/maestro (592 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-04-29
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add sharpdeveye/maestro --skill iterate -g -a claude-code -y`
Codex: `npx skills add sharpdeveye/maestro --skill iterate -g -a codex -y`
Cursor: `npx skills add sharpdeveye/maestro --skill iterate -g -a cursor -y`
Gemini CLI: `npx skills add sharpdeveye/maestro --skill iterate -g -a gemini-cli -y`

## Description

Use when the workflow needs to self-correct, improve over time, or establish feedback loops and evaluation cycles.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

## MANDATORY PREPARATION

Invoke /agent-workflow, it contains workflow principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding, if no workflow context exists yet, you MUST run /teach-maestro first.

Consult the feedback-loops reference in the agent-workflow skill for evaluation patterns and self-correction strategies.

---

Set up feedback loops that make workflows self-correcting and continuously improving. Iteration transforms one-shot gambles into convergent, reliable systems.

### Feedback Loop Design

### Step 1: Define Quality Criteria

What does "good output" look like? Score dimensions:

| Dimension | Weight | Threshold | Measurement |
|-----------|--------|-----------|-------------|
| Accuracy | 0.4 | ≥ 0.8 | Factual correctness check |
| Completeness | 0.3 | ≥ 0.7 | Required fields present |
| Format | 0.2 | ≥ 0.9 | Schema compliance |
| Tone | 0.1 | ≥ 0.6 | Appropriate for audience |

### Step 2: Choose Evaluator Type

Match evaluator to requirements:

- **Rule-based**: Schema validation, field presence, value ranges (fast, free)
- **Self-check**: Same model evaluates own output (fast, cheap, less reliable)
- **Cross-model**: Different model evaluates (slower, more reliable)
- **Human-in-the-loop**: Human review (slowest, most reliable, doesn't scale)
- **Hybrid**: Rules first, then model check for what rules can't catch

### Step 3: Design the Correction Loop

```text
generate(input) → evaluate(output) → score
  if score ≥ threshold → return output
  if score < threshold AND attempts < max →
    enrich input with evaluator feedback
    generate again (with feedback)
  if attempts ≥ max → fallback or escalate
```

**Critical**: The retry input MUST be different from the original. Include:

- The evaluator's specific feedback
- What was wrong and why
- A suggestion for how to fix it

### Step 4: Set Up Regression Detection

When changing prompts, models, or tools:

The rest: https://github.com/sharpdeveye/maestro/blob/HEAD/source/skills/iterate/SKILL.md
