plugins/dotnet-artisan/skills/using-dotnet/SKILL.md
Detects .NET intent for any C#, ASP.NET Core, EF Core, Blazor, MAUI, Uno Platform, WPF, WinUI, SignalR, gRPC, xUnit, NuGet, or MSBuild request from prompt keywords and repository signals (.sln, .csproj, global.json, .cs files). First skill to invoke for all .NET work — loads version-specific coding standards and routes to domain skills via [skill:dotnet-advisor] before any planning or implementation. Do not use for clearly non-.NET tasks (Python, JavaScript, Go, Rust, Java).
npx skillsauth add novotnyllc/dotnet-artisan using-dotnetInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
.sln, .slnx, .csproj, global.json, .cs).Write the simplest code that solves the problem. Agents consistently over-engineer — more abstractions, more layers, more indirection than the task warrants.
if/else over a chain of ternaries. A foreach over a hard-to-read LINQ expression. A flat method over nested callbacks. Clear beats compact. This does NOT mean avoiding modern C# — use latest language features ([..4], list patterns, primary constructors, raw string literals, collection expressions). Modern syntax is concise AND readable. The target is convoluted logic, not concise syntax.IOrderService for one OrderService. Don't extract a helper for something that happens once. Three similar lines of code are fine — extract only when a real pattern emerges across 3+ call sites.DbContext is your Unit of Work. DbSet<T> is your repository. .NET has TimeProvider, ILogger<T>, IHttpClientFactory, System.Text.Json. Use them directly — don't wrap, don't abstract, don't add a NuGet package for something the framework already does.The right amount of complexity is the minimum needed to solve the current problem correctly.
.NET skills contain version-specific guidance (net8.0 vs net9.0 vs net10.0), coding standards, and framework-specific patterns that the model doesn't have in its training data. Skipping routing means the model confidently produces code using deprecated APIs, misses framework-specific patterns, or gives generic advice that ignores project context.
Routing before action ensures:
The cost of routing is a few skill invocations. The cost of skipping is rework, stale advice, or subtle bugs.
When a request likely involves .NET or C#, follow this sequence before any other action:
.sln, .slnx, .csproj, global.json, .cs files). If either is present, continue.dotnet --version fails and no DOTNET_ROOT is set, install the SDK before proceeding. This takes under a minute with no privileges required. See [skill:dotnet-tooling] references/dotnet-sdk-install.md for the full install script reference, or use this one-liner: curl -sSL https://dot.net/v1/dotnet-install.sh | bash && export DOTNET_ROOT="$HOME/.dotnet" && export PATH="$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools". Do not treat a missing SDK as a blocker — install it and continue.For quick scripts, utilities, prototypes, and single-file tools, prefer .NET 10 file-based apps (dotnet run script.cs) over creating a full project with .csproj. File-based apps:
.cs file — no project file, no solution, no boilerplate#:package directives#:sdk Microsoft.NET.Sdk.Web#!/usr/bin/env dotnet)When the user asks to "write a script", "make a quick tool", "create a utility", or any small single-purpose program, default to a file-based app unless the task clearly needs multiple source files or test projects. See [skill:dotnet-api] references/file-based-apps.md for the full directive and CLI reference.
// Example: a file-based ASP.NET Core API
#:sdk Microsoft.NET.Sdk.Web
var app = WebApplication.Create(args);
app.MapGet("/", () => "Hello from a single .cs file!");
app.Run();
// Example: a file-based CLI tool with a NuGet package
#:package Spectre.Console
using Spectre.Console;
AnsiConsole.MarkupLine("[green]Hello[/] from a file-based app!");
Routing applies even for "simple" questions and clarification requests. The skill loading is lightweight and ensures consistent quality.
When multiple skills could apply, use this order:
Rigid (must follow exactly): this skill, [skill:dotnet-advisor], and baseline-first ordering.
Flexible (adapt to context): Domain skills and their companion references.
User instructions define WHAT to do. This process defines HOW to route and load skills before execution.
tools
Test-only skill for verifying sibling file access in Copilot CLI
tools
Builds .NET UI apps across Blazor (Server, WASM, Hybrid, Auto), MAUI (XAML, MVVM, Shell, Native AOT), Uno Platform (MVUX, Extensions, Toolkit), WPF (.NET 8+, Fluent theme), WinUI 3 (Windows App SDK, MSIX, Mica/Acrylic, adaptive layout), and WinForms (high-DPI, dark mode) with JS interop, accessibility (SemanticProperties, ARIA), localization (.resx, RTL), platform bindings (Java.Interop, ObjCRuntime), and framework selection. Spans 20 topic areas. Do not use for backend API design or CI/CD pipelines.
tools
Manages .NET SDK installation (dotnet-install, workloads), project setup (.slnx, Directory.Build.props, CPM), MSBuild authoring, build optimization, performance (Span, ArrayPool, stackalloc), profiling (dotnet-counters, dotnet-trace), Native AOT/trimming, GC tuning, CLI apps (System.CommandLine, Spectre.Console, Terminal.Gui), ILSpy decompilation, VS Code debug config (launch.json, coreclr, remote), C# LSP (csharp-ls, OmniSharp), and version detection/upgrade. Spans 34 topic areas. Do not use for UI implementation or API security design.
tools
Defines .NET test strategy and implementation patterns across xUnit v3 (Facts, Theories, fixtures, IAsyncLifetime), integration testing (WebApplicationFactory, Testcontainers), Aspire testing (DistributedApplicationTestingBuilder), snapshot testing (Verify, scrubbing), Playwright E2E browser automation, BenchmarkDotNet microbenchmarks, code coverage (Coverlet), mutation testing (Stryker.NET), UI testing (page objects, selectors), and AOT WASM test compilation. Spans 13 topic areas. Do not use for production API architecture or CI workflow authoring.