Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/latestaiagents/agent-skills/rag-debuggit clone --depth 1 https://github.com/latestaiagents/agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/latestaiagents/agent-skills/rag-debug)<a href="https://agentmods.dev/commands/latestaiagents/agent-skills/rag-debug"><img src="https://agentmods.dev/badge/commands/latestaiagents/agent-skills/rag-debug.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00011 | $0.00407 |
| Opus 5 | $0.00005 | $0.00204 |
| Sonnet 5 | $0.00002 | $0.00081 |
| Haiku 4.5 | $0.00001 | $0.00041 |
Grade A, and why
rag-debug scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
/rag-debug
Diagnose and fix RAG pipeline problems with systematic analysis.
What I Need
Tell me:
- What query is producing poor results?
- What answer did you expect vs what you got?
- Which vector store are you using?
How It Works
Step 1: Query Analysis
I'll analyze your query to identify potential issues:
- Query clarity and specificity
- Potential keyword/semantic mismatch
- Query complexity (single vs multi-hop)
Step 2: Retrieval Diagnosis
I'll check retrieval quality:
- Are relevant documents in your index?
- What's the similarity score distribution?
- Are chunks properly sized?
Step 3: Generation Analysis
I'll examine the generation step:
- Is context being used correctly?
- Are there hallucinations?
- Is the prompt template effective?
Step 4: Fix Recommendations
Based on findings, I'll recommend:
- Chunking adjustments
- Retrieval strategy changes
- Prompt improvements
- Hybrid search additions
Debug Checklist
[ ] Query understood correctly?
[ ] Documents indexed?
[ ] Chunks contain answer?
[ ] Top-k retrieving relevant docs?
[ ] Context passed to LLM?
[ ] LLM using context?
[ ] Answer grounded?
Common Issues & Fixes
| Symptom | Likely Cause | Fix |
|---|---|---|
| Wrong docs retrieved | Semantic gap | Add hybrid search |
| Right docs, wrong answer | Poor prompt | Improve system prompt |
| Partial answer | Chunk boundary | Adjust overlap |
| Hallucination | Context ignored | Add grounding check |
| No answer | Missing docs | Check indexing |
Quick Commands
# Test retrieval only
retriever.invoke("your query")
# Check similarity scores
vectorstore.similarity_search_with_score("query", k=10)
# Inspect chunk content
for doc in results: print(doc.page_content[:200])
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 81 lines · 11 tokens per session scan A 236cc2c74337
rag-debug is a command published in the GitHub repository latestaiagents/agent-skills (5 stars, last pushed 4mo ago), licensed MIT. It adds 11 tokens to every session and 407 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other commands, from other repositories
fdk-fix
Fix all platform validation errors and lint errors in a Freshworks app. Runs fdk validate, identifies fatal errors and lint issues, applies fixes iteratively, and re-validates until all errors are resolved.
dataset
Manage dataset manifests for data that is too large or unsuitable to store directly in the wiki. The wiki becomes the index/interface; the data stays external.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.