rag-learning-academy: Skill for Claude Code

.claude/skills/debug-rag/SKILL.md

debug-rag is a skill for Claude Code from TakaGoto/rag-learning-academy. It costs 13 tokens per session (1,413 once invoked), scanned A, original, MIT.

A guided troubleshooting workflow for RAG systems, where RAG retrieves source documents before an answer is generated. It helps identify common problems such as irrelevant or missing context, unsupported answers, contradictions, incomplete responses, and slow performance.

In plain words
What is it for?
Use it when a RAG pipeline hallucinates, retrieves the wrong information, misses relevant documents, gives incomplete or repetitive answers, returns the wrong format, or responds too slowly.
Why use it?
It turns a vague bad result into a specific failure mode that can be investigated. The process also explains the diagnosis while working toward a fix.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is TakaGoto/rag-learning-academy's own configuration. It tells Claude Code how to work on rag-learning-academy itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything rag-learning-academy configures →

Reuse

Borrowing it

Nothing to install: this file belongs to TakaGoto/rag-learning-academy. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/TakaGoto/rag-learning-academy/main/.claude/skills/debug-rag/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/TakaGoto/rag-learning-academy

Made for: Claude Code.

Wrote 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.

agentmods badge for debug-rag

README.md
[![agentmods](https://agentmods.dev/badge/skills/takagoto/rag-learning-academy/debug-rag/github.svg)](https://agentmods.dev/skills/takagoto/rag-learning-academy/debug-rag)
Your own site
<a href="https://agentmods.dev/skills/takagoto/rag-learning-academy/debug-rag"><img src="https://agentmods.dev/badge/skills/takagoto/rag-learning-academy/debug-rag/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for debug-rag

Your own site · 80×15
<a href="https://agentmods.dev/skills/takagoto/rag-learning-academy/debug-rag"><img src="https://agentmods.dev/badge/skills/takagoto/rag-learning-academy/debug-rag.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,413 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.01413
Opus 5.5 $0.00005 $0.00565
Sonnet 5.5 $0.00003 $0.00283
Haiku 4.5 $0.00001 $0.00141

Measured 1mo ago against content hash 197c76bc06c6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

debug-rag 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 1mo 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.

.claude/skills/debug-rag/SKILL.md · 114 lines

How it starts

The opening of the file, as written. The whole thing — 114 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Debug RAG: Diagnose and Fix Pipeline Issues

Scope: This skill teaches debugging through guided diagnosis and explanation. For a fast fix without the teaching, use /fix.

An interactive debugging workflow that helps learners identify and resolve common RAG failure modes. This skill builds debugging intuition alongside technical problem-solving.

Language awareness: See .claude/LANGUAGE_AWARENESS.md.

Step 1: Identify the Symptom

Ask the learner to describe the problem they are seeing. Common symptoms include:

  1. Hallucination: The model generates information not in the retrieved context
  2. Irrelevant retrieval: The retrieved documents do not match the query
  3. Missing context: Relevant information exists in the corpus but is not retrieved
  4. Incomplete answers: The answer is partially correct but missing key details
  5. Contradictory answers: The answer contradicts the source documents
  6. Repetitive or generic responses: The model ignores context and gives generic answers
  7. Wrong format: The answer is correct but not in the expected format
  8. High latency: The pipeline is too slow

If the learner is not sure, ask them to share an example query, the expected answer, and the actual answer.

Step 2: Follow the Diagnostic Tree

Based on the symptom, walk through the appropriate diagnostic path:

For Retrieval Issues (irrelevant results, missing context)

Start by inspecting what the retriever actually returns:

Provide diagnostic code in the learner's chosen language that retrieves results and prints scores, sources, and text previews.

  1. Check the query: Is the query well-formed? Try rephrasing it.
  2. Inspect chunks: Look at the actual chunks in the vector store. Are they the right size? Do they contain the expected information?
  3. Test embedding similarity: Compute the similarity between the query embedding and the expected chunk embedding. Is it above the retrieval threshold?
  4. Check top-k: Are you retrieving enough documents? Try increasing top-k.
  5. Examine metadata filters: Are any filters accidentally excluding relevant results?
  6. Compare search methods: Try keyword search alongside vector search to see if the issue is in the embeddings.

Read the full file on GitHub · 114 lines

Changes

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.

  1. 1mo ago First seen · 114 lines · 13 tokens per session scan A 197c76bc06c6

Subscribe to this mod's changes

debug-rag is a skill published in the GitHub repository TakaGoto/rag-learning-academy (24 stars, last pushed 6mo ago), licensed MIT. It adds 13 tokens to every session and 1,413 once invoked, about $0.0001 per session on Opus 5.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-08-30.

Related

Other skills, from other repositories

autorag-doctor

Diagnose and repair a broken or half-working AutoRAG install so every configured source is both indexed and searchable. Checks AutoRAG, MinSync, Jikji, the embedding backend, and every CLI-backed datasource (lazykatok, discrawl, slacrawl, wacrawl, telecrawl, notcrawl, mailcrawl, rclone, Spotlight), then fixes orphan…

Marker-Inc-Korea/AutoRAG · 149 tokens

browserwing-admin

Manage and operate BrowserWing — an intelligent browser automation platform. Install dependencies, configure LLM, create/manage/execute automation scripts, use AI-driven exploration to generate scripts, browse the script marketplace, and troubleshoot issues.

MemTensor/MemOS · 47 tokens

profile-vllm-performance

Profile vLLM and RT-VLM inference to identify and remove GPU-idle gaps, underfilled batches, transfer stalls, serialized multimodal work, scheduler gaps, or KV pressure. Use this skill when GPU utilization is unexpectedly low or bursty, capacity trails another runtime, TTFT or ITL regresses, or multimodal prefill and…

NVIDIA-AI-Blueprints/video-search-and-summarization · 93 tokens

rag-architecture-review

Review an existing Retrieval-Augmented Generation system and find why it underperforms. Use when asked to review or audit a RAG pipeline, diagnose wrong/ungrounded answers from a 'chat with your docs' feature, or improve an already-built knowledge assistant. Produces a staged review — ingestion, chunking, retrieval…

mohitagw15856/pm-claude-skills · 89 tokens

rag-index-decisions

After making a non-obvious architectural decision, solving a novel bug, agreeing on a coding standard, or reaching a conclusion worth remembering, index it back into the knowledge base so the next occurrence is one search away. Uses adddocument or addfromurl. Closes the feedback loop that makes a RAG-backed team…

lyonzin/knowledge-rag · 72 tokens

rag-blueprint

NVIDIA RAG Blueprint — deploy, configure, troubleshoot, and manage. Handles any RAG action: deploy, install, start, enable, disable, toggle, change, configure, troubleshoot, debug, fix, shutdown, stop, or tear down any RAG feature or service (Agentic RAG, VLM, guardrails, query rewriting, models, search, ingestion…

NVIDIA-AI-Blueprints/rag · 92 tokens