dotnet-add-analyzers

Configure .NET analyzers, severity overrides, and trimming compatibility via EditorConfig.

71|10|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-add-analyzers-wshaddix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-add-analyzers
Source: https://github.com/wshaddix/dotnet-skills/tree/main/skills/dotnet-add-analyzers
Command: npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-add-analyzers-wshaddix

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you integrate and configure code analysis tools directly into your .NET development workflow, improving code quality, maintainability, and catching potential issues early.

Core Features & Use Cases

  • Configure Built-in Analyzers: Set analysis levels (latest-all, latest-recommended, etc.) and enforce code style rules during build.
  • Manage Severity: Fine-tune rule severities (error, warning, none) using .editorconfig for specific rules or project types.
  • Enable Nullable Reference Types: Globally enable nullable context for improved null safety.
  • Integrate Trimming/AOT Analyzers: Ensure your application or library is compatible with trimming and Native AOT compilation.
  • Add Third-Party Analyzers: Incorporate popular analyzer packages like Meziantou.Analyzer or BannedApiAnalyzers.
  • Use Case: You want to ensure all new C# code in your project adheres to modern best practices and is compatible with future .NET runtimes.

Quick Start

Configure the project to use the latest Roslyn analyzers with all rules enabled and treat warnings as errors.

Frequently Asked Questions about dotnet-add-analyzers

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

FAQPage Schema
How do I configure Roslyn analyzers in a .NET project?

Configuring Roslyn analyzers involves setting analysis levels like `latest-all` or `latest-recommended` and managing specific rule severities using an EditorConfig file. This enforces code style rules directly during the build process to improve maintainability.

What is the best way to enable nullable reference types globally in C#?

Enabling nullable reference types globally improves null safety across your C# application by configuring the nullable context within your .NET project settings. This catches potential null reference exceptions early during development and analysis.

How do I ensure my .NET library is compatible with Native AOT and trimming?

To ensure .NET library compatibility with Native AOT and trimming, you integrate specialized compatibility analyzers into your project. These analyzers detect potential trimming issues during build, ensuring your application works safely with future .NET runtime deployments.

Can I override analyzer severity levels for specific rules in .NET?

You can override analyzer severity levels for specific rules in .NET using an EditorConfig file. This allows you to fine-tune individual rules to act as errors, warnings, or be completely disabled based on your project's specific code quality requirements.

How do I add third-party analyzers like BannedApiAnalyzers to a .NET project?

Adding third-party analyzers like BannedApiAnalyzers or Meziantou.Analyzer involves incorporating the packages into your .NET project. This extends built-in Roslyn analysis with custom rules to enforce specific API usage restrictions and additional code quality best practices.