scaffold-rag-pipeline

scaffold-rag-pipeline is a command for Claude Code from kumaran-is/claude-code-onboarding. It costs 56 tokens per session (707 once invoked), scanned A, original, MIT.

A scaffold for a retrieval-augmented generation (RAG) system, which finds relevant source text before an AI model writes an answer. It connects text splitting, embeddings, a vector database, retrieval, and optional reranking in Python or LangChain.

In plain words
What is it for?
Use it to start document-search and question-answering systems that store information in pgvector or Weaviate. It helps create the code for embedding, chunking, retrieval, and reranking.
Why use it?
It removes the need to assemble and configure each part of a RAG pipeline by hand. It also adds common safeguards such as batching, error handling, and checks for missing values.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to start document-search and question-answering systems that store information in pgvector or Weaviate. It helps create the code for embedding, chunking, retrieval, and reranking.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kumaran-is/claude-code-onboarding/scaffold-rag-pipeline
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/kumaran-is/claude-code-onboarding

Made for: Claude Code.

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 scaffold-rag-pipeline

README.md
[![agentmods](https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/scaffold-rag-pipeline/github.svg)](https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/scaffold-rag-pipeline)
Your own site
<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/scaffold-rag-pipeline"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/scaffold-rag-pipeline/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 scaffold-rag-pipeline

Your own site · 80×15
<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/scaffold-rag-pipeline"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/scaffold-rag-pipeline.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 707 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.00056 $0.00707
Opus 5 $0.00028 $0.00353
Sonnet 5 $0.00011 $0.00141
Haiku 4.5 $0.00006 $0.00071

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

Security

Grade A, and why

scaffold-rag-pipeline 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 6d 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.

.claude/commands/scaffold-rag-pipeline.md · 67 lines

How it starts

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

Scaffold RAG Pipeline

Generate a complete retrieval-augmented generation pipeline.

Input: $ARGUMENTS

Steps

  1. Load the vector-database skill — read SKILL.md and references/rag-pipeline-patterns.md for templates and anti-patterns.

  2. Gather requirements — Extract from $ARGUMENTS or ask:

    • Pipeline name (snake_case, e.g., vendor_rag)
    • Vector store: pgvector, weaviate, or both (two-stage)
    • Embedding model (from skill model table)
    • Chunking strategy (recursive / sentence / paragraph / fixed) + chunk size
    • Reranking: Cohere / cross-encoder / none (must justify "none" for production)
    • Framework: LangChain integration or custom Python
    • Use case (determines retrieval filters and query patterns)
  3. Generate pipeline files:

    embedding_service.py

    • EMBEDDING_MODEL constant (not per-call string)
    • EmbeddingService class with embed(text) and embed_batch(texts) async methods
    • Rate-limit and timeout error handling (retry 3× with exponential backoff)
    • try/except on all API calls — no silent failures

    chunking.py

    • Chunking function with strategy from requirements
    • RecursiveCharacterTextSplitter with non-zero overlap
    • Returns List[{"text": str, "metadata": dict}]

    {storage}_retriever.py (pgvector and/or weaviate)

    • Async retrieval function with null guard
    • Structured filter support (city, category, etc.)
    • top_k parameter → retrieves 3× final count for reranking room

    reranker.py (if not "none")

    • Cohere rerank wrapper or cross-encoder
    • Accepts merged candidates from both retrieval stages if two-stage

    pipeline.py

    • Orchestrates: query → embed query → retrieve → rerank → format context
    • Score threshold filter (configurable, default 0.5)
    • Logging of retrieval counts and latency
    • Returns {"results": [...], "context": str, "metadata": {...}}

    tests/test_{pipeline_name}.py

    • Unit test: embedding service returns correct shape
    • Unit test: chunking respects chunk_size and overlap
    • Integration test: retrieve → rerank returns expected structure

Read the full file on GitHub · 67 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. 6d ago First seen · 67 lines · 56 tokens per session scan A c9933e761fc8

Subscribe to this mod's changes

scaffold-rag-pipeline is a command published in the GitHub repository kumaran-is/claude-code-onboarding (35 stars, last pushed 2mo ago), licensed MIT. It adds 56 tokens to every session and 707 once invoked, about $0.0003 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.