What problem does it solve?
Many .NET projects either miss out on newer C# capabilities or accidentally emit syntax the project cannot compile; this Skill helps teams adopt modern C# language features while ensuring compatibility with project targets and language versions.
Core Features & Use Cases
- Language gating: Detect and respect LangVersion and TargetFramework to avoid emitting unsupported syntax.
- Pattern detection: Scan for existing records, primary constructors, collection initializers, and required members to inform safe refactors.
- Refactor guidance: Recommend or apply conversions such as DTOs to sealed records, services to primary-constructor classes, and collection expressions where supported.
- Use cases: Migrating a project to .NET 8 to leverage primary constructors, updating libraries to use collection expressions, or enforcing modern, concise patterns in new greenfield projects.
Quick Start
Use the modern-csharp skill to scan the repository, verify LangVersion and TargetFramework, and recommend or apply safe refactors like converting DTOs to sealed records and replacing collection initializers when the project supports C# 12 or higher.