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.
git 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/ai-friendly-testing)<a href="https://agentmods.dev/rules/brendadeeznuts1111/betting-brain-v3/ai-friendly-testing"><img src="https://agentmods.dev/badge/rules/brendadeeznuts1111/betting-brain-v3/ai-friendly-testing/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.
<a href="https://agentmods.dev/rules/brendadeeznuts1111/betting-brain-v3/ai-friendly-testing"><img src="https://agentmods.dev/badge/rules/brendadeeznuts1111/betting-brain-v3/ai-friendly-testing.svg" alt="Reviewed on agentmods" width="80" 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.02076 | $0.02076 |
| Opus 5 | $0.01038 | $0.01038 |
| Sonnet 5 | $0.00415 | $0.00415 |
| Haiku 4.5 | $0.00208 | $0.00208 |
Grade A, and why
ai-friendly-testing 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 10d 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 — 352 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AI-Friendly Testing Patterns
Bun Test with AI Integration
Always use AI-friendly test output when working with AI assistants:
# Dedicated AI command (preferred)
bun run test:ai
# Environment variable approach
CLAUDECODE=1 bun test
CLAUDECODE=1 bun test tests/unit
CLAUDECODE=1 bun test --coverage
Auto-Detection
CI scripts automatically detect AI environments:
CLAUDECODE=1- Claude CodeREPL_ID=1- Replit AIAGENT=1- Generic AI agent
Commands that auto-enable quiet mode:
bun run ci:local # ✅ Auto-detects AI environment
bun run ci:bun # ✅ Auto-detects AI environment
Benefits
- ✅ Shows only test failures (not passing tests)
- ✅ Reduces output verbosity for AI context windows
- ✅ Preserves failure details and summaries
- ✅ Improves readability in AI sessions
Test Mock Patterns
For D1 database mocks, handle both regular and cost cap queries:
mockEnv = {
ANALYTICS: {
prepare: (query: string) => {
// Handle cost cap queries (dbstat)
if (query.includes('dbstat') || query.includes('SUM(pgsize)')) {
return {
first: async () => ({ size: 1000000, rows: 1000 }),
bind: () => ({ first: async () => ({ size: 1000000, rows: 1000 }) }),
run: async () => ({ success: true }),
all: async () => []
};
}
// Handle regular queries
return {
bind: (...params: any[]) => ({
first: async () => ({ /* your data */ })
}),
first: async () => null,
run: async () => ({ success: true }),
all: async () => []
};
}
}
};
Environment Variables
Set any of these to enable quiet mode:
| Variable | Use Case |
|---|---|
CLAUDECODE=1 |
Claude Code sessions |
REPL_ID=1 |
Replit AI environments |
AGENT=1 |
Generic AI agent flag |
Package Scripts
Available in package.json:
{
"scripts": {
"test:ai": "CLAUDECODE=1 bun test",
"test": "bun test",
"test:unit": "bun test tests/unit",
"test:integration": "bun test tests/integration"
}
}
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.
- 10d ago First seen · 352 lines · 2,076 tokens per session scan A c8f1244f2121
ai-friendly-testing is a cursor rule published in the GitHub repository brendadeeznuts1111/betting-brain-v3 (8 stars, last pushed 11mo ago), licensed MIT. It adds 2,076 tokens to every session, about $0.0104 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
testing-anti-patterns
Guidelines for avoiding misleading or weak tests. They say tests should check real application behavior, use mocks only when needed for isolation, and avoid adding code to production solely for testing.
test-scripts
A Vitest test-script rule for projects that contain multiple test projects. It requires selecting a project by name instead of filtering tests with a fixed directory path.
verify-gate-chain
A verification standard that defines an ordered chain of automatic checks, from formatting and type checks through tests and optional health checks.
vitest-config
Shared @repo/vitest-config factories - dual entries, Turbo package caching, Node vs Workers knobs.
testing
Vitest testing discipline - trust boundaries, no weakening source to pass tests.
use-contract-ir-factories
Use factory functions for creating ContractIR objects instead of manual object creation.