GravionLabs/elysion / .agents/skills/dotnet-implementation
dotnet-implementation
VerifiedC#/.NET implementation and test rules extending `implementation`. Use when writing or changing C# code.
The official dotnet plugin skills (dependency dotnet/skills) cover general C#/.NET style. Only project conventions follow.
Conventions
dotnet buildwith Central Package Management; nullable enabled- Naming:
_camelCasefields; files{ClassName}.cs - File-scoped namespaces; global usings for
System.*in one file - DI: constructor injection only, prefer primary constructors
recordtypes for DTOs,initsetters for models- Solution: code in
src/, versions inDirectory.Packages.props - Library code:
ConfigureAwait(false)on everyawait; app code: optional - I/O methods accept
CancellationToken cancellationToken = defaultand pass it through - Logging:
ILogger<T>with structured templates, neverConsole.WriteLine - XML docs on public API;
<summary>is one sentence starting with a third-person verb - Upgrades: bump versions centrally in
Directory.Build.props/Directory.Packages.props; no prerelease unless requested; build and test after each step - Aspire: only when
detect-techstackreportsframeworks: ["aspire"], loaddotnet-aspire
Format
- Extensions:
.cs - Format:
dotnet format --include {files} - Check (read-only):
dotnet format --verify-no-changes --include {files} - Run after green tests, before the commit:
pwsh <implementation dir>/scripts/Format-Changed.ps1 -Language dotnet(-Checkfor the check commands; not-configured, override: references/format.md ofimplementation)
EF Core
- Fluent API in
IEntityTypeConfiguration<T>, not data annotations - Always configure string max length
- Never edit a generated migration; add a new one
Tests
Runner, layout, naming, structure and mocking live in dotnet-test.
Review rules
- 🔴 Lint run (
Format-Changed.ps1 -Lint -Language dotnet, analyzer) exits non-zero: error-level findings; 🟡 warning-level findings - No
.Result,.Wait(), orasync void(except event handlers) CancellationTokenpropagated through async call chains- Nullable reference types respected; no swallowed exceptions
recordfor DTOs; dependencies injected via interfaces- Tests follow
dotnet-testconventions
Minimal APIs
House convention: endpoints are organized with Carter modules, not scattered app.MapGet calls in Program.cs:
public class <Feature>Module : ICarterModule
{
public void AddRoutes(IEndpointRouteBuilder app)
{
var group = app.MapGroup("/api/<feature>").WithTags("<Feature>");
group.MapGet("/", Handle).WithName("<Name>").WithOpenApi();
}
}
- Register with
builder.Services.AddCarter()andapp.MapCarter() - Typed request/response records; OpenAPI metadata (
.WithSummary(),.Produces<T>(),.ProducesProblem()) - Return
TypedResults, notResults.Ok(...); validate input (FluentValidation or Data Annotations)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |