iterative-retrieval
Max-3-cycle protocol for agent sub-tasks with WHY context and coordinator validation.
Skill by microsoftOfficial
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/microsoft-iterative-retrieval
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/iterative-retrieval
What's inside
- Skill name
iterative-retrieval- Description
- Max-3-cycle protocol for agent sub-tasks with WHY context and coordinator validation. Use when spawning sub-agents to complete scoped work.
- License
- MIT
- Instructions
- 159 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Iterative Retrieval Skill
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.
---
## Spawn Prompt Template
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
```
---
## 3-Cycle Protocol
| 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. |
### Rules
1. **After each cycle**, the coordinator evaluates the output against the success criteria
before accepting it or spawning the next cycle.
2. **Objective context forward**: each subsequent spawn includes a summary of what was tried
and what is still missing — not just a repeat of the original task.
3. **Cycle 3 exhausted** → escalate: write a summary to `.squad/decisions/inbox/`, label the
issue `status:needs-decision`, and notify the user.
---
## Coordinator Validation Checklist
Before accepting agent output and closing an issue, the coordinator must check:
- [ ] All success criteria from the spawn prompt are met
- [ ] PR exists and description matches the issue (if code work)
- [ ] No obvious regressions (grep for TODO/FIXME introduced, build passes)
- [ ] Agent did not silently skip parts of the task
- [ ] If the agent reported uncertainty — was it resolved or escalated?
If any item fails → do **not** accept. Spawn cycle N+1 (up to cycle 3) with specific deltas.
---
## When to Escalate vs Retry
**Retry (cycle N+1)** when:
- Output is structurally correct but missing specific items
- Agent misunderstood scope (provide more context and re-run)
- Partial success — clearly identified remaining delta
**Escalate** when:
- Requirements are fundamentally unclear (decision needed)
- 3 cycles complete without convergence
- Agent returned conflicting results across cycles
- Task requires elevated permissions or external action
- The work depends on another issue that isn't done yet
---
## Issue Dedup Check (Mandatory)
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
```
- If an open issue already covers the same problem → **comment on it** instead of creating a new one.
- If no duplicate → proceed to create the issue.
- Use 2–3 representative keywords from the planned issue title as the search query.
---
## Mandatory Output Requirement (Research-Then-Execute)
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:
- GitHub issue created documenting the findings and next steps
- PR opened implementing a recommendation
- Decision recorded in `.squad/decisions/inbox/`
- Documented recommendation with a named assignee and due date
**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.
---
## Anti-PatternsFrom microsoft/waza, MIT.
More from microsoft/waza
- 0.827score
waza-runner
spboyerOfficial
Run evaluations on Agent Skills to measure their effectiveness.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.825score
azd-publish
spboyerOfficial
Prepare and publish a new version of the waza azd extension.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.687score
waza-interactive
microsoftOfficial
Interactive workflow partner for creating, testing, and improving AI agent skills with waza.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.687score
code-explainer
microsoftOfficial
**UTILITY SKILL** - Explain code snippets, functions, and algorithms in plain language.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.687score
coordinator-source-of-truth
microsoftOfficial
The complete file-by-file source-of-truth hierarchy for Squad: which files are authoritative, which are derived/append-only, who may write each one, who may…
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.687score
coordinator-init-mode
microsoftOfficial
The complete two-phase Init Mode protocol the Squad coordinator runs when no team exists yet in the current repo.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.687score
coordinator-response-mode
microsoftOfficial
Selecting WHO handles work is the Routing table; selecting HOW they handle it (Direct, Lightweight, Standard, Full) is Response Mode.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.687score
waza
microsoftOfficial
**WORKFLOW SKILL** - Evaluate AI agent skills using structured benchmarks with YAML specs, fixture isolation, and pluggable validators.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.687score
squad-commands
microsoftOfficial
Categorized catalog of common Squad operations.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.687score
squad
microsoftOfficial
Squad's command catalog and interactive menu.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.687score
cross-squad
microsoftOfficial
Coordinating work across multiple Squad instances — discovery, delegation, and disambiguation when the user says 'squad' (the product) vs casual English…
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.684score
code-explainer
microsoftOfficial
Explains code snippets in plain English, breaking down what the code does step by step.
SkillAFreshness: A★ 1.4KClaude Code +9
Signals
- Stars
- 1,427
- Forks
- 92
- Open issues
- 5
- Last commit (this folder)
- Oct 16, 2026 (11 days ago)
- Last release
- Oct 20, 2026 (7 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/microsoft/waza
- Website
- microsoft.github.io/waza/
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from microsoft
- 0.714score
skillopt-sleep
microsoftOfficial
Reference-only OpenClaw adaptation of SkillOpt-Sleep.
SkillAFreshness: A★ 18.7KClaude Code +9 - 0.707score
Playwright MCP
microsoftOfficial
Playwright Tools.
ConnectorAFreshness: ALocal★ 38.6KClaude Code +5 - 0.687score
squad
microsoftOfficial
Squad's command catalog and interactive menu.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.687score
coordinator-response-mode
microsoftOfficial
Selecting WHO handles work is the Routing table; selecting HOW they handle it (Direct, Lightweight, Standard, Full) is Response Mode.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.687score
coordinator-source-of-truth
microsoftOfficial
The complete file-by-file source-of-truth hierarchy for Squad: which files are authoritative, which are derived/append-only, who may write each one, who may…
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.687score
squad-commands
microsoftOfficial
Categorized catalog of common Squad operations.
SkillAFreshness: A★ 1.4KClaude Code +9
Cite this page
iterative-retrieval skill. Agent Mart. https://agentmart.dev/skills/microsoft-iterative-retrieval (last updated 2026-10-24)