Files
MyAiConfiguration/shared/skills/reviews/efcore-review/evals/evals.json
T
Julian Lechner f5d8f6f11b
CI / CI configuration security checks (push) Successful in 3s
CI / Capabilities and shell quality (push) Successful in 14s
CI / Python tests and compilation (push) Successful in 26s
CI / QMD unit tests (push) Successful in 5s
CI / Build and inspect generated packages (push) Successful in 14s
CI / PowerShell tests on Ubuntu (push) Successful in 1m4s
CI / Installed client configuration smoke tests (push) Successful in 33s
CI / Bash integration and installation guards (push) Successful in 1m1s
feat(skills): reworked skills and rules
2026-11-18 14:17:49 +01:00

59 lines
5.3 KiB
JSON

{
"skill_name": "efcore-review",
"evals": [
{
"id": 1,
"prompt": "Review this EF Core 8 code (SQL Server provider):\n\n```csharp\npublic async Task<List<OrderSummary>> GetRecentOrders(Guid tenantId)\n{\n var orders = _db.Orders.ToList()\n .Where(o => o.TenantId == tenantId && o.CreatedAt > DateTime.UtcNow.AddDays(-30));\n var result = new List<OrderSummary>();\n foreach (var o in orders)\n {\n var lines = await _db.OrderLines.Where(l => l.OrderId == o.Id).ToListAsync();\n result.Add(new OrderSummary(o.Id, lines.Sum(l => l.Price * l.Quantity)));\n }\n return result;\n}\n```",
"expected_output": "Should flag that ToList() materializes the entire Orders table before filtering, including all tenants' rows, so filters are not applied before materialization. Should flag the N+1 query for OrderLines inside the loop. Should note unnecessary tracking for a read-only summary (AsNoTracking or projection) and the unbounded result set. Should propose a single projected query with the filter and aggregate translated to SQL. Should report the query path, runtime impact, and provider-aware verification (e.g. inspect generated SQL via ToQueryString or logging). Should not recommend indexes without evidence of query need.",
"assertions": [
"Flags that ToList() before Where loads the entire Orders table into memory",
"Notes that rows from all tenants are materialized before tenant filtering",
"Flags the N+1 query pattern for OrderLines",
"Recommends a single server-side projected query with filtering and aggregation",
"Mentions AsNoTracking or projection to avoid unnecessary tracking",
"Recommends provider-aware verification such as inspecting the generated SQL",
"Does not recommend adding an index without evidence of need"
],
"files": []
},
{
"id": 2,
"prompt": "Migration review (EF Core 7, PostgreSQL via Npgsql). We deploy with rolling updates; old and new app versions run together for a few minutes.\n\n```csharp\nprotected override void Up(MigrationBuilder mb)\n{\n mb.RenameColumn(name: \"FullName\", table: \"Customers\", newName: \"DisplayName\");\n mb.AlterColumn<string>(name: \"Email\", table: \"Customers\", nullable: false, oldNullable: true);\n}\nprotected override void Down(MigrationBuilder mb) { }\n```",
"expected_output": "Should flag that renaming FullName breaks the old app version still running during rolling deployment. Should flag that making Email non-nullable fails if existing rows contain NULL and needs a data backfill first. Should flag the empty Down method as a rollback limitation. Should recommend an expand/contract approach (add new column, backfill, switch, later drop) and checking the generated SQL. Report with migration path, data impact, and provider-aware verification.",
"assertions": [
"Flags the column rename as incompatible with the old app version during rolling deployment",
"Flags that AlterColumn to non-nullable fails or loses data if existing rows have NULL Email",
"Recommends backfilling Email before enforcing NOT NULL",
"Flags the empty Down method as a rollback limitation",
"Recommends an additive expand-and-contract migration sequence",
"Recommends reviewing the generated SQL for PostgreSQL"
],
"files": []
},
{
"id": 3,
"prompt": "Small query, can you review it? EF Core 8, SQL Server.\n\n```csharp\nvar customer = await _db.Customers\n .AsNoTracking()\n .Where(c => c.Id == id && c.TenantId == currentTenant.Id)\n .Select(c => new CustomerDto(c.Id, c.Name, c.Email))\n .SingleOrDefaultAsync(ct);\n```\nAlso, should we add Redis caching and an index on Name to make it faster?",
"expected_output": "This query is well formed: filtered server-side, tenant-scoped, projected, no tracking, cancellation passed. Should state no concrete defects. Should not recommend Redis caching or an index on Name without evidence of a query need (Name is not used in the filter; Id is presumably the primary key). May suggest measuring first if there is a performance concern.",
"assertions": [
"States that no concrete defect was found in the query",
"Acknowledges the tenant filter is applied server-side",
"Does not recommend an index on Name, noting Name is not part of the filter or that there is no evidence of need",
"Does not recommend Redis caching without evidence of a performance need",
"Suggests measurement or evidence before optimization if performance is a concern"
],
"files": []
},
{
"id": 4,
"prompt": "EF Core review please.\n\n```diff\n # src/utils/format.ts\n-export const money = (v: number) => v.toFixed(2);\n+export const money = (v: number, c = 'EUR') => new Intl.NumberFormat('de-AT', { style: 'currency', currency: c }).format(v);\n```",
"expected_output": "The diff is a TypeScript formatting helper with no EF Core query, model, migration, or persistence code. Should state that efcore-review is out of scope and report no EF Core findings.",
"assertions": [
"States that the diff contains no EF Core or persistence code",
"Reports no EF Core findings",
"Does not invent query, migration, or DbContext issues"
],
"files": []
}
]
}