dotnet-csharp-code-smells

Detect C# code smells and anti-patterns with fix guidance for .NET projects.

1|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-csharp-code-smells-rudironsoni
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-csharp-code-smells
Source: https://github.com/rudironsoni/dotnet-agent-harness/tree/main/.rulesync/skills/dotnet-csharp-code-smells
Command: npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-csharp-code-smells-rudironsoni

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill proactively identifies and helps fix common C# code smells and anti-patterns, improving code quality, maintainability, and reducing bugs.

Core Features & Use Cases

  • Smell Detection: Identifies issues in resource management, async patterns, DI, null handling, and LINQ.
  • Fix Guidance: Provides clear explanations of why a smell is harmful and offers concrete solutions.
  • Use Case: During a code review, this Skill can flag a potential resource leak due to improper IDisposable handling and suggest wrapping the object in a using statement.

Quick Start

Analyze the current project for C# code smells and suggest fixes.

Frequently Asked Questions about dotnet-csharp-code-smells

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

FAQPage Schema
How do I detect C# code smells and anti-patterns in my .NET project?

To detect C# code smells, this Skill scans your .NET project for common anti-patterns across resource management, async misuse, DI mistakes, null-handling, and LINQ inefficiencies. It flags issues like IDisposable misuse and explains why they are harmful.

What are common async deadlock code smells in C# and how do I fix them?

Common async deadlock code smells in C# involve improper async patterns that block execution. This Skill identifies async misuse and offers concrete fixes, guiding you to correct deadlocks and improve code maintainability.

Can I use this to find IDisposable misuse and DI lifetime errors during code reviews?

Yes, you can use this Skill during code reviews to find IDisposable misuse and DI lifetime errors. It proactively identifies these C# code smells and suggests corrections like wrapping objects in using statements.

What is the best way to refactor LINQ inefficiencies and nullable reference type violations in C#?

The best way to refactor LINQ inefficiencies and nullable reference type (NRT) violations is to use this Skill to detect the specific anti-patterns. It provides targeted guidance on correcting LINQ pitfalls and NRT violations for better code quality.

Does this code analysis Skill work without external dependencies or diagnostic packages?

Yes, this code analysis Skill operates without external dependencies or diagnostic packages. It independently analyzes your C# codebase to detect anti-patterns and provide refactoring guidance.