Agent skill · research science · affaan-m
iterative-retrieval
Pattern for progressively refining context retrieval to solve the subagent context problem
Why this skill is useful
Provides a structured 4-stage iterative retrieval process that enhances context gathering for subagents, which the AI wouldn't generate on its own.
What it needs
About 2k tokens when loaded. Last updated 2026-08-06. 238,342 stars on the source repository.
What this skill does
迭代檢索模式 解決多 agent 工作流程中的「上下文問題」,其中子 agents 在開始工作之前不知道需要什麼上下文。 問題 子 agents 以有限上下文產生。它們不知道: 哪些檔案包含相關程式碼 程式碼庫中存在什麼模式 專案使用什麼術語 標準方法失敗: 傳送所有內容:超過上下文限制 不傳送內容:Agent 缺乏關鍵資訊 猜測需要什麼:經常錯誤 解決方案:迭代檢索 一個漸進精煉上下文的 4 階段循環: 階段 1:DISPATCH 初始廣泛查詢以收集候選檔案: 階段 2:EVALUATE 評估檢索內容的相關性: 評分標準: 高(0.8-1.0):直接實作目標功能 中(0.5-0.7):包含相關模式或類型 低(0.2-0.4):間接相關 無(0-0.2):不相關,排除 階段 3:REFINE 基於評估更新搜尋標準: 階段 4:LOOP 以精煉標準重複(最多 3 個循環): 實際範例 範例 1:Bug 修復上下文 範例 2:功能實作 與 Agents 整合 在 agent 提示中使用: 最佳實務 1. 從廣泛開始,逐漸縮小 - 不要過度指定初始查詢 2. 學習程式碼庫術語 - 第一個循環通常會揭示命名慣例 3. 追蹤缺失內容 - 明確的缺口識別驅動精煉 4. 在「足夠好」時停止 - 3 個高相關性檔案勝過 10 個普通檔案 5. 自信地排除 - 低相關性檔案不會變得相關 相關 Longform Guide - 子 agent 協調章節 continuous-learning 技能 - 用於隨時間改進的模式 ~/.claude/agents/ 中的 Agent 定義
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills affaan-m/iterative-retrieval--c9c06c