Agent Skills
› mtarcure/claude-vibe-squad
› dual-level-retrieval
dual-level-retrieval
GitHub一种双级检索策略,先广泛粗搜定位候选位置,再精读关键文件获取证据,确保引用准确。适用于搜索结果粗糙或需精准验证声明的场景。
触发场景
搜索结果过于宽泛无法支撑结论
需要精准引用代码定义或调用关系
安装
npx skills add mtarcure/claude-vibe-squad --skill dual-level-retrieval -g -y
SKILL.md
Frontmatter
{
"name": "dual-level-retrieval",
"audience": "specialist",
"description": "Use when search results are too coarse to support a claim—sweep broadly to identify every candidate location, then open the most decisive hits around their definitions and callers before quoting or citing them."
}
Dual-Level Retrieval
Retrieve twice — once coarsely over the whole corpus to locate candidates, once precisely inside them to read evidence — so breadth never comes at the cost of quoting accurately.
Steps
- Run the coarse pass over the entire corpus using cheap, recall-oriented queries: names, symbols, and identifiers rather than concepts. Optimize for missing nothing, and accept false positives.
- Record the coarse hit set as a list of locations before reading any of them. This list is the denominator for the fine pass.
- Rank the hit set by expected decisiveness, not by match count — the file that defines a behavior outranks the ten that mention it.
- Run the fine pass by reading the ranked candidates in full context, wide enough to capture the enclosing definition and its callers.
- Quote from the fine pass only. Any claim traced to a coarse-pass snippet is unverified, because a grep line is not a reading of the code.
- Feed fine-pass discoveries back into a new coarse query when they reveal vocabulary you did not know to search for, and iterate until a coarse pass adds no new decisive locations.
- Report both levels: how many locations the coarse pass found, how many the fine pass read, and what was deliberately left unread.
Acceptance
- Coarse queries and their exact hit counts are recorded.
- Every quoted line comes from a file read in the fine pass.
- Candidate ranking is justified by decisiveness rather than frequency.
- At least one feedback iteration is attempted, or its absence is justified.
- The gap between locations found and locations read is stated explicitly.
版本历史
- d5262e2 当前 2026-09-11 11:16


