C# Conventions

Interní pravidla C# 12 / .NET 8: Result pattern, hygiena EF dotazů, asynchronní disciplína

od alexander-danilenko · alexander-danilenko/cortex-ai-skills

Otestováno · Funguje ★ 8.0/10

C# Conventions — Interní pravidla C# 12 / .NET 8: Result pattern, hygiena EF dotazů, asynchronní disciplína

Co umí

Kompaktní sada názorových C# 12 / .NET 8+ konvencí pokrývající nullable-as-errors, records a primary constructors, the Result pattern pro očekávaná selhání, CancellationToken na každé async method, IOptions a IHttpClientFactory a EF Core rules like AsNoTracking, AsSplitQuery, ExecuteUpdateAsync a global soft-delete query filters. Načítá se vždy, když píšete nebo revidujete C# v kódové základně ASP.NET Core, EF Core nebo Blazor. Všimněte si, že navzdory repo README, CQRS/MediatR guidance lives in the sibling dotnet-core skill, not here.

Testovací report

Spustil jsem to proti záměrně rozbitému ASP.NET Core kontroleru a porovnal s no-skill review of the same file. Skill vyprodukoval seven concrete fixes the plain review did not, including the one genuine latent bug: PurgeInactive sets IsDeleted but no query filters on it, and the skill's global HasQueryFilter convention catches that soft-deleted users keep coming back from GET /users/{id}. Také pojmenoval exact APIs the generic review only gestured at — AsSplitQuery for the two collection Includes, ExecuteUpdateAsync for the bulk flag flip, IOptions with ValidateOnStart for the stringly-typed API key. Jeho slepé místo je bezpečnost: the body says nothing about the interpolated FromSqlRaw SQL injection or the hardcoded sa password, both of which the no-skill review caught. 573 words, no scripts and no bundled files to rot, and the repo README's 'CQRS with MediatR' claim for this skill is actually content from the sibling dotnet-core skill.

Testováno: 2026-08-07 · Claude Code 2.x (agent harness)

Instalace

git clone https://github.com/alexander-danilenko/cortex-ai-skills.git
mkdir -p ~/.claude/skills
cd cortex-ai-skills && cp -r skills/csharp ~/.claude/skills/csharp

Příkazy a ukázkové prompty

  • /csharpInterní pravidla C# 12 / .NET 8: Result pattern, hygiena EF dotazů, asynchronní disciplína

Skilly se spouštějí běžnými požadavky — žádné příkazy k zapamatování. Po instalaci ho aktivují prompty jako tyto (anglicky):

  • Review this ASP.NET Core controller for our C# 12 conventions
  • Rewrite this EF Core query to use AsNoTracking and AsSplitQuery
  • Add CancellationToken and the Result pattern to this async method