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.08383 |
| Opus 5.5 | $0.00000 | $0.03353 |
| Sonnet 5.5 | $0.00000 | $0.01677 |
| Haiku 4.5 | $0.00000 | $0.00838 |
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 3d 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 — 892 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, custom repositories and
TransactionServiceinjected through the constructor or@Inject() - 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.
- 3d ago Changed 194f3f4efbc8
- 17d ago Changed · +1 lines d5f3f08bcebd
- 1mo ago Changed · +22 lines 3758df50026a
- 1mo ago Changed 3688e25c7a48
- 1mo ago Changed · -36 lines a4686cb9c14a
- 1mo ago Changed · -2 lines 68fa7f171258
- 1mo 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 (23 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 8,383 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.
api compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| apibayesimpact/bayes-platform | Cursor rule | 23 | yesterday | MIT | A | 0 | Cursor |
| api-property-optionality-hygienenovuhq/novu | Cursor rule | 40k | yesterday | none | A | 0 | Cursor |
| pythonPatrickJS/awesome-cursorrules | Cursor rule | 41k | 5mo ago | CC0-1.0 | A | 734 | Cursor |
| cursormrwogu/promptscript | Cursor rule | 355 | 2d ago | MIT | A | 53 | Cursor |
| djangosanjeed5/awesome-cursor-rules-mdc | Cursor rule | 3.6k | 5mo ago | CC0-1.0 | A | 2,043 | Cursor |
| selectools-providersjohnnichev/selectools | Cursor rule | 11 | 4d ago | Apache-2.0 | A | 0 | Cursor |
| ehs-ims-conventionsSafetyMP/Autonomous-EHS-Management | Cursor rule | 9 | 6d ago | Apache-2.0 | A | 722 | Cursor |