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/brendadeeznuts1111/betting-brain-v3/code-searchabilitygit clone --depth 1 https://github.com/brendadeeznuts1111/betting-brain-v3Wrote 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.
[](https://agentmods.dev/rules/brendadeeznuts1111/betting-brain-v3/code-searchability)<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>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.
| Model | Per session | Once 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 |
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.
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/
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.
- 5d ago First seen · 457 lines · 2,529 tokens per session scan A 11bb424ebdec
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.
Other cursor rules, from other repositories
workers-patterns
Skim this on every task that touches workers, env, routes, or bindings.
git-workflow
Cloud Agents MUST run git add, git commit, and git push before ending their response when they have made code changes. Do not end your turn without pushing. ALWAYS use Pull Requests instead of pushing directly to main.
typescript-imports
Golden rule: import each symbol from the module that defines it. A package index.ts may barrel only its own ./ modules — never another package.
new-env-var-checklist
Checklist when adding any new env secret/variable — Turbo globalEnv, GitHub sync, workflow maps, Alchemy bindings. Prevents "secret synced but worker never gets it".
dev-server
Do not start dev servers or long-running watch processes unless the user explicitly asks (e.g. “run dev”, “verify in the browser”). If they do, use the project’s bun run dev from the repo root and stop or ask before leaving a server running forever.
generated-artifacts
Agents must not manually author generated files. If generated output needs to change, edit the source-of-truth file and run the generator. If the generator fails, fix the source or generator instead of fabricating output.