Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/bayesimpact/bayes-platformnpx agentmods add rules/bayesimpact/bayes-platform/apiWrote 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/bayesimpact/bayes-platform/api)<a href="https://agentmods.dev/rules/bayesimpact/bayes-platform/api"><img src="https://agentmods.dev/badge/rules/bayesimpact/bayes-platform/api/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/bayesimpact/bayes-platform/api"><img src="https://agentmods.dev/badge/rules/bayesimpact/bayes-platform/api.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.00000 | $0.08119 |
| Opus 5 | $0.00000 | $0.04059 |
| Sonnet 5 | $0.00000 | $0.01624 |
| Haiku 4.5 | $0.00000 | $0.00812 |
Grade A, and why
api 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.
How it starts
The opening of the file, as written. The whole thing — 907 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Cursor Agent Rules for CaseAI Connect - API
NestJS Dependency Injection
Import Type Rule
When NestJS requires runtime access to classes for dependency injection (services, controllers, guards, etc.), you MUST use regular imports, not type-only imports.
Rule: If you get a NestJS DI error about a class being undefined at runtime, it means you used import type instead of import.
Solution:
- Change
import type { MyService } from './my.service'toimport { MyService } from './my.service' - Add a biome-ignore comment:
// biome-ignore lint/style/useImportType: Required at runtime for NestJS DI
When to use:
- Services injected via
@InjectRepository(),@Inject(), or constructor injection - Controllers, Guards, Interceptors, Pipes
- Any class that needs to be available at runtime for NestJS DI
When type-only imports are OK:
- DTOs, interfaces, types
- Return types, parameter types
- Anything not used for DI
Example:
// ❌ Wrong - will cause DI error
import type { UsersService } from "@/users/users.service"
// ✅ Correct
// biome-ignore lint/style/useImportType: Required at runtime for NestJS DI
import { UsersService } from "@/users/users.service"
DTO Organization
Domain-Based DTO Location
Rule: DTOs (Data Transfer Objects) MUST be co-located with their domain logic in packages/api-contracts/src/{domain}/ as a single consolidated file per domain.
Structure:
- All DTOs for a domain MUST be consolidated into a single file:
packages/api-contracts/src/{domain}/{domain}.dto.ts(e.g.,packages/api-contracts/src/projects/projects.dto.ts,packages/api-contracts/src/me/me.dto.ts) - DO NOT create separate files for each DTO (e.g.,
create-project.dto.ts,list-projects.dto.ts, etc.) - All DTOs are exported from
packages/api-contracts/src/index.tsfor consumption by both API and frontend - Controllers and routes import DTOs from
@caseai-connect/api-contracts
Why this pattern?
- Reduced file proliferation: Avoids having many small DTO files that are hard to navigate
- Better organization: All related DTOs for a domain are in one place
- Easier maintenance: Related types are easier to find and update together
- Cohesion: DTOs are tightly coupled to domain logic and API contracts
- Single source of truth: DTOs live in a shared package accessible to all consumers
- No circular dependencies: API-contracts is a separate package that API and frontend both depend on
- Frontend integration: Frontend imports directly from
@caseai-connect/api-contracts
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 · 907 lines · 0 tokens per session scan A bb654d914b94
api is a cursor rule published in the GitHub repository bayesimpact/bayes-platform (18 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 8,119 tokens. 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-09-14.
Other cursor rules, from other repositories
python
Python best practices and patterns for modern software development with Flask and SQLite.
api-property-optionality-hygiene
Fix ApiProperty/ApiPropertyOptional optionality mismatches in DTO files; use for scheduled batch fixes or DTO edits.
cursor
You are working on the checkout service. Preserve transaction integrity and auditability.
django
Definitive guidelines for writing maintainable, performant, and secure Django applications, emphasizing modern best practices, clear code organization, and efficient patterns.
shared-libraries
Shared libraries - condition framework, inventory containers, file-backed DB, itinerary, references.
env-validation-gate
Env validation gate — every app with ≥1 required env var validates its contract at boot via Zod; raw process.env is banned outside the env module. Full pattern in .claude/skills/t2000-env-gate/.