RAG Design

RAG Design is a skill for Claude Code, Codex from niels-emmer/myace. It costs 37 tokens per session (484 once invoked), scanned A, original, MIT.

A design and review checklist for retrieval-augmented generation (RAG), where an AI model searches a collection of documents before answering. It covers document processing, search, source tracking, permissions, and handling wrong or missing results.

In plain words
What is it for?
Use it when building or debugging a RAG system, changing its document splitting or search method, evaluating retrieval quality, or checking access control.
Why use it?
It helps separate search failures from answer-generation failures and makes answers traceable to their sources. It also helps prevent the system from retrieving information a user is not allowed to see.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for aider. Also seen: mentions Codex; built for aider; mentions OpenCode.

Good fit Use it when building or debugging a RAG system, changing its document splitting or search method, evaluating retrieval quality, or checking access control.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/niels-emmer/myace/rag-design
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 niels-emmer/myace --skill rag-design
Clone the repo
git clone --depth 1 https://github.com/niels-emmer/myace

Made for: Claude Code, Codex.

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 Design

README.md
[![agentmods](https://agentmods.dev/badge/skills/niels-emmer/myace/rag-design/github.svg)](https://agentmods.dev/skills/niels-emmer/myace/rag-design)
Your own site
<a href="https://agentmods.dev/skills/niels-emmer/myace/rag-design"><img src="https://agentmods.dev/badge/skills/niels-emmer/myace/rag-design/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 Design

Your own site · 80×15
<a href="https://agentmods.dev/skills/niels-emmer/myace/rag-design"><img src="https://agentmods.dev/badge/skills/niels-emmer/myace/rag-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 484 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.00037 $0.00484
Opus 5.5 $0.00015 $0.00194
Sonnet 5.5 $0.00007 $0.00097
Haiku 4.5 $0.00004 $0.00048

Measured yesterday against content hash b3598b313c53, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

RAG Design 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 yesterday.

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.

collections/additional/ai-engineering/skills/rag-design/SKILL.md · 32 lines

What it actually says

Purpose

Make retrieval measurable and the generated answer traceable to sources, since most RAG failures are retrieval failures.

When to use it

When designing a RAG pipeline, debugging wrong or ungrounded answers, or changing the embedding model, chunking or index.

Checklist

  • Evaluate retrieval separately: measure whether the right passage is retrieved (recall at k, hit rate) before judging the generated answer; fix retrieval first.
  • Ingestion: parse documents faithfully, keep structure (headings, tables), record source, version and access rights as metadata, and re-ingest on change.
  • Chunking: split on meaning (sections, paragraphs) with modest overlap; tune size on your eval set rather than copying a default; keep the parent context reachable.
  • Retrieval: combine lexical and vector search where exact terms matter, add a reranker if precision is low, and filter by metadata (tenant, date, permissions) before ranking.
  • Access control: enforce the user's permissions at retrieval time; never retrieve and then rely on the model to withhold.
  • Prompting: pass sources with identifiers, instruct the model to answer only from them and to say when they are insufficient, and require citations.
  • Treat retrieved text as untrusted: it can contain instructions; apply the pack's rule that model-bound content is data, not commands.
  • Failure handling: empty or low-score retrieval returns an honest 'not found', not a guess; log queries and retrieved ids (without personal data) for debugging.
  • Freshness and drift: schedule re-embedding when the model changes, and monitor retrieval quality on a fixed query set.

Expected output

A pipeline description with measured retrieval quality, enforced access control, cited answers and defined behaviour when nothing relevant is found.

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. yesterday First seen · 32 lines · 37 tokens per session scan A b3598b313c53

Subscribe to this mod's changes

RAG Design is a skill published in the GitHub repository niels-emmer/myace (1 stars, last pushed 2d ago), licensed MIT. It adds 37 tokens to every session and 484 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-11-29.

Related

RAG Design compared with skills from other repositories

RAG Design next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
RAG Designniels-emmer/myaceSkill12d agoMITA37Claude Code, Codex
apigee-agent-gateway-governancegoogle/skillsSkill25ktodayApache-2.0A222Claude Code, Codex
graphifyGraphify-Labs/graphifySkill155kyesterdayApache-2.0B76Claude Code
kb-retrieverConardLi/garden-skillsSkill16k11d agoMITA105Claude Code, Codex
molecular-ragsynthetic-sciences/openscienceSkill4.5kyesterdayApache-2.0A40Claude Code, Codex
embedding-strategiesforyourhealth111-pixel/Vibe-SkillsSkill3.9k21d agoApache-2.0A37Claude Code, Codex
rtvi-byom-portingNVIDIA-AI-Blueprints/video-search-and-summarizationSkill2.0kyesterdayApache-2.0A93Codex