Skills for Real Engineers. Straight from my .agents directory.
csharp-nullable-reference-types
Agent skill fromAaronontheweb/dotnet-skills
Guidelines for introducing and using nullable reference types (NRT) and System.Diagnostics.CodeAnalysis nullable attributes in C# / .NET codebases. Covers the nullability model, flow analysis, the null-forgiving operator, API design rules, the full attribute catalog (AllowNull, DisallowNull, MaybeNull, NotNull, NotNullWhen, MaybeNullWhen, NotNullIfNotNull, MemberNotNull, MemberNotNullWhen, DoesNotReturn, DoesNotReturnIf), the C# 14 field keyword, incremental migration of legacy codebases, and a code-generation checklist.
How to install csharp-nullable-reference-types
npx skills add Aaronontheweb/dotnet-skills# or add only this skill to Claude Code: copy the folder
skills/csharp-nullable-reference-types/
# into
~/.claude/skills/csharp-nullable-reference-types/ (all projects)
.claude/skills/csharp-nullable-reference-types/ (one project)
1# C# Nullable Reference Types23## When to Use45- Introducing nullable reference types (NRT) into a codebase that has not yet adopted them6- Writing or refactoring C# code that uses `T?` / nullable annotations7- Annotating APIs with `System.Diagnostics.CodeAnalysis` nullable attributes8- Designing public/internal APIs where nullability contracts matter9- Wrapping unannotated or legacy APIs so downstream callers still benefit from NRT10- Reviewing code for correct null-state analysis, guard helpers, and the `field` keyword1112## Core Goals1314- Prevent `NullReferenceException` at runtime by making null intent explicit in signatures.15- Express contracts the type system cannot represent directly using the official nullable attributes.16- Adopt NRT incrementally in legacy codebases without a big-bang rewrite.1718## Core Nullability Model1920### Non-nullable vs nullable2122- `string` — non-nullable reference. The compiler assumes instances are never `null`; assigning `null` or a maybe-null value produces a warning.23- `string?` — nullable reference. The variable may be `null`; the compiler requires a null check before dereference.2425```csharp26string name = "Alice";27name = null; // Warning: assigning null to non-nullable.2829string? nickname = null;30Console.WriteLine(nickname.Length); // Warning: possible null dereference.31```3233### Null-state analysis (flow)3435The compiler tracks whether a reference is *definitely non-null* or *maybe null*. Null checks and assignments update this state.36…
Excerpt shown under the repository's MIT license.
More skills in dotnet-skills
Similar skill repositories
Public repository for Agent Skills
An AI skill that provides design intelligence for building professional UI/UX across multiple platforms.
Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Production-grade engineering skills for AI coding agents.
Agent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
