- name
SKILL.md
El archivo de la skill permanece en el repositorio del publicador.
Pega el comando copiado en una terminal. Instala este SKILL.md en ese agente.
npx skills add oaustegard/claude-skills --skill bm25 -a cursor -yPega el comando copiado en una terminal. Instala este SKILL.md en ese agente.
npx skills add oaustegard/claude-skills --skill bm25 -a claude-code -yPega el comando copiado en una terminal. Instala este SKILL.md en ese agente.
npx skills add oaustegard/claude-skills --skill bm25 -a codex -yPega el comando copiado en una terminal. Instala este SKILL.md en ese agente.
npx skills add oaustegard/claude-skills --skill bm25 -a grok -yEnvía el mensaje copiado en un chat de Grok Bot. El Bot obtiene este SKILL.md de GitHub y lo añade a las skills que comparten todos tus Bots.
Install this skill: https://github.com/oaustegard/claude-skills/tree/HEAD/bm25Del publicador
Ranked content search over any text corpus. One CLI, in-memory BM25 index per process, with a session-local disk cache so repeat invocations against the same corpus load in tens of milliseconds instead of rebuilding.
uv pip install --system --break-system-packages bm25s
Install is sub-second on a warm uv cache. That's the entire dependency.
BM25=/mnt/skills/user/bm25/scripts/bm25.py
# Local directory
python3 $BM25 ./repo 'csrf middleware'
# Multiple queries against the same in-memory index (build once, query many)
python3 $BM25 ./repo 'csrf middleware' 'session backend' 'queryset filter'
# Cloned GitHub repo via tarball (one HTTP call)
python3 $BM25 'github.com/django/django' 'atomic transaction'
python3 $BM25 'github.com/django/django@stable/5.0.x' 'atomic transaction'
# Project knowledge or uploads
python3 $BM25 project 'RAG scaling laws'
python3 $BM25 uploads 'tax loss harvesting'
# Filters
python3 $BM25 ./repo 'auth flow' --exclude 'tests/*' --exclude '*/tests/*'
python3 $BM25 ./repo 'config' --include '*.py' --include '*.toml'
# Interactive (REPL — single corpus, many queries)
python3 $BM25 ./repo --interactive
# JSON output for piping
python3 $BM25 ./repo 'auth flow' --json
With no --include, a default set of text/code extensions is indexed (Python,
JS/TS, Go, Rust, Markdown, JSON, YAML, etc.). Standard noise dirs are skipped
unconditionally: .git, node_modules, __pycache__, .venv, dist, etc.
The boundary with searching-codebases: that skill is code-specific (routes
between regex and TF-IDF, expands via tree-sitting AST). bm25 is the simpler
general-purpose tool — any corpus, no AST awareness, no routing. Prefer
searching-codebases for code; reach for bm25 when the corpus is mixed
(docs + code), non-code (notes, transcripts, PDFs converted to text), or when
you specifically want BM25's length-normalized scoring.
/home/claude/.bm25-cache/<key>/. The
key is a hash of (resolved_corpus_path, include_globs, exclude_globs, max_file_bytes) plus every discovered file's path and content hash, so
editing, adding or deleting a file invalidates it. A hit still reads the
corpus to hash it but skips tokenizing and indexing (1,649 files: 0.35s
hit vs ~1s rebuild). The cache lives in /home/claude,
which is ephemeral, so it expires at the session boundary — same
lifetime as the corpus state itself, no cross-session staleness.
~5–35MB per cached index, depending on corpus size.--no-cache bypasses both load and save — useful to confirm a
rebuild matches.--interactive, amortizes any rebuild cost across queries.tree-sitting queries on the same paths.bm25s.tokenize with stopwords disabled — over a
small Django sample, AST-derived token streams (identifiers/strings/
comments only) gave near-identical rankings, so we don't bother.Default (human-readable):
QUERY: csrf middleware
----------------------------------------------------------------------
1. 5.51 django/core/checks/security/csrf.py
def _csrf_middleware():
return "django.middleware.csrf.CsrfViewMiddleware" in settings.MIDDLEWARE
2. 5.34 docs/howto/csrf.txt
...
--json produces {"query": ..., "results": [{"path", "score", "snippet"}, ...]}.
bm25.py CLI
├── resolve_corpus(spec) → local Path (downloads tarball if github.com/...)
├── cache_key(...) → 16-hex sha256 of inputs that determine the index
├── CorpusIndex.load(cache_dir) → returns cached index if present, else None
├── CorpusIndex.build(...) → walks files, tokenizes, indexes with bm25s
├── CorpusIndex.save(cache_dir) → persists to /home/claude/.bm25-cache/<key>/
├── query(q, k) → ranked (doc_idx, score) pairs
└── best_snippet(doc, q, lines) → pick line w/ most query-term hits + context
Cache contents per directory:
bm25/ — bm25s.BM25.save() output (NumPy arrays + vocab)corpus.pkl — pickled {paths, docs} so we can render snippets without
re-reading the source filesmanifest.json — corpus root, files count, built_at timestampNo network beyond optional tarball fetch on github.com/... corpora. No
state outside /home/claude/, which is ephemeral.
>-
---name: bm25description: >----# bm25/SKILL.mdPreguntas frecuentes
Descarga bm25/SKILL.md desde el publicador, o copia la ruta y abre el repositorio. PlugMCP lista la skill y no aloja el archivo.
El publicador lo mantiene en https://github.com/oaustegard/claude-skills.
Claude, Cursor, Codex y Grok Build pueden leer un SKILL.md que añadas desde el repositorio del publicador. Grok Bot lo instala cuando envías en un chat el enlace a la carpeta de la skill en GitHub.