database-performance

database-performance is a skill for Claude Code from Aaronontheweb/dotnet-skills. It costs 44 tokens per session (3,276 once invoked), scanned A, original, MIT.

Guidance for accessing databases efficiently with EF Core or Dapper, two tools for working with data from .NET applications.

In plain words
What is it for?
Use it when designing data-access layers, improving slow queries, separating read and write models, limiting results, and choosing how database joins and tracking should work.
Why use it?
It helps avoid slow patterns such as fetching related data one item at a time, retrieving unnecessary rows, or joining data in application code.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the dotnet-skills plugin — 39 skills, 6 agents shipped together

Good fit Use it when designing data-access layers, improving slow queries, separating read and write models, limiting results, and choosing how database joins and tracking should work.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aaronontheweb/dotnet-skills/database-performance
About the project

.NET Skills is an AI coding plugin that provides skills and specialized guidance for professional .NET development, covering areas such as C#, Akka.NET, Aspire, Entity Framework Core, testing, and performance. .NET developers use it with coding assistants to apply production-oriented patterns while building and maintaining applications. The catalogue contains the plugin’s skills, agents, and instructions.

Aaronontheweb/dotnet-skills · 1,234 stars · on GitHub

Install

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.

Any agent
npx skills add Aaronontheweb/dotnet-skills --skill database-performance
Clone the repo
git clone --depth 1 https://github.com/Aaronontheweb/dotnet-skills

Made for: Claude Code.

Or install dotnet-skills, the plugin that ships this one along with the rest of its 39 skills, 6 agents.

Wrote 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.

agentmods badge for database-performance

README.md
[![agentmods](https://agentmods.dev/badge/skills/aaronontheweb/dotnet-skills/database-performance/github.svg)](https://agentmods.dev/skills/aaronontheweb/dotnet-skills/database-performance)
Your own site
<a href="https://agentmods.dev/skills/aaronontheweb/dotnet-skills/database-performance"><img src="https://agentmods.dev/badge/skills/aaronontheweb/dotnet-skills/database-performance/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.

agentmods 80×15 button for database-performance

Your own site · 80×15
<a href="https://agentmods.dev/skills/aaronontheweb/dotnet-skills/database-performance"><img src="https://agentmods.dev/badge/skills/aaronontheweb/dotnet-skills/database-performance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,276 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 15 Sept 2026
  • Snyk pass 15 Sept 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00044 $0.03276
Opus 5.5 $0.00018 $0.01310
Sonnet 5.5 $0.00009 $0.00655
Haiku 4.5 $0.00004 $0.00328

Measured 11d ago against content hash 9207582ee07b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

database-performance 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 11d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

skills/database-performance/SKILL.md · 506 lines

How it starts

The opening of the file, as written. The whole thing — 506 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Database Performance Patterns

When to Use This Skill

Use this skill when:

  • Designing data access layers
  • Optimizing slow database queries
  • Choosing between EF Core and Dapper
  • Avoiding common performance pitfalls

Core Principles

  1. Separate read and write models - Don't use the same types for both
  2. Think in batches - Avoid N+1 queries
  3. Only retrieve what you need - No SELECT *
  4. Apply row limits - Always have a configurable Take/Limit
  5. Do joins in SQL - Never in application code
  6. AsNoTracking for reads - EF Core change tracking is expensive

Read/Write Model Separation (CQRS Pattern)

Read and write models are fundamentally different - they have different shapes, columns, and purposes. Don't create a single "User" entity and reuse it everywhere.

  • Read models are denormalized, optimized for query efficiency, and return multiple projection types (UserProfile, UserSummary, UserDetailForAdmin)
  • Write models are normalized, validation-focused, and accept strongly-typed commands (CreateUserCommand, UpdateUserCommand)

Architecture

src/
  MyApp.Data/
    Users/
      # Read side - multiple optimized projections
      IUserReadStore.cs
      PostgresUserReadStore.cs

      # Write side - command handlers
      IUserWriteStore.cs
      PostgresUserWriteStore.cs

      # Read DTOs - lightweight, denormalized
      UserProfile.cs
      UserSummary.cs

      # Write commands - validation-focused
      CreateUserCommand.cs
      UpdateUserCommand.cs
    Orders/
      IOrderReadStore.cs
      IOrderWriteStore.cs
      (similar structure...)

Read Store Interface

// Read models: Multiple specialized projections optimized for different use cases
public interface IUserReadStore
{
    // Returns detailed profile for single-user view
    Task<UserProfile?> GetByIdAsync(UserId id, CancellationToken ct = default);

    // Returns lightweight info for lookups
    Task<UserProfile?> GetByEmailAsync(EmailAddress email, CancellationToken ct = default);

    // Returns paginated summaries - only what the list view needs
    Task<IReadOnlyList<UserSummary>> GetAllAsync(int limit, UserId? cursor = null, CancellationToken ct = default);

    // Boolean query - no entity needed
    Task<bool> EmailExistsAsync(EmailAddress email, CancellationToken ct = default);
}

Read the full file on GitHub · 506 lines

Changes

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.

  1. 11d ago Changed 9207582ee07b
  2. 1mo ago First seen · 506 lines · 44 tokens per session scan A a2ae01737a39

Subscribe to this mod's changes

database-performance is a skill published in the GitHub repository Aaronontheweb/dotnet-skills (1,234 stars, last pushed 9d ago), licensed MIT. It adds 44 tokens to every session and 3,276 once invoked, about $0.0002 per session on Opus 5.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.

Related

Other skills, from other repositories

database-performance

Database access patterns for performance. Separate read/write models, avoid N+1 queries, use AsNoTracking, apply row limits, and never do application-side joins. Works with EF Core and Dapper.

F-U-S-E-E/FuseDevelopmentGroup · 44 tokens

database-performance

Database access patterns for performance. Separate read/write models, avoid N+1 queries, use AsNoTracking, apply row limits, and never do application-side joins. Works with EF Core and Dapper.

ComeOnOliver/skillshub · 44 tokens

doctrine-fetch-modes

Optimize Doctrine fetching with DTO hydration (SELECT NEW), fetch joins, lazy loading, query hints, and DBAL 4 access.

dev-toolings/superpowers-symfony · 31 tokens

doctrine-batch-processing

Process large datasets with Doctrine (ORM 3 toIterable, flush+clear, bulk DQL) and memory management.

dev-toolings/superpowers-symfony · 29 tokens

backend-cqrs-patterns

Use this skill when the user says 'CQRS', 'command query segregation', 'separate read write model', 'command model', 'query model', 'read model', 'write model', 'materialized view', 'command handler', 'query handler'. This skill enforces: strict command/query separation, write model optimized for consistency, read…

j4flmao/agent-skills · 125 tokens

database-testing

Database schema validation, data integrity testing, migration testing, transaction isolation, and query performance. Use when testing data persistence, ensuring referential integrity, or validating database migrations.

proffesor-for-testing/agentic-qe · 37 tokens