warning-fixer

Resolve C# nullability warnings with guard clauses and validation.

94|11|Updated Feb 8, 2026
One-click install
npx skills add https://github.com/thefrederiksen/cc-director --skill warning-fixer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: warning-fixer
Source: https://github.com/thefrederiksen/cc-director/tree/main/.claude/skills/warning-fixer
Command: npx skills add https://github.com/thefrederiksen/cc-director --skill warning-fixer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and scripts (resource) components.

What problem does it solve?

This Skill addresses the common issue of developers using the null-forgiving operator (!) to suppress compiler warnings, which masks underlying problems and can lead to runtime NullReferenceException errors. It enforces best practices for robust null handling.

Core Features & Use Cases

  • Proper Warning Resolution: Fixes C# compiler warnings related to nullability by implementing guard clauses, validation, and null checks instead of using the ! operator.
  • Methodical Approach: Works on one file and one warning type at a time, ensuring thoroughness and reviewability.
  • Test-Driven Fixes: Emphasizes adding or verifying test coverage before making code modifications.
  • Use Case: When encountering CS8602 (Dereference of possibly null reference) or CS8604 (Possible null reference argument) warnings in your C# code, this Skill will guide you through implementing safe null-handling logic.

Quick Start

Use the warning-fixer skill to fix CS8602 warnings in the file SessionManager.cs.

Frequently Asked Questions about warning-fixer

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

FAQPage Schema
How do I fix CS8602 and CS8604 compiler warnings in C#?

Resolve CS8602 and CS8604 compiler warnings by implementing proper guard clauses, validation, and null checks instead of suppressing them. This methodical approach fixes possible null reference issues safely without masking underlying problems.

Why should I avoid using the null-forgiving operator to suppress C# nullable reference type warnings?

Avoid the null-forgiving operator for C# nullable reference warnings because it masks underlying problems and risks runtime NullReferenceException errors. Implementing proper validation and guard clauses ensures robust null handling.

What is the best way to handle C# nullability warnings across multiple files?

The best way to handle C# nullability warnings is a methodical approach targeting one file and one warning type at a time. This ensures thorough, test-supported code correction for robust null handling and easy reviewability.

Do I need to add tests before fixing C# nullable reference type warnings?

Yes, you should add or verify test coverage before modifying code to fix C# nullable reference type warnings. This test-driven approach ensures your guard clauses and null validation logic work correctly without introducing regressions.

When should I not use the null-forgiving operator for null handling in C#?

You should not use the null-forgiving operator when encountering CS8602 or CS8604 warnings, as it masks underlying problems and risks runtime NullReferenceException errors. Use proper validation and guard clauses instead for robust null handling.