csharp-nullable-reference-types
Installation
SKILL.md
C# Nullable Reference Types
When to Use
- Introducing nullable reference types (NRT) into a codebase that has not yet adopted them
- Writing or refactoring C# code that uses
T?/ nullable annotations - Annotating APIs with
System.Diagnostics.CodeAnalysisnullable attributes - Designing public/internal APIs where nullability contracts matter
- Wrapping unannotated or legacy APIs so downstream callers still benefit from NRT
- Reviewing code for correct null-state analysis, guard helpers, and the
fieldkeyword
Core Goals
- Prevent
NullReferenceExceptionat runtime by making null intent explicit in signatures. - Express contracts the type system cannot represent directly using the official nullable attributes.
- Adopt NRT incrementally in legacy codebases without a big-bang rewrite.