What problem does it solve?
C# codebases without nullable reference types (NRT) suffer from runtime NullReferenceException crashes and ambiguous API contracts, and enabling NRT on legacy projects produces overwhelming warning noise without a clear migration strategy.
Core Features & Use Cases
- NRT Adoption and Migration: Incremental rollout strategies using
<Nullable>enable</Nullable>, per-file #nullable directives, and warnings-only or annotations-only phases for legacy codebases.
- Nullable Attribute Catalog: Complete guidance on
System.Diagnostics.CodeAnalysis attributes including AllowNull, DisallowNull, MaybeNull, NotNull, NotNullWhen, NotNullIfNotNull, MemberNotNull, DoesNotReturn, and the C# 14 field keyword null-resilience rules.
- API Design and Compatibility: Rules for nullability in public signatures, generic constraints, and source-breaking annotation changes in shipped libraries, including polyfill tradeoffs for netstandard2.0 and .NET Framework targets.
- Use Case: When modernizing a legacy .NET library, use this Skill to enable NRT project-by-project, annotate Try-pattern methods with
[NotNullWhen(true)], and wrap unannotated ORM APIs so downstream callers get full flow analysis.
Quick Start
Ask the assistant to enable nullable reference types in your C# project and fix the resulting CS86xx warnings using proper annotations and attributes.