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.
npx agentmods add rules/marianfoo/mcp-sap-docs/10-search-stackgit clone --depth 1 https://github.com/marianfoo/mcp-sap-docsWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00492 | $0.00492 |
| Opus 5 | $0.00246 | $0.00246 |
| Sonnet 5 | $0.00098 | $0.00098 |
| Haiku 4.5 | $0.00049 | $0.00049 |
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 2d 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.
Copies of this mod
1 near-identical copy found in the catalogue:
- 10-search-stack — 100% identical, 0 lines differ
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.tsusing metadata APIs - Query Processing:
toMatchQuery()insrc/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
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.
- 2d ago First seen · 43 lines · 492 tokens per session scan A 764f639fc318
10-search-stack is a cursor rule published in the GitHub repository marianfoo/mcp-sap-docs (217 stars, last pushed 14d ago), licensed Apache-2.0. It adds 492 tokens to every session, about $0.0025 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.
control-plane-descriptors
Control plane descriptor and instance implementation patterns.
family-instance-domain-actions
Family instance domain action implementation patterns.