Best fit
- Pattern for progressively refining context retrieval to solve the subagent context problem
affaan-m/ECC
Pattern for progressively refining context retrieval to solve the subagent context problem
npx skills add https://github.com/affaan-m/ECC --skill "docs/zh-TW/skills/iterative-retrieval"Source checked Jul 28, 2026·Refresh due Oct 26, 2026
Reorganized from the pinned upstream SKILL.md
According to the pinned SKILL.md from affaan-m/ECC: 解決多 agent 工作流程中的「上下文問題」,其中子 agents 在開始工作之前不知道需要什麼上下文。
npx skills add https://github.com/affaan-m/ECC --skill "docs/zh-TW/skills/iterative-retrieval"Best fit
Bring this context
Expected outputs
Key source sections
Sections are extracted automatically from the pinned SKILL.md and link back to the source.
子 agents 以有限上下文產生。它們不知道: - 哪些檔案包含相關程式碼 - 程式碼庫中存在什麼模式 - 專案使用什麼術語
評分標準: - 高(0.8-1.0):直接實作目標功能 - 中(0.5-0.7):包含相關模式或類型 - 低(0.2-0.4):間接相關 - 無(0-0.2):不相關,排除
Review the “階段 1:DISPATCH” section in the pinned source before continuing.
評分標準: - 高(0.8-1.0):直接實作目標功能 - 中(0.5-0.7):包含相關模式或類型 - 低(0.2-0.4):間接相關 - 無(0-0.2):不相關,排除
Review the “階段 3:REFINE” section in the pinned source before continuing.
SkillSignal prompt templates
These prompts were written by SkillSignal from the source structure; they are not upstream text.
Task-start prompt
Confirm source fit, inputs, and outputs before acting.
Use iterative-retrieval to help me with: [specific task]. Context: [files, data, or background]. Constraints: [environment, scope, and prohibited actions]. Before acting, check the pinned SKILL.md and explain which sections apply, what inputs are still missing, and what you will deliver.
Source-guided execution
Make the Agent explicitly follow the key extracted sections.
Apply the pinned iterative-retrieval source to [task]. Pay particular attention to these source sections: “問題”, “解決方案:迭代檢索”, “階段 1:DISPATCH”, “階段 2:EVALUATE”, “階段 3:REFINE”. Preserve the important decision at each step. Mark facts not covered by the source as “needs confirmation” instead of inventing them. Then verify the result against my acceptance criteria: [criteria].
Result-review prompt
Check omissions, permissions, and source drift before delivery.
Review the current iterative-retrieval result: (1) does it satisfy the original task; (2) were any applicable steps or limits in the pinned SKILL.md missed; (3) did it perform any unauthorized file, command, network, or data action; and (4) which conclusions remain unverified? List issues first, then fix only what the source or user authorization supports.
Output checklist
The task matches the purpose documented in the SKILL.md.
The source section “問題” has been checked.
The source section “解決方案:迭代檢索” has been checked.
The source section “階段 1:DISPATCH” has been checked.
The source section “階段 2:EVALUATE” has been checked.
Inputs, constraints, and acceptance criteria are explicit.
Unverified facts, compatibility, and outcome claims are clearly marked.
Any file, command, network, or data action has been reviewed.
Choose a different workflow
Pattern for progressively refining context retrieval to solve the subagent context problem
A separate implementation from affaan-m/ECC; compare its source, maintenance signals, and permission requirements.
Open source detail서브에이전트 컨텍스트 문제를 해결하기 위한 점진적 컨텍스트 검색 개선 패턴
A separate implementation from affaan-m/ECC; compare its source, maintenance signals, and permission requirements.
Open source detailサブエージェントのコンテキスト問題を解決するために、コンテキスト取得を段階的に洗練するパターン
A separate implementation from affaan-m/ECC; compare its source, maintenance signals, and permission requirements.
Open source detailFAQ
解決多 agent 工作流程中的「上下文問題」,其中子 agents 在開始工作之前不知道需要什麼上下文。
The catalog detected this source-specific install command: npx skills add https://github.com/affaan-m/ECC --skill "docs/zh-TW/skills/iterative-retrieval". Inspect the command and pinned source before running it.
No dedicated Agent platform is declared in the pinned source record.
Quality breakdown
Based on traceable docs and repository signals; stars are not treated as quality.
Compare before choosing
These links are selected from shared tasks, functions, stacks, platforms, and same-name variants. Compare the source owner, documentation, permissions, and maintenance signals.
Pattern for progressively refining context retrieval to solve the subagent context problem
서브에이전트 컨텍스트 문제를 해결하기 위한 점진적 컨텍스트 검색 개선 패턴
サブエージェントのコンテキスト問題を解決するために、コンテキスト取得を段階的に洗練するパターン
逐步优化上下文检索以解决子代理上下文问题的模式
When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program
解決多 agent 工作流程中的「上下文問題」,其中子 agents 在開始工作之前不知道需要什麼上下文。
子 agents 以有限上下文產生。它們不知道:
標準方法失敗:
一個漸進精煉上下文的 4 階段循環:
┌─────────────────────────────────────────────┐
│ │
│ ┌──────────┐ ┌──────────┐ │
│ │ DISPATCH │─────│ EVALUATE │ │
│ └──────────┘ └──────────┘ │
│ ▲ │ │
│ │ ▼ │
│ ┌──────────┐ ┌──────────┐ │
│ │ LOOP │─────│ REFINE │ │
│ └──────────┘ └──────────┘ │
│ │
│ 最多 3 個循環,然後繼續 │
└─────────────────────────────────────────────┘
初始廣泛查詢以收集候選檔案:
// 從高層意圖開始
const initialQuery = {
patterns: ['src/**/*.ts', 'lib/**/*.ts'],
keywords: ['authentication', 'user', 'session'],
excludes: ['*.test.ts', '*.spec.ts']
};
// 派遣到檢索 agent
const candidates = await retrieveFiles(initialQuery);
評估檢索內容的相關性:
function evaluateRelevance(files, task) {
return files.map(file => ({
path: file.path,
relevance: scoreRelevance(file.content, task),
reason: explainRelevance(file.content, task),
missingContext: identifyGaps(file.content, task)
}));
}
評分標準:
基於評估更新搜尋標準:
function refineQuery(evaluation, previousQuery) {
return {
// 新增在高相關性檔案中發現的新模式
patterns: [...previousQuery.patterns, ...extractPatterns(evaluation)],
// 新增在程式碼庫中找到的術語
keywords: [...previousQuery.keywords, ...extractKeywords(evaluation)],
// 排除確認不相關的路徑
excludes: [...previousQuery.excludes, ...evaluation
.filter(e => e.relevance < 0.2)
.map(e => e.path)
],
// 針對特定缺口
focusAreas: evaluation
.flatMap(e => e.missingContext)
.filter(unique)
};
}
以精煉標準重複(最多 3 個循環):
async function iterativeRetrieve(task, maxCycles = 3) {
let query = createInitialQuery(task);
let bestContext = [];
for (let cycle = 0; cycle < maxCycles; cycle++) {
const candidates = await retrieveFiles(query);
const evaluation = evaluateRelevance(candidates, task);
// 檢查是否有足夠上下文
const highRelevance = evaluation.filter(e => e.relevance >= 0.7);
if (highRelevance.length >= 3 && !hasCriticalGaps(evaluation)) {
return highRelevance;
}
// 精煉並繼續
query = refineQuery(evaluation, query);
bestContext = mergeContext(bestContext, highRelevance);
}
return bestContext;
}
任務:「修復認證 token 過期 bug」
循環 1:
DISPATCH:在 src/** 搜尋 "token"、"auth"、"expiry"
EVALUATE:找到 auth.ts (0.9)、tokens.ts (0.8)、user.ts (0.3)
REFINE:新增 "refresh"、"jwt" 關鍵字;排除 user.ts
循環 2:
DISPATCH:搜尋精煉術語
EVALUATE:找到 session-manager.ts (0.95)、jwt-utils.ts (0.85)
REFINE:足夠上下文(2 個高相關性檔案)
結果:auth.ts、tokens.ts、session-manager.ts、jwt-utils.ts
任務:「為 API 端點增加速率限制」
循環 1:
DISPATCH:在 routes/** 搜尋 "rate"、"limit"、"api"
EVALUATE:無匹配 - 程式碼庫使用 "throttle" 術語
REFINE:新增 "throttle"、"middleware" 關鍵字
循環 2:
DISPATCH:搜尋精煉術語
EVALUATE:找到 throttle.ts (0.9)、middleware/index.ts (0.7)
REFINE:需要路由器模式
循環 3:
DISPATCH:搜尋 "router"、"express" 模式
EVALUATE:找到 router-setup.ts (0.8)
REFINE:足夠上下文
結果:throttle.ts、middleware/index.ts、router-setup.ts
在 agent 提示中使用:
為此任務檢索上下文時:
1. 從廣泛關鍵字搜尋開始
2. 評估每個檔案的相關性(0-1 尺度)
3. 識別仍缺少的上下文
4. 精煉搜尋標準並重複(最多 3 個循環)
5. 回傳相關性 >= 0.7 的檔案
continuous-learning 技能 - 用於隨時間改進的模式~/.claude/agents/ 中的 Agent 定義