roslynator

Configure Roslynator analyzers and CLI for C# static analysis and code cleanup.

Updated May 2, 2026
One-click install
npx skills add https://github.com/hdeshev/pi-config --skill roslynator-hdeshev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: roslynator
Source: https://github.com/hdeshev/pi-config/tree/main/agent/skills/roslynator
Command: npx skills add https://github.com/hdeshev/pi-config --skill roslynator-hdeshev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up Roslynator analyzers and its CLI in a .NET repository involves choosing between NuGet analyzer packages and CLI workflows, resolving rule severity ownership in .editorconfig, and avoiding conflicts with existing analyzers like StyleCop or SDK analyzers. ## Core Features & Use Cases - Analyzer Package Setup: Adds Roslynator.Analyzers to projects for build-enforced C# diagnostics with severity configured in .editorconfig. - CLI Workflows: Guides adoption of roslynator analyze, fix, format, and find-unused commands for CI or controlled local cleanup. - Rule Configuration References: Provides detailed .editorconfig templates and a catalog of RCS rules for libraries, applications, and test projects. - Use Case: A team wants to find unused code across a solution; the skill bootstraps the Roslynator CLI, runs find-unused, and documents repeatable commands in AGENTS.md and CI. ## Quick Start Ask the agent to add Roslynator analyzers to this solution and configure rule severity in .editorconfig.

Frequently Asked Questions about roslynator

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

FAQPage Schema
How do I add Roslynator analyzers to a .NET project?▼

Add the analyzer package with dotnet add PROJECT.csproj package Roslynator.Analyzers. This enables build-enforced diagnostics, and you configure rule severity in the root .editorconfig using dotnet_diagnostic entries.

How do I find unused code with Roslynator CLI?▼

Install the CLI with dotnet tool install roslynator.dotnet.cli, then run roslynator find-unused on your solution or project. Build first so Roslynator has compiled context, and scope results with --projects or --include flags.

What is the difference between Roslynator.Analyzers and the Roslynator CLI?▼

The NuGet analyzer packages provide the actual diagnostic rules enforced at build time. The CLI is a separate tool for explicit analyze, fix, format, and find-unused workflows; it does not supply the analyzer rules by itself.

Can Roslynator be used alongside StyleCop or SDK analyzers?▼

Yes, but you must establish clear rule ownership in .editorconfig to avoid duplicate diagnostics. Disable overlapping Roslynator rules where StyleCop or SDK analyzers already cover the same checks.

When should I not use Roslynator?▼

Avoid it when the repo already has overlapping analyzer packs with no consolidation plan, or when formatting is already standardized on dotnet format or CSharpier and only formatting work is needed.

How do I configure Roslynator rule severity in .editorconfig?▼

Use dotnet_diagnostic.RCSxxxx.severity entries set to none, suggestion, warning, or error. Roslynator also supports roslynator_ prefixed options for style behavior and roslynator_refactoring toggles for individual refactorings.