dual-level-retrieval
Skill220 starsChanged 20 days agoMITView on GitHub
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.
In this repository179 other files it gives its agents.
- AGENTS.mdAGENTS.md
- chrono/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- accessible-media-authoringSkill
- agentic-safety-auditSkill
- agent-prompt-engineeringSkill
- audio-event-map-authoringSkill
- auto-scaffoldSkill
- chain-constructSkill
- chain-construct-smart-contractSkill
- claim-verificationSkill
- code-reachability-auditSkill
- code-review-loopSkill
- color-theorySkill
- conversation-designSkill
- copy-refinementSkill
- cosmos-sdk-audit-checklistSkill
- cross-chain-bridge-auditSkill
- cross-file-relationship-synthesisSkill
- data-flow-traceSkill
- dedup-prior-art-checkSkill
- defi-invariant-checkSkill
- dependency-cycle-auditSkill
- dependency-health-triageSkill
- detection-as-codeSkill
- diff-aware-semgrep-scanSkill
- differential-reviewSkill
- dimensional-analysis-checkSkill
- durable-nonce-exploitationSkill
- erc1271-revert-data-checkSkill
- error-based-sstiSkill
- evm-audit-flowSkill
- figma-implement-designSkill
- findings-filterSkill
- forensic-timeline-authoringSkill
- game-design-fundamentalsSkill
- game-mechanics-balancingSkill
- head-tailSkill
- incident-response-runbookSkill
- interactive-audio-designSkill
- interface-ambiguity-checkSkill
- keyword-clusteringSkill
- knowledge-base-integrationSkill
- known-advisory-backport-checkSkill
- layered-analysis-loopSkill
- level-design-patternsSkill
- locale-adaptationSkill
- multi-stance-audit-fanoutSkill
- narrative-structureSkill
- osint-platform-auditSkill
- parser-differential-route-confusionSkill
- persuasive-technical-writingSkill
- platform-complianceSkill
- player-engagement-psychologySkill
- pre-audit-threat-modelSkill
- program-rubric-lookupSkill
- read-only-reentrancy-checkSkill
- requirements-elicitationSkill
- review-severity-ladderSkill
- rule6-rights-gateSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Run the coarse pass over the entire corpus using cheap, recall-oriented queries: names, symbols, and identifiers rather than concepts.
- Distinctive: line 15
Run the fine pass by reading the ranked candidates in full context, wide enough to capture the enclosing definition and its callers.
- Distinctive: line 22
Every quoted line comes from a file read in the fine pass.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

