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/goranerhartic/cursor-development-rules/ef-coregit clone --depth 1 https://github.com/GoranErhartic/cursor-development-rulesWhat 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 | $0.00014 | $0.00922 |
| Opus 5 | $0.00007 | $0.00461 |
| Sonnet 5 | $0.00003 | $0.00184 |
| Haiku 4.5 | $0.00001 | $0.00092 |
Grade A, and why
ef-core 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 — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Entity Framework Core Patterns
DbContext Configuration
public sealed class AppDbContext : DbContext
{
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { }
public DbSet<User> Users => Set<User>();
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.ApplyConfigurationsFromAssembly(typeof(AppDbContext).Assembly);
}
}
Entity Configuration
public sealed class UserConfiguration : IEntityTypeConfiguration<User>
{
public void Configure(EntityTypeBuilder<User> builder)
{
builder.ToTable("Users");
builder.HasKey(x => x.Id);
builder.Property(x => x.Email).HasMaxLength(256).IsRequired();
builder.HasIndex(x => x.Email).IsUnique();
}
}
Repository Pattern
public interface IUserRepository
{
Task<User?> GetByIdAsync(Guid id, CancellationToken ct = default);
Task<User?> GetByEmailAsync(string email, CancellationToken ct = default);
void Add(User user);
void Remove(User user);
}
Query Best Practices
| Scenario | Approach |
|---|---|
| Read-only queries | .AsNoTracking() |
| Single item | .FirstOrDefaultAsync() (not .SingleOrDefaultAsync() unless uniqueness matters) |
| Exists check | .AnyAsync() |
| Count | .CountAsync() |
| Projections | .Select(x => new Dto { ... }) — avoid loading full entities |
| Pagination | .Skip(n).Take(m) after ordering |
Anti-Patterns to Avoid
- NEVER use
.ToList()then LINQ — query in database - NEVER load navigation properties you don't need
- NEVER use
Include()for read-only projections — useSelect() - NEVER call
SaveChangesAsync()multiple times per operation
Migrations
dotnet ef migrations add MigrationName --project src/Infrastructure --startup-project src/Api
dotnet ef database update --project src/Infrastructure --startup-project src/Api
- ALWAYS review generated migrations before applying
- NEVER modify existing migrations after they're applied
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 First seen · 154 lines · 14 tokens per session scan A 1b38d4369c86
ef-core is a cursor rule published in the GitHub repository GoranErhartic/cursor-development-rules (19 stars, last pushed 6mo ago), licensed MIT. It adds 14 tokens to every session and 922 once invoked, about $0.0001 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-30.
Other cursor rules, from other repositories
database-design
Database design guidelines — relational normalisation, indexing, constraints, NoSQL patterns, query optimisation, migrations, security, and backup strategies. Applied when working with database schemas and queries.
backend-dev
Backend development workflow with Java/Python/Node.js - 后端开发完整工作流.
supabase-migrations
You are a Postgres Expert who loves creating secure database schemas.
database-patterns
Cursor rule "database-patterns" from floriscornel/todo-mcp, covering database development patterns, schema changes, database operations, schema patterns and migration best practices.
database
Cursor rule "database" from ItamarZand88/awesome-agent-conventions, covering database best practices, prisma setup, prisma models, prisma queries and supabase setup.
sqlite
本规范为 SQLite 开发提供全面指导,涵盖架构设计、性能优化、安全性、测试等最佳实践。旨在确保高效、安全和可维护的 SQLite 数据库应用程序。.