dotnet-csharp-nullable-reference-types

Enable nullable reference types in C# projects and guide legacy codebase migration.

Updated Aug 16, 2025
One-click install
npx skills add https://github.com/dodyg/blue-nile-pds --skill dotnet-csharp-nullable-reference-types-dodyg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-csharp-nullable-reference-types
Source: https://github.com/dodyg/blue-nile-pds/tree/main/.agents/skills/dotnet-csharp-nullable-reference-types
Command: npx skills add https://github.com/dodyg/blue-nile-pds --skill dotnet-csharp-nullable-reference-types-dodyg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Many existing .NET projects lack nullable reference type (NRT) support, leading to null‑reference runtime errors and inconsistent null‑handling across codebases.

Core Features & Use Cases

  • Annotation strategies and project‑wide NRT configuration.
  • Step‑by‑step migration guidance for legacy codebases.
  • Guidance on nullable attributes, generic constraints, collections, and EF Core integration.
  • Identification of common AI agent mistakes when generating C# code with NRT.

Quick Start

Ask the dotnet-csharp-nullable-reference-types skill to enable nullable reference types for a .csproj and outline migration steps for existing files.

Frequently Asked Questions about dotnet-csharp-nullable-reference-types

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable nullable reference types in an existing C# project?

You enable nullable reference types by configuring project-wide settings in your .csproj file. This skill outlines the exact configuration steps and per-file directives needed to activate NRT across your C# projects.

What is the best way to migrate a legacy .NET codebase to nullable reference types?

The best way to migrate legacy codebases to nullable reference types is following a step-by-step migration strategy. This skill provides annotation strategies and guidance to incrementally update existing files without breaking runtime behavior.

How do nullable attributes and generic constraints work with C# nullable reference types?

Nullable attributes and generic constraints work with C# nullable reference types by enforcing strict null-handling rules at compile time. This skill guides you through proper attribute usage and generic constraints to ensure accurate static analysis.

Does enabling nullable reference types work with EF Core integration?

Yes, enabling nullable reference types works with EF Core integration. This skill provides specific guidance on configuring NRT within EF Core to ensure entity properties correctly reflect nullability constraints and database relationships.

What are common AI agent mistakes when generating C# code with nullable reference types?

Common AI agent mistakes when generating C# code with nullable reference types include incorrect null-handling annotations and misapplied attributes. This skill identifies these frequent pitfalls and provides strategies to avoid them during code generation.

When should I use per-file directives instead of project-wide nullable reference type configuration?

You should use per-file directives instead of project-wide nullable reference type configuration when migrating legacy codebases incrementally. This skill outlines how to apply localized directives to manage nullability during a phased rollout.