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.zip

Installs 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).
68 charsno explicit “when” trigger
Intermediate

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

You give it
File paths, query string, and optional parameters for indexing and retrieval
You get back
JSON manifests, SQLite index files, or chunk-level search results/prompt-ready context

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 manifests
  • indexer.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

  1. Generate a manifest (scanner):
    • python3 scanner.py <path1> <path2> --output manifest.json
    • Common options:
      • --file-types .py .md
      • --max-depth 2
      • --exclude "*.venv*" "*.git*"
      • --stats to print exclusion counts
  2. 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
  3. 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)
  4. Retrieve prompt-ready context (retrieve):
    • python3 retrieve.py "query" --index index.db --top-k 5
    • Useful options:
      • --max-context-chars 8000 hard output budget
      • --max-per-file 3 diversity cap
      • --mode lex|sem|hybrid (sem uses TF-IDF cosine; hybrid blends lexical + semantic scores)
  5. One-shot pipeline (retrieve):
    • python3 retrieve.py pipeline "query" --dirs <path1> <path2>
    • Optional:
      • --index /tmp/rag.db to 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

python3

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.

SkillInstallsUpdatedSafetyDifficulty
rag-index (this skill)05moReviewIntermediate
cocoindex69moReviewIntermediate
similarity-search-patterns32moNo flagsAdvanced
senior-data-scientist97moReviewAdvanced

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.

6116

similarity-search-patterns

wshobson

Implement efficient similarity search with vector databases. Use when building semantic search, implementing nearest neighbor queries, or optimizing retrieval performance.

349

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.

952

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.

14

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

00

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

00

Search skills

Search the agent skills registry