rag-design-doc

rag-design-doc is a cursor rule for Cursor from mohitagw15856/pm-claude-skills. It costs 88 tokens per session (1,000 once invoked), scanned A, original, MIT.

A design document for a Retrieval-Augmented Generation (RAG) system, which lets an AI answer questions using a collection of documents or other data. It covers how information is loaded, searched, selected, and used to form answers.

In plain words
What is it for?
Use it to plan a chat-with-your-docs feature or knowledge assistant, choose retrieval and reranking approaches, and define requirements for accuracy, citations, freshness, privacy, cost, and speed.
Why use it?
RAG quality depends on more than the language model: poor document splitting or search can give the model the wrong information. This makes those design choices and their evaluation criteria explicit.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it to plan a chat-with-your-docs feature or knowledge assistant, choose retrieval and reranking approaches, and define requirements for accuracy, citations, freshness, privacy, cost, and speed.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/mohitagw15856/pm-claude-skills/rag-design-doc
About the project

PM Skills is a collection of plain-Markdown instructions that teach AI assistants structured methods for handling professional, personal, and life-admin tasks. People use it with Claude, ChatGPT, Gemini, Cursor, Codex, and other supported agents for work such as writing product requirements, reviewing documents, or planning difficult situations.

mohitagw15856/pm-claude-skills · 1,352 stars · on GitHub · mohitagw15856.github.io

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.

Clone the repo
git clone --depth 1 https://github.com/mohitagw15856/pm-claude-skills

Made for: Cursor.

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-doc

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

Your own site · 80×15
<a href="https://agentmods.dev/rules/mohitagw15856/pm-claude-skills/rag-design-doc"><img src="https://agentmods.dev/badge/rules/mohitagw15856/pm-claude-skills/rag-design-doc.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 88 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,000 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.00088 $0.01000
Opus 5 $0.00044 $0.00500
Sonnet 5 $0.00018 $0.00200
Haiku 4.5 $0.00009 $0.00100

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

Security

Grade A, and why

rag-design-doc 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 7d 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.

exports/cursor/pm-ai/rag-design-doc/rag-design-doc.mdc · 72 lines

How it starts

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

RAG Design Doc Skill

Most RAG systems fail not at generation but at retrieval — the model answers confidently from the wrong chunks. This skill forces the decisions that actually determine quality (chunking, retrieval, reranking, grounding) and pairs each with how you'll evaluate it, so "it hallucinates sometimes" becomes a diagnosable, fixable pipeline.

Required Inputs

Ask for these only if they aren't already provided:

  • Corpus — what's being retrieved over (docs, tickets, code, tables), size, and update frequency.
  • Queries — the kinds of questions users ask, and how precise/recall-sensitive they are.
  • Grounding requirement — must answers cite sources? Is "I don't know" acceptable (it should be)?
  • Constraints — latency budget, cost, privacy/tenancy (per-customer isolation?), and freshness needs.

Output Format

RAG Design: [system]

1. Goal & non-goals — what questions it answers well, and what it explicitly won't do.

2. Ingestion & chunking

  • Source connectors and refresh strategy (full re-index vs. incremental).
  • Chunking: strategy (fixed, recursive, semantic, structure-aware), size + overlap, and what metadata travels with each chunk (source, section, timestamp, permissions). Chunking is the highest-leverage choice — justify it.

3. Embeddings & index — embedding model + dimension, vector store, and the index/filter strategy (incl. metadata filters and per-tenant isolation).

4. Retrieval — top-k, hybrid (dense + keyword/BM25) vs. pure vector, metadata pre-filtering, and query transformation (rewriting, decomposition, HyDE) if used.

5. Reranking — whether a cross-encoder/reranker narrows the candidate set before generation, and the final context budget.

6. Generation — the prompt template, how retrieved context is formatted, the instruction to answer only from context and say "I don't know" otherwise, and how citations are produced and verified.

7. Evaluation — retrieval metrics (recall@k, MRR) separately from answer quality (faithfulness/groundedness, correctness). Pair with an ai-eval-plan.

Read the full file on GitHub · 72 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. 7d ago First seen · 72 lines · 88 tokens per session scan A 10113e77b2d2

Subscribe to this mod's changes

rag-design-doc is a cursor rule published in the GitHub repository mohitagw15856/pm-claude-skills (1,352 stars, last pushed 3d ago), licensed MIT. It adds 88 tokens to every session and 1,000 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-09-03.