What problem does it solve?
Legacy C# and VB.NET codebases accumulate outdated syntax, inconsistent null handling, and verbose patterns that increase maintenance cost. This Skill provides a rule-based checklist for safely modernizing existing source files to C# 14 / .NET 10 idioms without changing runtime semantics.
Core Features & Use Cases
- Language Modernization: Converts block-scoped namespaces to file-scoped, replaces
== null with is null, applies pattern matching, switch expressions, collection expressions, target-typed new(), and the C# 14 field keyword.
- Var and Type Policy: Enforces a prioritized rule set for when to use
var versus explicit types, including casts, generic method calls, and tuple deconstruction.
- Comment and XML Documentation Cleanup: Fixes spelling and grammar in comments, requires XML doc headers on all types including private nested classes, and standardizes formatting (Allman braces, CRLF, UTF-8 with BOM).
- Use Case: When asked to refactor a WinForms source file, apply the checklist to modernize null checks with
ArgumentNullException.ThrowIfNull, convert event handlers to nullable signatures, and wrap long dot-chains — while skipping multi-targeted files where modern syntax would break older frameworks.
Quick Start
Ask the AI to modernize and refactor a specific existing C# file in this repository following the code-modernization rules.