agentleFS
RidhuanDEVRidhuanDEV/claude-skills/shadow-search/SKILL.md

shadow-search

Skill1 starsChanged yesterdayMITView on GitHub

Search, Retrieval & Ranking Engineering. Use when designing or tuning lexical BM25, Indonesian morphology/analyzers, vector ANN, hybrid RRF fusion, cross-encoder reranking, PIT/search_after pagination, zero-downtime alias reindexing, Recall@K/MRR@K/NDCG@K benchmarks, or search tenant ACL prefiltering. Do NOT use for LLM answer faithfulness (shadow-eval), general Redis cache (shadow-cache), or arbitrary SQL tuning (shadow-db).

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Owner: Search pipelines (lexical, vector, hybrid RRF, rerank), analyzer/morphology tuning (Indonesian + English), ranking metrics …

    line 8
  2. Very specific:

    No Uncalibrated Fixed Thresholds: Never pick arbitrary fixed cosine similarity cutoffs (e.g., score > 0.78) without held-out evaluation …

    line 13
  3. Very specific:

    Read methodologies/HYBRID-BM25-VECTOR-RRF-AND-ACL.md and playbooks/SEARCH-RELEVANCE-AND-MIGRATION-PLAYBOOK.md:

    line 16
  4. Distinctive:

    Verify Tenant ACL & Freshness Tombstones: Test cross-tenant isolation and near-real-time document deletion/revocation.

    line 21

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/shadow-search — Search, Retrieval & Ranking Engineering

  • Owner: Search pipelines (lexical, vector, hybrid RRF, rerank), analyzer/morphology tuning (Indonesian + English), ranking metrics (Recall@K, MRR@K, NDCG@K), zero-downtime reindex, and tenant ACL prefiltering.
  • Boundaries: LLM generation faithfulness/red-teaming (shadow-eval), Redis key caching (shadow-cache), OLTP SQL query tuning (shadow-db).

1. Preconditions, ACL Safety & Calibration Rules

  • Tenant ACL Prefilter Mandatory: Filter tenant_id and permission_scopes inside the lexical/vector retrieval query BEFORE top-K scoring and caching — NEVER post-filter top-K results (which leaks existence or returns empty pages) and NEVER return deleted/revoked documents.
  • No Uncalibrated Fixed Thresholds: Never pick arbitrary fixed cosine similarity cutoffs (e.g., score > 0.78) without held-out evaluation curves across languages/slang.

2. 7-Step Search Engineering Playbook

Read methodologies/HYBRID-BM25-VECTOR-RRF-AND-ACL.md and playbooks/SEARCH-RELEVANCE-AND-MIGRATION-PLAYBOOK.md:

  1. Characterize Query Tasks: Separate exact ID/SKU/pasal lookup (lexical BM25) from conceptual semantic queries (dense vector + hybrid RRF).
  2. Design Indonesian + Domain Analyzers: Handle slang/typo fuzziness, stopwords carefully, stemming vs exact keyword subfields (keyword + text).
  3. Curate Held-Out Relevance Judgments: Graded relevance (0..3) with Indonesian slang, near-duplicates, and high-selectivity filters.
  4. Measure Baseline (Recall@K, MRR@K, NDCG@K): Evaluate retrieval independently from LLM answer generation (/shadow-eval).
  5. Verify Tenant ACL & Freshness Tombstones: Test cross-tenant isolation and near-real-time document deletion/revocation.
  6. Tune Hybrid RRF / Rerank Under Latency & Cost Budget: Compare lexical-only vs vector-only vs RRF ($k=60$) + optional cross-encoder rerank.
  7. Zero-Downtime Alias Reindexing: Build index_v2 -> backfill -> verify counts/parity -> atomic alias swap (index_live), keeping index_v1 for instant rollback.
python "shadow-search/scripts/search_relevance_acl_gate.py" --self-test
python "shadow-search/scripts/search_relevance_acl_gate.py" --evaluate path/to/search_eval.json

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.