code-searchability

code-searchability is a cursor rule for Cursor from brendadeeznuts1111/betting-brain-v3. It costs 2,529 tokens per session, scanned A, original, MIT.

A set of code-search rules using ast-grep, a tool that searches code by its structure instead of only matching words.

In plain words
What is it for?
Use it to search TypeScript and JavaScript for risks such as SQL injection, missing CORS headers, hardcoded URLs, and unstructured logs.
Why use it?
It helps find important code patterns even when the exact text differs, making security and consistency checks easier.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/brendadeeznuts1111/betting-brain-v3/code-searchability
Clone the repo
git clone --depth 1 https://github.com/brendadeeznuts1111/betting-brain-v3

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 code-searchability

README.md
[![agentmods](https://agentmods.dev/badge/rules/brendadeeznuts1111/betting-brain-v3/code-searchability.svg)](https://agentmods.dev/rules/brendadeeznuts1111/betting-brain-v3/code-searchability)
Your own site
<a href="https://agentmods.dev/rules/brendadeeznuts1111/betting-brain-v3/code-searchability"><img src="https://agentmods.dev/badge/rules/brendadeeznuts1111/betting-brain-v3/code-searchability.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,529 This file is loaded in full into every session.
When invoked 2,529 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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.02529 $0.02529
Opus 5 $0.01264 $0.01264
Sonnet 5 $0.00506 $0.00506
Haiku 4.5 $0.00253 $0.00253

Measured 5d ago against content hash 11bb424ebdec, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

code-searchability 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 5d 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.

.cursor/rules/code-searchability.mdc · 457 lines

How it starts

The opening of the file, as written. The whole thing — 457 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Overview

This codebase uses ast-grep for structural code search and pattern matching. ast-grep provides semantic search beyond simple text matching, understanding TypeScript/JavaScript syntax.

See sgconfig.yml and rules/ for complete configuration.

Quick Reference

Common Search Commands

# Search for specific patterns
ast-grep --pattern 'async function $NAME' src/
sg -p 'const $VAR = fetch($$$)' src/

# Filter by specific rules
ast-grep scan --filter "sql-injection-risk"
sg scan --filter "unstructured-log"

# Scan all rules in project
ast-grep scan
sg scan

# Search in specific files
ast-grep --pattern 'throw Errors.$METHOD($$$)' src/api/

Search by Feature

Feature Command Location
SQL Injection sg scan --filter "sql-injection-risk" All TS files
CORS Missing sg scan --filter "missing-cors-headers" All TS files
Unstructured Logs sg scan --filter "unstructured-log" All TS files
Hardcoded URLs sg scan --filter "hardcoded-url" All files
WORKER_URL Dupe sg scan --filter "worker-url-definition" Dashboard files

Installation

Install ast-grep globally:

# Using cargo (recommended)
cargo install ast-grep

# Using npm
npm install -g @ast-grep/cli

# Using brew (macOS)
brew install ast-grep

Verify installation:

sg --version

Usage Patterns

1. Finding API Endpoints

# Find all endpoint handlers
ast-grep --pattern 'async function $NAME(request: Request, env: Env, requestId: string)' src/

# Find specific endpoint
sg -p 'async function getEvents' src/api/

# Find endpoints without requestId
sg scan --filter "missing-request-id"

Example Output:

src/api/routes.ts:45:1
async function getEvents(request: Request, env: Env, requestId: string): Promise<Response> {
  // Implementation
}

2. Finding MCP Handlers

# Find all MCP tool handlers  
ast-grep --pattern 'export async function $NAME(params: $PARAMS, env: Env): Promise<MCPToolResult>' src/mcp/

# Find specific handler
sg -p 'export async function getSteamMoves' src/

# Find handlers returning MCPToolResult
sg -p 'Promise<MCPToolResult>' src/

Read the full file on GitHub · 457 lines

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. 5d ago First seen · 457 lines · 2,529 tokens per session scan A 11bb424ebdec

Subscribe to this mod's changes

code-searchability is a cursor rule published in the GitHub repository brendadeeznuts1111/betting-brain-v3 (8 stars, last pushed 11mo ago), licensed MIT. It adds 2,529 tokens to every session, about $0.0126 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-31.

Related

Other cursor rules, from other repositories