rag-eval
Skill387 starsChanged 5 months agoMITView on GitHub
Iterate on RAG systems with structured evals instead of eyeballing. This skill should be used when the user is tuning a RAG pipeline — changing retrieval prompts, swapping models, adjusting chunking, or debugging poor answers — and wants a cheap, ranked set of experiments with cost tracking and structured feedback on the stack. Also use when the user asks "how do I know if my RAG is working?", "this RAG eval is burning money", or "what should I try next on retrieval?".
- Reads credentials
4 other projects use a version of this.
Adopted by
Most recently taken up by
- PracticalSwan/agent-skillstheir own version, first seen Sep 14, 2026
- neronain/ClaudeSkills-Neronaintheir own version, first seen Aug 9, 2026
- floflo777/claude-rag-skillstheir own version, first seen Jan 18, 2026
- agentscope-ai/OpenJudgetheir own version, first seen Jan 7, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- agentscope-ai/OpenJudge★ 865same name
- floflo777/claude-rag-skills★ 34same name
- PracticalSwan/agent-skills★ 18same name
- neronain/ClaudeSkills-Neronain★ 3same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository104 other files it gives its agents.
- automation-advisor/CLAUDE.mdCLAUDE.md
- agency-docs-updaterSkill
- agency-meetup-publishSkill
- agency-socialsSkill
- agent-cliSkill
- app-releaseSkill
- automation-advisorSkill
- balancedSkill
- brand-agencySkill
- browser-mateSkill
- browsing-historySkill
- chrome-historySkill
- coaching-session-summarizerSkill
- codexSkill
- cognitive-toolkitSkill
- context-builderSkill
- cull-release-checkSkill
- cull-release-prepareSkill
- cull-release-publishSkill
- cull-release-recoverSkill
- cull-releaseSkill
- cull-release-verifySkill
- cullSkill
- daydreamSkill
- decision-toolkitSkill
- deep-researchSkill
- design-tokensSkill
- doctorgSkill
- ecosystemSkill
- elevenlabs-ttsSkill
- elimination-researchSkill
- fathomSkill
- feature-factorySkill
- firecrawl-researchSkill
- font-featuresSkill
- github-gistSkill
- gmailSkill
- google-image-searchSkill
- gpt-image-2Skill
- granolaSkill
- gwsSkill
- health-dataSkill
- i18n-studioSkill
- init-tauri-appSkill
- init-xcode-appSkill
- insight-extractorSkill
- jtbdSkill
- lab-retroSkill
- learning-vaultSkill
- linearSkill
- llm-cliSkill
- local-modelsSkill
- meeting-prepSkill
- meeting-processorSkill
- metaSkill
- name-auditionSkill
- nano-bananaSkill
- nielsen-heuristicsSkill
- pdf-generationSkill
- peer-agent-collaborationSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 3 are distinctive, and 9 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 30
Follow this order. Refer to references/best-practices.md for the canonical checklist and references/evidence-base.md for the …
- Very specific: line 48
Read references/best-practices.md and inspect the user's repo + vector-store config.
- Very specific: line 62
Use scripts/eval_sweep.py (see the script header for invocation).
- Distinctive: line 65
Never exceed the budget cap — halt mid-sweep if reached.
- Very specific: line 66
Never mutate the user's repo.
- Very specific: line 71
After the sweep, rank variants by a cost-aware score: quality × (1 / log(1 + cost)).
- Very specific: line 76
Write the full report to .rag-eval/reports/<timestamp>.md.
- Very specific: line 80
Before each subsequent run, read history.jsonl and factor in what the user has already tried.
- Distinctive: line 92
Cost is the main failure mode: Never run without a confirmed budget.
- Very specific: line 93
No repo mutation: All outputs go under .rag-eval/ in the target repo.
- Very specific: line 94
When uncertain about best practices, do web research: Use tavily-search or firecrawl-research to pull current evidence, then synthesize …
- Distinctive: line 95
Defer to the user: Before changing any file in the target repo, always confirm.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
rag-eval
Purpose
Replace the "tweak → squint → swap model → burn credits" loop with a single command that runs a grid of eval variants on the user's gold-set, ranks them by a cost-aware score, and returns structured feedback on architecture, stack, and likely-issues. Draws on evidence-based RAG practices and learns from the user's past runs.
When to use
Trigger on: "help me test a RAG", "tune my RAG", "my RAG is bad", "compare retrieval prompts", "how do I eval this", "what's the best embedding model for X", "my RAG eval is expensive". Also trigger when the user reports burning OpenRouter / OpenAI credits with no clear signal of improvement.
Prerequisites — gather before running
Collect these from the user before the first sweep. Many are optional with sensible defaults; always confirm the ones that gate cost.
- RAG codebase root — path to the repo/module under test.
- Gold-set — at least 10 Q&A pairs. If missing, offer to generate a starter gold-set from the user's dataset (LLM-synthesized, human-reviewed). See
references/best-practices.md. - Dataset — the corpus the RAG retrieves over.
- Budget cap — hard dollar limit per run (default: $2 if user doesn't specify). Always confirm before any sweep.
- Provider keys —
OPENROUTER_API_KEYorOPENAI_API_KEY(read from env). - Vector-store config — collection name, embedding model, chunk size (read from repo; confirm if ambiguous).
- Eval history path (optional) — defaults to
.rag-eval/history.jsonlin the repo root.
Workflow
Follow this order. Refer to references/best-practices.md for the canonical checklist and references/evidence-base.md for the research-backed defaults.
Step 0 — (Optional) Ingest a prior iteration session
When the user provides a session ID (Claude Code transcript, skill-studio session, or a Fathom meeting), run the deterministic ingest first — no LLM calls. This extracts only the useful signals (models tried, prompt variants, cost events, eval results) as compact JSON, so the rest of the skill works off a tiny structured bundle instead of a long raw transcript.
python scripts/session_ingest.py <session_id> > /tmp/rag-eval-bundle.json
# or with a direct path:
python scripts/session_ingest.py --path /path/to/transcript.jsonl > /tmp/rag-eval-bundle.jsonThe bundle includes: models_tried, prompts_tried (hashes only), iterations, total_cost_usd, summary_stats. Feed this into Step 1 — do not paste the raw transcript.
Why this matters: transcripts can be 100k+ tokens of noise. The ingest script does regex extraction only, keeping the LLM budget for the actual audit + sweep planning. This is a hard requirement, not an optimization.
Step 1 — Audit the stack
Read references/best-practices.md and inspect the user's repo + vector-store config. Produce a structured report covering:
- Architecture (retrieval type: dense / hybrid / rerank; chunking strategy; prompt structure)
- Tech stack (embedding model, LLM, vector store)
- Resources (dataset size, gold-set size, prior eval runs)
- Risks (known anti-patterns, missing pieces)
Present the report to the user and ask which issues to address first.
Step 2 — Propose a sweep plan
Based on the audit, propose 3–8 variants to test. Keep the grid small on the first run (default: 2 prompts × 2 models × 1 retrieval variant = 4 cells). Estimate cost using gold-set size × variants × avg tokens × provider pricing. Present the cost estimate and wait for user confirmation before running.
Step 3 — Run the sweep
Use scripts/eval_sweep.py (see the script header for invocation). It reads a config YAML, runs each variant against the gold-set, records per-variant cost and answer quality, and appends to history.jsonl.
Guardrails:
- Never exceed the budget cap — halt mid-sweep if reached.
- Never mutate the user's repo. Write all artifacts under
.rag-eval/(gitignore it). - Confirm before any sweep estimated to exceed the user's cap.
Step 4 — Rank and report
After the sweep, rank variants by a cost-aware score: quality × (1 / log(1 + cost)). Present:
- Top 3 variants with quality metrics and cost
- What changed vs the previous best
- Concrete next experiment to try
Write the full report to .rag-eval/reports/<timestamp>.md.
Step 5 — Self-improve
Before each subsequent run, read history.jsonl and factor in what the user has already tried. Avoid re-testing rejected variants. Surface patterns ("models A, B, C all underperformed on multi-hop queries — next try a reranker").
Reusable resources
scripts/eval_sweep.py— grid-search runner. Readseval_config.yaml, writes results tohistory.jsonl.references/best-practices.md— evidence-based RAG checklist the agent uses as an anchor.references/evidence-base.md— pointers to recent RAG research and when each technique helps.assets/eval_config.template.yaml— starter config to copy into the user's repo.assets/gold_set.template.jsonl— 3 example Q&A pairs to show the gold-set format.
Notes
- Cost is the main failure mode. Never run without a confirmed budget. Err on the side of smaller sweeps; users can always run again.
- No repo mutation. All outputs go under
.rag-eval/in the target repo. - When uncertain about best practices, do web research. Use
tavily-searchorfirecrawl-researchto pull current evidence, then synthesize into the audit report. - Defer to the user. Before changing any file in the target repo, always confirm.
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.

