Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Max-3-cycle protocol for agent sub-tasks with WHY context and coordinator validation. Use when spawning sub-agents to complete scoped work.
.claude/skills/github-iterative-retrieval/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 21% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 301% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 20% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 15% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 42% | 0% |
Squad agents frequently spawn sub-agents to complete scoped work. Without structure, these handoffs become vague, cycles multiply, and outputs land without being checked. The Iterative Retrieval Pattern caps cycles at 3, mandates WHY context in every spawn, and requires the coordinator to validate agent output before closing an issue.
Every agent spawn must include the following four sections. Copy and fill in the template:
## Task
{What you need done — concrete and bounded}
## WHY this matters
{The motivation and context. What system or user goal does this serve? What breaks if skipped?}
## Success criteria
{How you will know the output is correct. Be explicit — list acceptance criteria, not vibes.}
Example:
- [ ] File X exists and contains Y
- [ ] No regressions in existing tests
- [ ] PR is open targeting main with description matching the issue
## Escalation path
{What the agent should do if uncertain or stuck. "Stop and ask me" is valid.}
Example:
- If requirements are ambiguous → stop, comment on the issue, set label status:needs-decision
- If blocked by a dependency → label status:blocked, explain in a comment
- If 3 cycles exhausted without resolution → write a summary to inbox and surface to coordinator| Cycle | Description | Exit condition | |-------|-------------|----------------| | 1 | Initial attempt | Done → coordinator validates. Incomplete → surface delta. | | 2 | Targeted retry with specific corrections | Done → coordinator validates. Incomplete → one more. | | 3 | Final attempt with all context from cycles 1–2 | Done or escalate — no cycle 4. |
before accepting it or spawning the next cycle.
and what is still missing — not just a repeat of the original task.
.squad/decisions/inbox/, label theissue status:needs-decision, and notify the user.
Before accepting agent output and closing an issue, the coordinator must check:
If any item fails → do not accept. Spawn cycle N+1 (up to cycle 3) with specific deltas.
Retry (cycle N+1) when:
Escalate when:
Before any agent creates a GitHub issue, it must search for existing open issues to avoid duplicates.
bash# Check for existing open issues before creating a new one gh issue list --search "<keywords from your issue title>" --state open
Every research or analysis task completed under this protocol MUST end with at least one concrete action before the cycle is closed. Acceptable follow-up actions:
.squad/decisions/inbox/Pure analysis reports without actionable follow-up will be rejected during triage. If no action is warranted, the agent must explicitly state why and get coordinator sign-off.
## Task
Add an "Iterative Retrieval Protocol" section to `.squad/agents/coordinator/charter.md` explaining
the 3-cycle rule, WHY format, and validation checklist.
## WHY this matters
The coordinator spawns sub-agents on every round. Without a documented protocol, agents run unbounded
cycles and outputs go unvalidated — leading to stale issues and silent failures.
## Success criteria
- [ ] Section "Iterative Retrieval Protocol" exists in charter.md
- [ ] Section documents max-3-cycles rule
- [ ] Section documents WHY format requirement
- [ ] Section contains validation checklist (at least 4 items)
- [ ] No other sections of charter.md are modified
## Escalation path
If the charter.md format is unclear, check another agent charter as a reference.
If uncertain about content, stop and surface to coordinator.Update the coordinator charter with the iterative retrieval stuff.| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 15,134 | 9,704 | -36% | 1 | 1 | 0% | 2,359 | 2,856 | +21% | 0 | 0 | — |
case-02 | fail→pass | 7,922 | 12,712 | +60% | 1 | 1 | 0% | 848 | 3,397 | +301% | 0 | 0 | — |
case-03 | fail→pass | 15,669 | 8,707 | -44% | 1 | 1 | 0% | 2,234 | 2,685 | +20% | 0 | 0 | — |
case-04 | fail→pass | 15,065 | 8,734 | -42% | 1 | 1 | 0% | 2,415 | 2,782 | +15% | 0 | 0 | — |
case-05 | fail→pass | 14,595 | 8,439 | -42% | 1 | 1 | 0% | 1,860 | 2,632 | +42% | 0 | 0 | — |
case-06 | fail→pass | 29,299 | 9,845 | -66% | 1 | 1 | 0% | 996 | 2,725 | +174% | 0 | 0 | — |
case-07 | pass→pass | 25,132 | 9,664 | -62% | 1 | 1 | 0% | 1,675 | 2,823 | +69% | 0 | 0 | — |
case-08 | fail→pass | 21,330 | 6,506 | -69% | 1 | 1 | 0% | 1,990 | 2,387 | +20% | 0 | 0 | — |
case-09 | pass→pass | 9,758 | 7,508 | -23% | 1 | 1 | 0% | 1,356 | 2,206 | +63% | 0 | 0 | — |
case-10 | pass→pass | 7,113 | 6,629 | -7% | 1 | 1 | 0% | 842 | 2,334 | +177% | 0 | 0 | — |
case-11 | fail→pass | 9,927 | 5,663 | -43% | 1 | 1 | 0% | 1,388 | 2,228 | +61% | 0 | 0 | — |
case-12 | fail→pass | 10,538 | 5,296 | -50% | 1 | 1 | 0% | 1,660 | 2,048 | +23% | 0 | 0 | — |
case-13 | fail→fail | 5,481 | 3,922 | -28% | 1 | 1 | 0% | 754 | 1,735 | +130% | 0 | 0 | — |
case-14 | pass→pass | 10,412 | 6,178 | -41% | 1 | 1 | 0% | 1,673 | 2,389 | +43% | 0 | 0 | — |
case-15 | fail→pass | 12,979 | 6,386 | -51% | 1 | 1 | 0% | 1,876 | 2,316 | +23% | 0 | 0 | — |
case-16 | fail→fail | 6,696 | 6,441 | -4% | 1 | 1 | 0% | 982 | 2,404 | +145% | 0 | 0 | — |
case-17 | fail→pass | 16,737 | 11,982 | -28% | 1 | 1 | 0% | 2,218 | 3,111 | +40% | 0 | 0 | — |
case-18 | pass→pass | 13,151 | 9,568 | -27% | 1 | 1 | 0% | 2,108 | 2,728 | +29% | 0 | 0 | — |
case-19 | pass→pass | 6,260 | 6,429 | +3% | 1 | 1 | 0% | 1,057 | 2,503 | +137% | 0 | 0 | — |
case-20 | pass→pass | 12,852 | 13,174 | +3% | 1 | 1 | 0% | 1,927 | 3,367 | +75% | 0 | 0 | — |
case-21 | pass→pass | 12,969 | 22,770 | +76% | 1 | 1 | 0% | 2,188 | 3,585 | +64% | 0 | 0 | — |
case-22 | pass→pass | 17,057 | 20,156 | +18% | 1 | 1 | 0% | 1,281 | 2,610 | +104% | 0 | 0 | — |
case-23 | fail→pass | 8,343 | 6,881 | -18% | 1 | 1 | 0% | 1,112 | 1,945 | +75% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 21 counted toward the lift figure. The other 2 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +52 percentage points is the difference between those two pass rates over the 21 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.