rag-index
Experimental utilities for building a RAG index of a code repository for improved AI context retrieval.
Install
mkdir -p .claude/skills/rag-index && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17254" && unzip -o skill.zip -d .claude/skills/rag-index && rm skill.zipInstalls to .claude/skills/rag-index
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Experimental RAG indexing utilities (scanner + indexer + retriever).Key capabilities
- →Scan directories for files
- →Build SQLite-based indexes
- →Search indexes lexically
- →Retrieve prompt-ready context
- →Execute a one-shot scan-build-retrieve pipeline
How it works
The skill provides utilities to scan directories, build chunk-aware SQLite indexes, and retrieve relevant code snippets. It supports lexical, semantic, and hybrid search modes to format context for prompts.
Inputs & outputs
When to use rag-index
- →Generating a searchable index of a codebase
- →Retrieving relevant code chunks for LLM context
- →Experimenting with hybrid search for code
- →Managing token budget for prompt-ready context
About this skill
rag-index
Purpose
Prototype utilities for building a repo index used by retrieval-augmented prompts. The workflow is scan -> index -> retrieve, with a one-shot pipeline for ad-hoc use.
Scripts
scanner.py— recursive directory scanner that emits deterministic JSON manifestsindexer.py— chunk-aware SQLite index builder and lexical search (build,search)retrieve.py— prompt-context formatter that consumes chunk-level search results (retrieve,pipeline)
How to use
- Generate a manifest (scanner):
python3 scanner.py <path1> <path2> --output manifest.json- Common options:
--file-types .py .md--max-depth 2--exclude "*.venv*" "*.git*"--statsto print exclusion counts
- Build/update an index (indexer):
python3 indexer.py build --manifest manifest.json --output index.db- Incremental behavior:
- unchanged files are skipped
- changed files update only changed chunks
- removed files/chunks are deleted
- Search the index (indexer):
python3 indexer.py search "query" --index index.db --top-k 5- Returns chunk-level records (
path,rel_path,start_line,end_line,chunk_id,snippet)
- Retrieve prompt-ready context (retrieve):
python3 retrieve.py "query" --index index.db --top-k 5- Useful options:
--max-context-chars 8000hard output budget--max-per-file 3diversity cap--mode lex|sem|hybrid(semuses TF-IDF cosine;hybridblends lexical + semantic scores)
- One-shot pipeline (retrieve):
python3 retrieve.py pipeline "query" --dirs <path1> <path2>- Optional:
--index /tmp/rag.dbto persist index--max-depth 2--file-types .py .md
- This runs scan -> build -> retrieve in one command.
When to use RAG
Use RAG when:
- the question depends on repository-specific behavior or contracts
- the answer needs exact symbols, paths, config keys, or line ranges
- the agent is uncertain and needs grounded evidence from code/docs
Do not use RAG when:
- the question is purely generic knowledge
- the user already provided the exact snippet needed
- the target file is already fully in active context and retrieval adds no value
When not to use it
- →When the question is purely generic knowledge
- →When the user already provided the exact snippet needed
- →When the target file is already fully in active context
Prerequisites
Limitations
- →The skill is experimental.
- →The skill is designed for retrieval-augmented prompts.
- →The skill's retrieval options include a hard output budget for context characters.
How it compares
This skill automates the creation and querying of a repository index to provide grounded evidence for LLM prompts, which is more efficient than manually searching and extracting code snippets.
Compared to similar skills
rag-index side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| rag-index (this skill) | 0 | 5mo | Review | Intermediate |
| cocoindex | 6 | 9mo | Review | Intermediate |
| similarity-search-patterns | 3 | 2mo | No flags | Advanced |
| senior-data-scientist | 9 | 7mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
cocoindex
cocoindex-io
Comprehensive toolkit for developing with the CocoIndex library. Use when users need to create data transformation pipelines (flows), write custom functions, or operate flows via CLI or API. Covers building ETL workflows for AI data processing, including embedding documents into vector databases, building knowledge graphs, creating search indexes, or processing data streams with incremental updates.
similarity-search-patterns
wshobson
Implement efficient similarity search with vector databases. Use when building semantic search, implementing nearest neighbor queries, or optimizing retrieval performance.
senior-data-scientist
davila7
World-class data science skill for statistical modeling, experimentation, causal inference, and advanced analytics. Expertise in Python (NumPy, Pandas, Scikit-learn), R, SQL, statistical methods, A/B testing, time series, and business intelligence. Includes experiment design, feature engineering, model evaluation, and stakeholder communication. Use when designing experiments, building predictive models, performing causal analysis, or driving data-driven decisions.
hugging-face-datasets
patchy631
Create and manage datasets on Hugging Face Hub. Supports initializing repos, defining configs/system prompts, streaming row updates, and SQL-based dataset querying/transformation. Designed to work alongside HF MCP server for comprehensive dataset workflows.
elo-engineering
sports-data-hq
Builds multi-variant Elo rating systems for sports prediction. Use when user asks about Elo ratings, rating systems, team strength, K-factor, home field advantage, season carryover, margin-of-victory adjustments, or mentions 'Fading Elo', 'Form Elo', 'Component Elo'. Do not use for general feature c
feast-user-guide
feast-dev
Guide for working with Feast (Feature Store) — defining features, configuring feature_store.yaml, retrieving features online/offline, using the CLI, and building RAG retrieval pipelines. Use when the user asks about creating entities, feature views, on-demand feature views, stream feature views, fea