본문으로 건너뛰기
cccskills
무료GitHub에 공개

iterative-retrieval

Structure delegated agent tasks with clear goals, success criteria, and a three-attempt limit. Provides handoff templates and coordinator checks, plus rules for escalating unresolved work and turning research findings into concrete follow-up actions.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Max-3-cycle protocol for agent sub-tasks with WHY context and coordinator validation. Use when spawning sub-agents to complete scoped work.

설치 방법 보기

이럴 때 유용합니다

  • Preparing clear task briefs for sub-agents
  • Checking delegated work against acceptance criteria
  • Retrying incomplete tasks with specific corrections
  • Turning research findings into assigned next steps

포함된 파일(1)

  • SKILL.md6.2 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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

CycleDescriptionExit condition
1Initial attemptDone → coordinator validates. Incomplete → surface delta.
2Targeted retry with specific correctionsDone → coordinator validates. Incomplete → one more.
3Final attempt with all context from cycles 1–2Done 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.

# 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-Patterns

  • Spawning without WHY — agents can't prioritise trade-offs without motivation context.
  • Accepting output without validating — one failed check avoids merging broken work.
  • Cycle 4+ — if 3 cycles haven't converged, the problem is in the requirements, not the agent.
  • Vague success criteria — "looks good" is not a criterion. Use checkboxes.
  • Forwarding WHAT without delta — cycle 2+ prompts must include what cycle 1 got wrong.
  • Creating issues without dedup check — always search before creating.
  • Research without action — delivering analysis with no issue, PR, decision, or assignee is incomplete work.

Examples

Good spawn prompt

## 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.

Bad spawn prompt (don't do this)

Update the coordinator charter with the iterative retrieval stuff.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Coordinate work across AI agents with shared rules for locating team files, recording decisions and their reasons, and requesting help. It also defines who owns revisions after a reviewer rejects an artifact.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Locate team files across separate working directories
  • Record decisions that affect other agents
  • Request input from another specialist
github/gh-aw5.4천2026년 10월 19일 업데이트

Set shared development rules for an agent team: keep specific agent names out of product code, tests, and CI configuration, verify affected tests before finishing, and record lessons learned from mistakes.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Share development rules across multiple agents
  • Keep team-specific agent names out of code and tests
  • Check affected tests before declaring work complete
github/gh-aw5.4천2026년 10월 19일 업데이트

Routes requests to design, create, update, debug, or upgrade GitHub Agentic Workflows to the appropriate instructions. It helps the agent select a workflow-specific procedure and apply any additional rules defined for the repository.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Designing a new workflow through questions
  • Investigating failed runs and recurring errors
  • Upgrading workflows and addressing deprecations
github/gh-aw5.4천2026년 10월 19일 업데이트

Prepare architecture proposals before implementation so the team can agree on a direction. Organize evidence, technical choices, effects on existing work, risks, and the first release’s scope into a document with clear recommendations and decision owners.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Proposing a major architecture change
  • Replanning milestones after a foundation change
  • Comparing technical options before seeking approval
github/gh-aw5.4천2026년 10월 19일 업데이트

Update the gh-aw-firewall version used by gh-aw, rebuild generated files, and review release notes and configuration schemas, which define valid settings. It guides related code and test updates while identifying follow-up work that remains.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Updating the firewall version used by gh-aw
  • Reviewing release notes for integration changes
  • Checking configuration schema differences
github/gh-aw5.4천2026년 10월 19일 업데이트

Review git and gh operations in gh-aw workflows to check credential availability for each repository. Identify missing token handoffs, risky expansions of limited checkouts, and error handling needed where credentials are intentionally unavailable.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Reviewing git operations after repository checkout
  • Checking tokens for private cross-repository access
  • Reviewing sparse and shallow checkout changes
github/gh-aw5.4천2026년 10월 19일 업데이트

github의 스킬 모두 보기

이 스킬의 문제 신고