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 skills add managedcode/dotnet-skills --skill optimizing-ef-core-queriesgit clone --depth 1 https://github.com/managedcode/dotnet-skillsWrote 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/skills/managedcode/dotnet-skills/optimizing-ef-core-queries)<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/optimizing-ef-core-queries"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/optimizing-ef-core-queries/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/skills/managedcode/dotnet-skills/optimizing-ef-core-queries"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/optimizing-ef-core-queries.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.00116 | $0.04928 |
| Opus 5.5 | $0.00046 | $0.01971 |
| Sonnet 5.5 | $0.00023 | $0.00986 |
| Haiku 4.5 | $0.00012 | $0.00493 |
Grade A, and why
optimizing-ef-core-queries 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.
This is a copy
100% identical to optimizing-ef-core-queries — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 282 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Optimizing EF Core Queries
Diagnose and fix slow or incorrect application data access built on EF Core. In a source-only review, trace the code without executing it and separate proven code behavior from runtime assumptions. When SQL, logs, or plans are available, use them to confirm the bottleneck. Prefer changes that reduce round-trips, duplicated rows, scans, or per-call translation cost over micro-optimizations.
When to Use
- EF Core queries are slow or emit far more SQL statements than expected
- The same query repeats once per row (N+1 / lazy loading)
- Multiple collection
Includes blow up or duplicate rows - Deep pages slow down as
Skipgrows, or bulk updates load rows just to modify them - A filtered/sorted query scans even though the column is indexed, or a filtered/sorted column has no supporting index
- A hot, frequently-executed query pays EF Core's LINQ-translation cost on every call
When Not to Use
- The code uses Dapper or raw ADO.NET, not EF Core. Answer the SQL/indexing/query-plan question directly; do not introduce a
DbContextor recommendAsNoTracking,Include,AsSplitQuery, or other EF Core APIs.
Source review workflow
- Find the EF boundary:
DbContext,DbSet, repository implementation, unit of work, query helper, or model-building code. Follow the implementation rather than assuming what an interface method does. - Trace each query to execution or enumeration. Check whether operators bind to
QueryableorEnumerable, including inside helpers; anIEnumerablecan remain a deferred database sequence. - Count database operations and actual transaction boundaries along the calling path, including immediate writes and repeated enumeration. Also track which operations share the same
DbContextinstance - For every execution path, independently inspect predicates, expression construction, projection contents, result bounds, ordering, Includes, tracking, SQL parameterization, and model-building code.
- Preserve the contract: result membership and order, random-page access, generated keys, retries, transaction and partial-failure behavior, concurrency handling, and domain/interceptor side effects.
- Report prioritized findings with locations, the affected call path, concrete impact, and a safe remedy. Briefly identify sound counterparts and state what was not validated. Do not equate source reasoning with measured plans or speedups.
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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 · +122 lines · +30 tokens per session a4c0d87d624f
- 2mo ago First seen · 160 lines · 86 tokens per session scan A 674fe2a77386
optimizing-ef-core-queries is a skill published in the GitHub repository managedcode/dotnet-skills (527 stars, last pushed 16d ago), licensed MIT. It adds 116 tokens to every session and 4,928 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to optimizing-ef-core-queries, differing in 0 lines, and is treated as a copy.
optimizing-ef-core-queries compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| optimizing-ef-core-queriesmanagedcode/dotnet-skills | Skill | 527 | 16d ago | MIT | A | 116 | Claude Code, Codex |
| agent-bom-troubleshootLeoYeAI/openclaw-master-skills | Skill | 2.2k | 8d ago | MIT | A | 53 | Claude Code, Codex |
| windbg-diagnostic-methodmicrosoft/win-dev-skills | Skill | 521 | 13d ago | MIT | A | 42 | Claude Code |
| windbg-kernel-bugcheck-triagemicrosoft/win-dev-skills | Skill | 521 | 13d ago | MIT | A | 50 | Claude Code |
| windbg-user-exception-triagemicrosoft/win-dev-skills | Skill | 521 | 13d ago | MIT | A | 69 | Claude Code |
| windbg-user-heap-corruption-investigationmicrosoft/win-dev-skills | Skill | 521 | 13d ago | MIT | A | 46 | Claude Code |
| windbg-user-virtual-memory-exhaustionmicrosoft/win-dev-skills | Skill | 521 | 13d ago | MIT | A | 54 | Claude Code |