10-search-stack

10-search-stack is a cursor rule for Cursor from marianfoo/abap-mcp-server. It costs 492 tokens per session, scanned A, a copy of 10-search-stack, Apache-2.0.

A project rulebook for changing search behavior, ranking, or index-building code in a documentation search system.

In plain words
What is it for?
Use it when modifying indexes, BM25 ranking, prefix or phrase matching, source boosts, context detection, or documentation URL and library mappings.
Why use it?
It keeps search changes aligned with the existing indexing, SQLite full-text search, scoring, metadata, and query-processing design.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when modifying indexes, BM25 ranking, prefix or phrase matching, source boosts, context detection, or documentation URL and library mappings.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/marianfoo/abap-mcp-server/10-search-stack
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/marianfoo/abap-mcp-server

Made for: Cursor.

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 10-search-stack

README.md
[![agentmods](https://agentmods.dev/badge/rules/marianfoo/abap-mcp-server/10-search-stack/github.svg)](https://agentmods.dev/rules/marianfoo/abap-mcp-server/10-search-stack)
Your own site
<a href="https://agentmods.dev/rules/marianfoo/abap-mcp-server/10-search-stack"><img src="https://agentmods.dev/badge/rules/marianfoo/abap-mcp-server/10-search-stack/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 10-search-stack

Your own site · 80×15
<a href="https://agentmods.dev/rules/marianfoo/abap-mcp-server/10-search-stack"><img src="https://agentmods.dev/badge/rules/marianfoo/abap-mcp-server/10-search-stack.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 492 This file is loaded in full into every session.
When invoked 492 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod 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.00492 $0.00492
Opus 5.5 $0.00197 $0.00197
Sonnet 5.5 $0.00098 $0.00098
Haiku 4.5 $0.00049 $0.00049

Measured 1mo ago against content hash 764f639fc318, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

10-search-stack 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 1mo 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.

Origin

This is a copy

100% identical to 10-search-stack — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.cursor/rules/10-search-stack.mdc · 43 lines

What it actually says

Search & Indexing (Rule)

When modifying search behavior, ranking, or index builds.

Search Architecture (BM25-Only with FTS5)

  • Index Build: scripts/build-index.ts → dist/data/index.json
  • FTS Database: scripts/build-fts.ts → dist/data/docs.sqlite (SQLite FTS5)
  • Hybrid Search: FTS5 candidate filtering → sophisticated scoring
  • Search Logic: Pure BM25 via src/lib/search.ts using metadata APIs
  • Query Processing: toMatchQuery() in src/lib/searchDb.ts
  • Configuration: All source settings in src/metadata.json
  • Performance: 16x faster with FTS5 hybrid approach (~42ms vs 700ms)

Metadata-Driven Configuration

  • Source Boosts: Context-aware scoring via getContextBoosts()
  • Library Mappings: ID resolution via getAllLibraryMappings()
  • URL Generation: Documentation links via getDocUrlConfig()
  • Source Paths: File system paths via getSourcePath()

Key Search Features

  • OR Logic: Better recall for multi-term queries
  • Prefix Matching: Terms get * suffix for broader matching
  • Phrase Queries: Dotted terms (sap.m.Button) quoted for exact match
  • Context Awareness: UI5/CAP/wdi5 context detection and scoring
  • ABAP Version Filtering: Intelligent version detection and result filtering
  • Graceful Fallback: Falls back to full search if FTS finds no candidates

Performance

  • FTS5: SQLite full-text search for sub-second response times
  • Centralized Config: Single metadata load at startup
  • Efficient APIs: Type-safe configuration access

@file scripts/build-index.ts @file scripts/build-fts.ts @file src/lib/searchDb.ts @file src/lib/search.ts @file src/lib/metadata.ts @file src/metadata.json @file src/lib/localDocs.ts @file docs/FTS5-IMPLEMENTATION-COMPLETE.md @file docs/ABAP-INTEGRATION-SUMMARY.md @file docs/ARCHITECTURE.md @file docs/DEV.md

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. 1mo ago First seen · 43 lines · 492 tokens per session scan A 764f639fc318

Subscribe to this mod's changes

10-search-stack is a cursor rule published in the GitHub repository marianfoo/abap-mcp-server (95 stars, last pushed today), licensed Apache-2.0. It adds 492 tokens to every session, about $0.0020 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to 10-search-stack, differing in 0 lines, and is treated as a copy.