agentleFS
a365ngaya365ngay/CogniRouter/skills/senior-dotnet/SKILL.md

senior-dotnet

Skill2 starsChanged 6 days agoMITView on GitHub

Use when designing, implementing, debugging, reviewing, or refactoring C# and .NET applications, ASP.NET Core APIs or minimal APIs, Entity Framework Core, dependency injection, async code, configuration, authentication, background services, Blazor, tests, or performance.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep to the solution's existing architecture.

    line 16
  2. Very specific:

    Use async all the way: no .Result, .Wait(), or async void (except event handlers).

    line 20
  3. Very specific:

    Use IHttpClientFactory, typed options with validation, structured logging (ILogger message templates), and health checks for changed …

    line 25
  4. Very specific:

    Run dotnet build with warnings reviewed, dotnet test, and integration tests via WebApplicationFactory or Testcontainers where the project …

    line 30

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Senior .NET

Role

Deliver .NET code with clean dependency injection, correct async and EF Core behavior, consistent API contracts, and secure configuration.

Before Editing

  1. Inspect target framework, solution/project layout, nullable reference types setting, API style (controllers vs minimal APIs), MediatR/CQRS usage, EF Core version and migrations, auth setup, options/config pattern, and test projects (xUnit/NUnit, WebApplicationFactory).
  2. Trace the request from endpoint through model binding, validation, authorization, handlers/services, DbContext, external clients, and response mapping.
  3. Keep to the solution's existing architecture; do not add a new layer, mediator, or mapping library for one feature.

Implementation Rules

  • Use async all the way: no .Result, .Wait(), or async void (except event handlers); pass CancellationToken through to EF Core and HTTP calls.
  • Register services with the correct lifetime; never inject scoped services (such as DbContext) into singletons or hosted services without creating a scope.
  • In EF Core, project to DTOs with Select, use AsNoTracking for reads, avoid N+1 and client-side evaluation, paginate, and generate migrations deliberately and review their SQL.
  • Validate input (DataAnnotations or FluentValidation as the project does) and return the project's error contract (ProblemDetails).
  • Enforce authorization with policies and resource checks; keep secrets in user-secrets, environment variables, or a vault, never appsettings.json in source.
  • Use IHttpClientFactory, typed options with validation, structured logging (ILogger message templates), and health checks for changed operational paths.
  • Respect nullable annotations; do not silence warnings with ! unless the value is proven non-null.

Testing and Verification

Run dotnet build with warnings reviewed, dotnet test, and integration tests via WebApplicationFactory or Testcontainers where the project has them. Check EF Core generated SQL for changed queries.

Review Checklist

  • Is async code non-blocking and cancellable?
  • Are DI lifetimes and DbContext usage correct?
  • Are queries efficient, bounded, and migrations safe for existing data?
  • Are validation, authorization, and error mapping consistent with the rest of the API?

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.