Repository navigation
feat(skills): add iterative-retrieval skill -- max-3-cycle agent spawn protocol #622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6a656b0
29ef8c8
511b0f5
c7a4294
9bc2b0b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@bradygaster/squad-cli": minor | ||
| "@bradygaster/squad-sdk": minor | ||
| --- | ||
| feat: add iterative-retrieval skill for structured max-3-cycle agent spawning | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,69 @@ | ||||||
| # Proposal: Iterative Retrieval Skill | ||||||
|
|
||||||
| **Issue:** bradygaster/squad#622 | ||||||
| **Author:** tamirdresher | ||||||
| **Date:** 2026-03-26 | ||||||
| **Status:** Proposal | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Problem Statement | ||||||
|
|
||||||
| Agents that spawn sub-agents or issue retrieval operations have no standardized protocol for | ||||||
| how many cycles are acceptable before escalating. This leads to: | ||||||
| - Unbounded loops when agents keep spawning without convergence | ||||||
| - Missed escalations when 1 cycle is insufficient but the agent gives up | ||||||
| - Inconsistent behavior across coordinators | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Proposed Approach | ||||||
|
|
||||||
| A structured 3-cycle protocol for iterative information retrieval with mandatory checkpoints: | ||||||
|
|
||||||
| **Cycle 1:** Broad scan — identify the domain, key files, and initial findings | ||||||
| **Cycle 2:** Targeted retrieval — follow up on specific gaps identified in Cycle 1 | ||||||
| **Cycle 3 (max):** Final fill — address remaining gaps only. If still incomplete, escalate | ||||||
|
|
||||||
| The skill provides: | ||||||
| - Spawn prompt templates for each cycle (what to include, what to stop) | ||||||
| - A coordinator validation checklist (did previous cycle produce actionable output?) | ||||||
| - Issue deduplication logic (don't spawn for issues already in progress) | ||||||
| - Good/bad example spawn prompts to calibrate agent behavior | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Fit with Existing Architecture | ||||||
|
|
||||||
| - **Complements** error-recovery skill (escalate pattern is the fallback at cycle 3) | ||||||
| - **No code changes** — template-only skill | ||||||
| - **Coordinator-agnostic** — works with any existing Ralph or custom coordinator | ||||||
| - **Consistent with** the 3-round Ralph pattern already used in production | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## What Changes | ||||||
|
|
||||||
| - New skill: packages/squad-cli/templates/skills/iterative-retrieval/SKILL.md | ||||||
| - New skill: packages/squad-sdk/templates/skills/iterative-retrieval/SKILL.md | ||||||
| - New changeset: .changeset/iterative-retrieval-skill.md | ||||||
|
|
||||||
| ## What Stays the Same | ||||||
|
|
||||||
| - No existing skills modified | ||||||
| - No CLI or SDK runtime code changed | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Risks and Mitigations | ||||||
|
|
||||||
| | Risk | Likelihood | Impact | Mitigation | | ||||||
| |------|-----------|--------|------------| | ||||||
| | 3-cycle limit is too restrictive for complex tasks | Low | Medium | Skill explicitly allows coordinator to extend with justification | | ||||||
|
||||||
| | 3-cycle limit is too restrictive for complex tasks | Low | Medium | Skill explicitly allows coordinator to extend with justification | | |
| | 3-cycle limit is too restrictive for complex tasks | Low | Medium | Strict 3-cycle cap; coordinator must escalate or stop at cycle 3 (no extension) | |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,165 @@ | ||||||
| --- | ||||||
| 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." | ||||||
| domain: "agent-coordination" | ||||||
| confidence: "high" | ||||||
| license: MIT | ||||||
|
||||||
| license: MIT | |
| source: "templates/skills/iterative-retrieval" |
Copilot
AI
Mar 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The success-criteria example says the PR should target main, but this repo’s contributing process uses --base dev (CONTRIBUTING.md). Consider changing this to dev or wording it generically as “default branch” so the template matches the project’s workflow.
| - [ ] PR is open targeting main with description matching the issue | |
| - [ ] PR is open targeting dev with description matching the issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most changesets in this repo use an imperative sentence without a
feat:prefix (e.g..changeset/cross-squad-orchestration.md). Consider dropping thefeat:prefix here so the generated changelog stays consistent.