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.5 $0.00032 $0.00464
Sonnet 5.5 $0.00016 $0.00232
Haiku 4.5 $0.00008 $0.00116

Measured 3mo ago against content hash 649635841571, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 3mo 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. 3mo 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 (7 stars, last pushed 6mo ago), licensed MIT. It adds 80 tokens to every session and 1,160 once invoked, about $0.0003 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-31.

Related

rag-expert compared with skills from other repositories

rag-expert next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
rag-expertMiaoge-Ge/coding-agent-skillsSkill76mo agoMITA80Claude Code
ai-engineering-toolkitaboalrejal-ai/skillsSkill13mo agoMITA47Claude Code, Codex
ai-engineering-toolkitsickn33/agentic-awesome-skillsSkill51ktodayMITA47Claude Code
9router-embeddingsdecolua/9routerSkill33k7d agoMITA66Claude Code, Codex
sovereign-economics-enginewinstonkoh87/Athena-PublicSkill6552d agoMITA43Claude Code, Codex
mongodb-search-and-aifcakyon/claude-codex-settingsSkill1.2ktodayApache-2.0A210Claude Code
ai-llm-integration-expertroedyrustam/vibes-plugSkill1293d agoMITA45Cursor