rag-expert

rag-expert is a skill for Claude Code from Miaoge-Ge/coding-agent-skills. It costs 80 tokens per session (1,160 once invoked), scanned A, original, MIT.

A set of guidance for Retrieval-Augmented Generation (RAG), a way to answer questions by first finding relevant passages in a document collection. It covers document splitting, embeddings, vector and keyword search, reranking, and citations.

In plain words
What is it for?
Use it to build or debug chat-with-your-documents systems, tune document chunking and search, add metadata or access filters, and investigate hallucinations or missing citations.
Why use it?
It helps improve answers by fixing missing or irrelevant retrieved context before changing the prompt or blaming the language model.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the rag-expert plugin — 1 skill shipped together

Good fit Use it to build or debug chat-with-your-documents systems, tune document chunking and search, add metadata or access filters, and investigate hallucinations or missing citations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/miaoge-ge/coding-agent-skills/rag-expert
Install

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.

Any agent
npx skills add Miaoge-Ge/coding-agent-skills --skill rag-expert
Clone the repo
git clone --depth 1 https://github.com/Miaoge-Ge/coding-agent-skills

Made for: Claude Code.

Or install rag-expert, the plugin that ships this one along with the rest of its 1 skill.

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 rag-expert

README.md
[![agentmods](https://agentmods.dev/badge/skills/miaoge-ge/coding-agent-skills/rag-expert/github.svg)](https://agentmods.dev/skills/miaoge-ge/coding-agent-skills/rag-expert)
Your own site
<a href="https://agentmods.dev/skills/miaoge-ge/coding-agent-skills/rag-expert"><img src="https://agentmods.dev/badge/skills/miaoge-ge/coding-agent-skills/rag-expert/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 rag-expert

Your own site · 80×15
<a href="https://agentmods.dev/skills/miaoge-ge/coding-agent-skills/rag-expert"><img src="https://agentmods.dev/badge/skills/miaoge-ge/coding-agent-skills/rag-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,160 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.00080 $0.01160
Opus 5 $0.00040 $0.00580
Sonnet 5 $0.00016 $0.00232
Haiku 4.5 $0.00008 $0.00116

Measured 9d ago against content hash 649635841571, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

rag-expert 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 9d 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.

plugins/rag-expert/skills/rag-expert/SKILL.md · 82 lines

How it starts

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

RAG Engineering Expert

Garbage retrieval in, hallucination out. Answer quality is bounded by what you retrieve, so fix retrieval before touching the prompt. Measure retrieval and generation separately.

When to Use

  • Building a RAG / "chat with your docs" / knowledge-assistant system.
  • Tuning chunking, embeddings, retrieval, hybrid search, or reranking.
  • Poor answers: missing context, wrong/irrelevant chunks, hallucinations, no citations.
  • Choosing a vector store or designing metadata/filtering.

When NOT to Use

  • Prompt wording/format only → prompt-engineering-expert.
  • Training/fine-tuning a model → deep-learning-expert.
  • Eval harness/regression design → llm-testing-expert.
  • Serving infra/API shape → api-design-expert.

Core Principles

1. Ingestion & chunking

  • Chunk on semantic boundaries (headings, paragraphs, code blocks), not fixed byte counts. Start ~256–512 tokens with ~10–15% overlap; tune per corpus.
  • Preserve structure: keep tables/code intact, prepend section/title context to each chunk. Attach metadata (source, title, section, URL, timestamp, ACL) and a stable chunk ID for citations and filtering.

2. Retrieval quality (the highest-leverage area)

  • Use a strong, task-matched embedding model; query and document embeddings must come from the same model/version. Re-index when you change models.
  • Hybrid search: combine dense vectors with keyword/BM25 and fuse (e.g., RRF). Pure vector search misses exact terms — error codes, names, IDs, acronyms.
  • Add a cross-encoder reranker over the top ~20 candidates and keep the top ~3–5. This is usually the biggest single quality win.
  • Apply metadata filters (tenant, recency, doc type, ACL) — and enforce access control at retrieval, never just in the prompt.

3. Generation & grounding

  • Pass only the reranked chunks that fit a sensible context budget (more is not better — it dilutes and raises cost/latency). Mark each with a source id.
  • Instruct the model to answer only from context, cite sources, and say "I don't know" when context is insufficient. Return citations to the user for verifiability.

Read the full file on GitHub · 82 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. 9d ago First seen · 82 lines · 80 tokens per session scan A 649635841571

Subscribe to this mod's changes

rag-expert is a skill published in the GitHub repository Miaoge-Ge/coding-agent-skills (5 stars, last pushed 3mo ago), licensed MIT. It adds 80 tokens to every session and 1,160 once invoked, about $0.0004 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-08-31.

Related

Other skills, from other repositories

ai-engineering-toolkit

6 production-ready AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching.

aboalrejal-ai/skills · 47 tokens

ai-engineering-toolkit

6 production-ready AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching.

sickn33/agentic-awesome-skills · 47 tokens

9router-embeddings

Generate vector embeddings via 9Router /v1/embeddings using OpenAI / Gemini / Mistral / Voyage / Nvidia / GitHub embedding models for RAG, semantic search, similarity. Use when the user wants embeddings, vectors, RAG, semantic search, or to embed text.

decolua/9router · 66 tokens

llm-application-dev

Building applications with Large Language Models - prompt engineering, RAG patterns, and LLM integration. Use for AI-powered features, chatbots, or LLM-based automation.

MoizIbnYousaf/Ai-Agent-Skills · 40 tokens

karpathy-llm-wiki

Use when building or maintaining a personal LLM-powered knowledge base. Triggers: ingesting sources into a wiki, querying wiki knowledge, linting wiki quality, 'add to wiki', 'what do I know about', or any mention of 'LLM wiki' or 'Karpathy wiki'.

Astro-Han/karpathy-llm-wiki · 67 tokens

mongodb-search-and-ai

Guides MongoDB users through implementing and optimizing Atlas Search (full-text), Vector Search (semantic), and Hybrid Search solutions. Use this skill when users need to build search functionality for text-based queries (autocomplete, fuzzy matching, faceted search), semantic similarity (embeddings, RAG…

fcakyon/claude-codex-settings · 132 tokens