Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Rag Design

ASecurity

Retrieval-Augmented Generation (RAG) system design — chunking, embeddings, vector storage, hybrid retrieval, reranking, evaluation, grounding, and the RAG-vs-fine-tune-vs-long-context decision. Auto-fires when the work touches RAG pipelines, vector databases, embeddings, semantic search, document grounding, or knowledge-base-backed LLM applications.

12 stars
0 votes
0 copies
0 views
Added 9/28/2026
ai-agentsrustgosqlnodeapidatabaseperformancedocumentation

Works with

api

Security Analysis

A100/100

Scanned 9/28/2026

Install to Claude Code

$npx -y skills add Nmor/the-claude-council --skill rag-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rag Design?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Rag Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nmor-rag-design/badge)](https://www.skillsdirectory.com/skills/nmor-rag-design)

More formats (shields.io, HTML) on the badges page.

Files
SKILL.md
---
name: rag-design
description: Retrieval-Augmented Generation (RAG) system design — chunking, embeddings, vector storage, hybrid retrieval, reranking, evaluation, grounding, and the RAG-vs-fine-tune-vs-long-context decision. Auto-fires when the work touches RAG pipelines, vector databases, embeddings, semantic search, document grounding, or knowledge-base-backed LLM applications.
---

# RAG Design

> **Size budget: 25 KB.** Check: wc -c. Gate: node ~/.claude/scripts/token-budget.mjs --check
>
> Retrieval-Augmented Generation pipeline engineering — corpus
> ingestion through grounded generation with evaluation, observability,
> and hallucination mitigation built in from day one.

## Purpose

RAG systems combine a retriever (finds relevant context from a corpus)
with a generator (an LLM that conditions its output on the retrieved
context). The promise: grounded answers backed by source citations,
without needing to fine-tune the model on the entire corpus. The
failure modes: irrelevant retrieval, lost-in-the-middle context, stale
embeddings, hallucinated citations, query drift, and unbounded cost.

This skill names the design decisions that determine whether a RAG
system answers "what is the latest revision of the refund policy?"
correctly every time, or hallucinates a plausible-sounding policy
that doesn't exist. The decisions span six layers: ingestion,
chunking, embedding, indexing, retrieval, and generation — plus the
seventh layer that ties them together: evaluation.

NOT in scope: classical IR keyword search alone (handled by Elastic
/ OpenSearch / Algolia patterns); fine-tuning the underlying model
(see `fine-tuning-workflows`); LLM prompt engineering for non-RAG
applications (see `prompt-engineering`).

## Standards Cited

- **Lewis P., et al. (2020)** — "Retrieval-Augmented Generation for
  Knowledge-Intensive NLP Tasks", NeurIPS 2020 (original RAG paper)
- **OpenAI Embeddings API documentation** — `text-embedding-3-large`
  (3072 dim), `text-embedding-3-small` (1536 dim), pricing and
  performance characteristics
- **Anthropic Contextual Retrieval guidance (2024)** —
  context-aware chunk prefixes + BM25 + reranker pattern
- **MTEB (Massive Text Embedding Benchmark)** — Muennighoff et al.
  2023, 56 embedding tasks, 8 task families
- **BEIR (Benchmarking IR)** — Thakur et al. 2021, 18 retrieval
  datasets for zero-shot generalisation
- **RAGAS framework** — Es et al. 2023, automated RAG evaluation
  (faithfulness, answer relevance, context precision/recall)
- **Karpukhin V., et al. (2020)** — "Dense Passage Retrieval for
  Open-Domain QA", EMNLP 2020 (DPR)
- **Khattab O., Zaharia M. (2020)** — "ColBERT: Efficient and
  Effective Passage Search via Contextualized Late Interaction over
  BERT", SIGIR 2020
- **Gao L., et al. (2023)** — "Precise Zero-Shot Dense Retrieval
  without Relevance Labels" (HyDE method)
- **Liu N., et al. (2024)** — "Lost in the Middle: How Language
  Models Use Long Contexts", TACL 2024
- **Cohere Rerank v3** + **Voyage Rerank-2** documentation —
  cross-encoder reranking APIs
- **pgvector documentation** — IVFFlat + HNSW index types in
  PostgreSQL
- **Pinecone, Weaviate, Qdrant, Vespa, Milvus** — managed and
  self-hosted vector store reference architectures
- **LlamaIndex** and **LangChain** RAG documentation — orchestration
  patterns
- **NIST AI RMF 1.0 (2023)** — measurement of trustworthiness
  attributes for generative systems
- **EU AI Act (Reg 2024/1689) Article 50** — transparency obligations
  including disclosure when output is AI-generated

- **NIST AI RMF 1.0** — AI risk management framework (Govern / Map /
  Measure / Manage functions; MEASURE 2 covers model evaluation)
- **NIST SP 800-218A SSDF for AI** — Secure Software Development
  Framework profile for AI models (§PW.4, §PW.6, §PW.8)
- **NIST SP 800-53 Rev 5 §SI-4, §SI-7** — Information system
  monitoring + software integrity (applies to model + dataset
  artifacts)
- **ISO/IEC 23053:2022 §7** — Framework for AI systems using ML
- **ISO/IEC 23894:2023** — AI risk management
- **ISO/IEC 42001:2023** — AI management system requirements
- **OWASP Top 10 for LLM Applications (2025)** — LLM01 Prompt
  Injection, LLM02 Sensitive Information Disclosure, LLM06
  Excessive Agency, LLM09 Misinformation, LLM10 Unbounded
  Consumption
- **OWASP ML Top 10 (2023)** — ML01-ML10 (adversarial inputs,
  data poisoning, model inversion, etc.)
- **CWE-1039** — Automated recognition mechanism with inadequate
  detection or handling of adversarial input perturbations
- **CWE-1426** — Improper validation of generative AI output
- **EU AI Act (Regulation 2024/1689)** — risk-based obligations
  for general-purpose AI models + high-risk systems
- **`~/.claude/rules/common/council-triggers.md`** (Division 15) — bias,
  fairness, dataset provenance, human-in-the-loop gates

## Routing table

This skill uses progressive disclosure: the detail lives in `references/`, one file per concern.
Read the row you need; do not load the whole set.

| Topic | Read |
| --- | --- |
| When to Fire — triggers, and the skills this pairs with | [`references/scope-and-triggers.md`](references/scope-and-triggers.md) |
| Anti-Patterns — the ten failure shapes and their fixes | [`references/anti-patterns-and-checklist.md`](references/anti-patterns-and-checklist.md) |
| Verification Checklist — the pre-ship gate | [`references/anti-patterns-and-checklist.md`](references/anti-patterns-and-checklist.md) |
| Cross-References · Why This Skill Exists · Learning hooks | [`references/rationale-and-learning.md`](references/rationale-and-learning.md) |

## Core Patterns

| # | Pattern | Read |
| --- | --- | --- |
| 1 | The seven-layer RAG stack | [`references/architecture-and-chunking.md`](references/architecture-and-chunking.md) |
| 2 | Chunking — recursive with overlap | [`references/architecture-and-chunking.md`](references/architecture-and-chunking.md) |
| 3 | Contextual retrieval (chunk prefix enrichment) | [`references/architecture-and-chunking.md`](references/architecture-and-chunking.md) |
| 4 | Embedding model selection | [`references/embeddings-and-stores.md`](references/embeddings-and-stores.md) |
| 5 | Vector store choice | [`references/embeddings-and-stores.md`](references/embeddings-and-stores.md) |
| 6 | Hybrid retrieval (BM25 + dense) | [`references/retrieval.md`](references/retrieval.md) |
| 7 | Reranking with cross-encoders | [`references/retrieval.md`](references/retrieval.md) |
| 8 | Query rewriting + HyDE | [`references/retrieval.md`](references/retrieval.md) |
| 9 | Context packing — combat "lost in the middle" | [`references/generation.md`](references/generation.md) |
| 10 | Grounded generation with citations | [`references/generation.md`](references/generation.md) |
| 11 | Evaluation — RAGAS + golden set | [`references/evaluation.md`](references/evaluation.md) |
| 12 | The RAG vs fine-tune vs long-context decision | [`references/evaluation.md`](references/evaluation.md) |

Attribution

NmorNmor
View sourceMore from Nmor →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".

1074701 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

695601 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3351 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

691 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →