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/bayesimpact/bayes-platformWrote 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-custom-repositories)<a href="https://agentmods.dev/rules/bayesimpact/bayes-platform/api-custom-repositories"><img src="https://agentmods.dev/badge/rules/bayesimpact/bayes-platform/api-custom-repositories/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-custom-repositories"><img src="https://agentmods.dev/badge/rules/bayesimpact/bayes-platform/api-custom-repositories.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.00686 |
| Opus 5.5 | $0.00000 | $0.00274 |
| Sonnet 5.5 | $0.00000 | $0.00137 |
| Haiku 4.5 | $0.00000 | $0.00069 |
Grade A, and why
api-custom-repositories 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 1mo 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 — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Custom Repositories — No TypeORM in Services
How to add a repository: .claude/skills/custom-repository/SKILL.md and ADR 0020.
Rule: Services MUST NOT depend on TypeORM. All persistence goes through a custom {Entity}Repository that exposes only the methods the service needs.
Forbidden in services
import ... from "typeorm"or@nestjs/typeorm@InjectRepository(...)/Repository<T>- TypeORM query APIs (
find,findOne,save,create,In(), query builders) - Constructing
ConnectRepository(it wraps TypeORMRepository<T>)
Required pattern
- Add
{entity}.repository.tsas an@Injectable()Nest provider. - Inject
TransactionServiceand get the TypeORM repo inside the custom repository (getManager().getRepository(Entity)). - Expose named methods only (
createProject,findAllByIds,softDelete). Do not leak TypeORM types in the public API. - Inject the custom repository into the service. Register it in the module
providers(andexportsif other modules need it). - For connect-scoped entities, keep
ConnectRepositoryinside the custom repository. The service passesconnectScopeinto named methods. - A caller-supplied id of a connect-scoped row (
parentId,tagsToAdd, a target, a link) is loaded with thatconnectScope.findOneBy({ id })orfindBy({ id: In(ids) })is not an existence check, including when the caller is another service. Every requested id must be in that organization and project. Missing, another project, and another organization are the same 404. A parent id cannot be the row itself or a descendant.
// ✅ Service — no TypeORM
@Injectable()
export class PlatformRoleService {
constructor(private readonly platformRoleRepository: PlatformRoleRepository) {}
grantGlobalRole(userId: string, roleKey: PlatformRoleKey): Promise<boolean> {
return this.platformRoleRepository.grantGlobalRole(userId, roleKey)
}
}
// ✅ Custom repository — TypeORM stays here
@Injectable()
export class ProjectRepository {
constructor(private readonly transactionService: TransactionService) {}
async createProject(params: { organizationId: string; name: string }): Promise<ProjectRecord> {
const saved = await this.repo().save(this.repo().create(params))
return this.toRecord(saved)
}
private repo(): Repository<Project> {
return this.transactionService.getManager().getRepository(Project)
}
}
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.
- 1mo ago Changed · +1 lines 9e8ad2a9f385
- 1mo ago Changed · +2 lines 5c56ef77f01b
- 1mo ago First seen · 62 lines · 0 tokens per session scan A 6e5ec3bd1f68
api-custom-repositories 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 686 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-24.
api-custom-repositories compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| api-custom-repositoriesbayesimpact/bayes-platform | Cursor rule | 23 | yesterday | MIT | A | 0 | Cursor |
| vibes-plug-backendroedyrustam/vibes-plug | Cursor rule | 121 | yesterday | MIT | A | 0 | Cursor |
| ehs-ims-conventionsSafetyMP/Autonomous-EHS-Management | Cursor rule | 9 | 6d ago | Apache-2.0 | A | 722 | Cursor |
| rulesforconvexwaynesutton/markdown-site | Cursor rule | 627 | 5mo ago | MIT | A | 514 | Cursor |
| startup-migration-bounded-workTACC/HPCPerfStats | Cursor rule | 60 | yesterday | LGPL-2.1 | A | 0 | Cursor |
| convex-development---generalWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 2d ago | none | A | 84 | Cursor |
| redis_rate_limitingjondoescoding/jondoescoding-coding-rules | Cursor rule | 2 | 3mo ago | MIT | A | 15 | Cursor |