dotnet_skill
- C#
0
GitHub Stars
1
Bundled Files
3 weeks ago
Catalog Refreshed
2 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstart where the catalogue uses aiagentskills.
npx veilstart add skill stuartf303/sorcha --skill dotnet- SKILL.md3.3 KB
Overview
This skill manages .NET 10 runtime, C# 13 syntax, and consistent project configuration for services. It provides opinionated defaults for nullable reference types, implicit usings, XML docs, and a shared ServiceDefaults setup to streamline service bootstrapping. Use it to standardize DI patterns, authentication, and project templates across services.
How this skill works
The skill inspects and enforces project SDK settings (TargetFramework net10.0, ImplicitUsings, Nullable, GenerateDocumentationFile) and supplies a ServiceDefaults extension that must be applied early in WebApplication builder configuration. It wires common middleware, JWT authentication helpers, and exposes shared global usings and test project patterns to keep services consistent. C# 13 language features like primary constructors, collection expressions, required members, and raw string literals are expected and supported.
When to use it
- Setting up a new .NET 10 web service with consistent defaults and documentation generation
- Refactoring projects to adopt C# 13 features (primary constructors, collection expressions, required members)
- Configuring dependency injection and shared authentication across microservices
- Preparing test projects with standard using directives and test libraries
- Enforcing nullable reference types and implicit usings across a codebase
Best practices
- Call AddServiceDefaults on the builder before adding service-specific dependencies
- Enable GenerateDocumentationFile and suppress only CS1591 to keep XML docs clean
- Prefer primary constructors for DI-enabled services to reduce boilerplate
- Use required members on DTOs to ensure construction-time validity
- Keep shared global usings limited to common, stable namespaces to avoid coupling
Example use cases
- Bootstrapping a new API: create project file with net10.0 settings, register ServiceDefaults, add scoped services, map endpoints, and enable auth
- Migrating older services to C# 13: adopt primary constructors and collection expressions to simplify models and defaults
- Standardizing tests: add global Using entries for Xunit, Moq, and FluentAssertions across test projects
- Implementing DTO contracts: use records and required members for clear, immutable contracts
- Documenting public APIs: enable XML documentation generation and include raw string literals for multi-line docs
FAQ
Yes. AddServiceDefaults sets up shared middleware and authentication that other registrations rely on.
Is nullable reference types required?
The configuration enforces Nullable enable to improve null-safety and align code expectations across services.