
dotnet/skills
8 skills4.7k installs26.4k starsGitHub
Install
npx skills add https://github.com/dotnet/skillsSkills in this repo
1Optimizing Ef Core Queriesoptimizing-ef-core-queries is an agent skill for .NET builders whose Entity Framework Core LINQ translates into too many round trips, bloated SQL, or memory-heavy materializations. It opens with enabling query logging on the DbContext so you see real commands before changing code—a prerequisite called out as Step 1 in the workflow. The skill focuses on ORM-level fixes: N+1 elimination, correct AsNoTracking usage, compiled queries, and avoiding common EF traps, while steering you away when the bottleneck is missing indexes or when you are not on EF Core at all. Solo founders running ASP.NET APIs benefit when staging mirrors production load and logs show duplicate selects per request. It fits Ship performance work and revisits during Operate when latency regresses after feature churn. It does not replace database administration or a from-scratch repository design session.710installs2Run TestsRun-tests is an agent skill for solo and indie builders who ship .NET apps and need reliable local test runs without guessing which runner their repo uses. It reads project signals—Directory.Build.props, global.json, and project files—to decide between VSTest and Microsoft.Testing.Platform, then applies the matching `dotnet test` syntax, including SDK-specific `--` separator behavior on .NET 8/9 versus 10+. You use it when you want to run the full suite, slice tests with framework-appropriate filters, emit TRX reports, or chase hangs and crashes with blame options. It also covers choosing a single target framework when a project multi-targets net8.0 and net9.0. The skill deliberately stops at the CLI boundary: it does not generate test code, wire CI pipelines, or interpret failing assertions. That focus keeps agent sessions fast when the only problem is “wrong flag for my test platform.”656installs3Csharp ScriptsCsharp-scripts teaches agents to run file-based C# applications through the .NET CLI when the user clearly wants C# or .NET—not a language-agnostic script. It fits solo builders who need to test an API call, language feature, or small utility from a single entry file plus optional helper .cs files linked via #:include or #:ref, without spinning up a solution. The skill’s guardrails are strict: skip it for PowerShell-style automation, Python throwaways, or changes inside an existing csproj; use it for prototypes you might later fold into a larger app. The documented workflow begins with verifying the SDK via dotnet --version, then executing the file-based app pattern appropriate to the user’s snippet or intent. Treat it as a narrow .NET runner skill rather than full project scaffolding, testing, or publish configuration.642installs4Msbuild Antipatternsmsbuild-antipatterns is a reference checker skill for solo and indie builders maintaining .NET solutions. It catalogs concrete MSBuild smells—such as using Exec for trivial string or path manipulation and mixing Include with Update on one item type—and explains why each pattern breaks cross-platform builds, slows evaluation, or loses property flow. Each entry pairs a bad XML example with a good alternative using property functions, MSBuild intrinsics like NormalizeDirectory, and disciplined item grouping. Install it when you or your coding agent touch Directory.Build.props, packaging targets, or generated Compile items and want guardrails before bugs show up only on CI or another machine. It complements general code review by focusing on build-system correctness rather than application logic.570installs5Msbuild Modernizationmsbuild-modernization is an agent skill for solo and indie .NET builders who inherit or maintain repos stuck on pre-SDK MSBuild XML. It only activates in MSBuild/.NET build context and walks through identifying legacy indicators—verbose csproj files over ~50 lines for simple apps, ToolsVersion, packages.config, and Properties/AssemblyInfo.cs—versus the minimal SDK-style root. The skill explains when conversion is appropriate, when to stop (projects already SDK-style, npm/Maven/CMake, or Framework targets that cannot move), and how to eliminate manual file lists in favor of implicit includes and PackageReference. For a one-person team shipping a service or CLI on modern .NET, this reduces merge pain and CI surprises without guessing at MSBuild semantics. After the guide, agents are directed to run dotnet try-convert or upgrade-assistant rather than hand-editing hundreds of includes.559installs6Dotnet Trace Collectdotnet-trace-collect is an agent skill that teaches solo builders and small teams how to use Microsoft’s dotnet-monitor to gather traces and process diagnostics through a REST API, which is the pattern teams use in containers and Kubernetes instead of attaching desktop profilers. The readme walks through installing the global tool or running the official container image as a sidecar, starting collect with loopback URLs and separate metric endpoints, and calling processes and trace endpoints after port-forwarding. It emphasizes production-safe defaults—authentication on, localhost binding, and operator-only access—while reserving --no-auth for isolated development. For indie builders shipping .NET APIs or background services, this skill is the bridge between “something is slow in prod” and an actionable trace file you can analyze offline, without rewriting your deployment model.525installs7Test Anti Patternstest-anti-patterns is an agent skill from the .NET skills collection that audits existing automated tests across many frameworks and languages. When you ask to audit, review, rank, or find problems in tests that pass but prove little, it applies a pragmatic smell catalog—missing assertions, always-true checks, swallowed exceptions, flaky timing, duplicated cases, magic values, and async mistakes—and returns a report ordered by Critical, Warning, and Info with actionable fixes at the code level. It directs you to load language extensions (for example `extensions/dotnet.md`) for framework-specific nuance. Solo builders use it before ship when a suite grew fast and trust is low, or during iteration when regressions are hard to diagnose. The skill deliberately does not author new tests, execute CI, or migrate frameworks; those are separate skills such as code-testing-agent, writing-mstest-tests, or run-tests.520installs8Directory Build OrganizationDirectory Build Organization is a reference skill for solo and small-team .NET developers who outgrow copy-pasted csproj settings. It documents how to push shared MSBuild logic into Directory.Build.props and Directory.Build.targets so test assemblies, executables, and libraries pick up the right IsPackable, IsTestProject, documentation, and self-contained defaults automatically. Builders use it when consolidating CI-friendly artifact folders, enforcing that Pack actually produced a nupkg, or layering repo-root versus solution-folder build imports without surprises. The content is pattern-oriented XML snippets rather than a single generator script, which suits agents asked to refactor messy solutions before shipping an API or internal tool. Expect intermediate familiarity with MSBuild conditions and SDK-style projects.514installs