skillfed

roslynator

Roslynator equips .NET projects with open-source static analysis and code-cleanup capabilities through NuGet analyzer packages and an optional command-line tool. Configure rule severity in `.editorconfig`, run analysis and fix workflows, or detect unused code—all while respecting your repo's existing analyzer setup.

Roslynator provides open-source C# static analysis and code-fix automation for .NET projects.

AI-generated summary based on this skill's SKILL.md

463 35 MIT updated by managedcode

Install

managedcode/dotnet-skills/roslynator · repository language: C#

git clone https://github.com/managedcode/dotnet-skills
cp -r dotnet-skills/catalog/Tools/Roslynator/skills/roslynator ~/.claude/skills/roslynator
npx skillfed install managedcode/dotnet-skills/roslynator

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I set up Roslynator analyzers in my .NET project?

Roslynator installs via NuGet package manager. Add the `Roslynator.Analyzers` package to your project file or use `dotnet add package Roslynator.Analyzers`. Once installed, Roslynator's static analysis rules activate automatically during compilation. You can then configure rule severity levels in your project's `.editorconfig` file to customize which diagnostics are reported and at what level (error, warning, or silent).

What is the Roslynator CLI and how do I use it?

Roslynator's command-line interface provides `analyze` and `fix` commands for batch operations on C# code. Install the global tool with `dotnet tool install -g Roslynator.CommandLine`, then run `roslynator analyze` to scan your project for issues or `roslynator fix` to automatically apply corrections. The CLI is optional—the NuGet analyzer package works standalone—but the CLI excels for CI/CD integration and scripted workflows.

How can I find and eliminate unused code in C# with Roslynator?

Roslynator includes analyzers that detect unused symbols, variables, and imports. Run `roslynator analyze` via the CLI to generate a report of unused code, or let the NuGet package highlight these issues in your IDE during development. Configure the severity of unused-code diagnostics in `.editorconfig` to treat them as warnings or errors, enforcing cleanup across your team.

How do I configure Roslynator rules and severity levels?

Roslynator respects `.editorconfig` files for rule configuration. Create or edit `.editorconfig` in your project root and set rule IDs (e.g., `dotnet_diagnostic.RCS1001.severity = warning`) to control how each analyzer behaves. You can also disable specific rules entirely or set them to silent. This approach integrates seamlessly with other linters and respects your existing analyzer setup.

Can I integrate Roslynator into my CI/CD pipeline?

Yes. Roslynator's CLI tool is designed for CI/CD workflows. Install it as a global tool in your pipeline, then run `roslynator analyze` to fail the build if issues are found, or `roslynator fix` to auto-correct and commit changes. This enforces code quality checks across all pull requests and commits, ensuring consistent standards before code reaches production.

How does Roslynator avoid conflicts with other C# analyzers?

Roslynator is built on the Roslyn compiler platform and coexists with other analyzers like StyleCop. Configure rule IDs in `.editorconfig` to disable overlapping rules from competing packages, preventing duplicate warnings. Roslynator's modular design lets you cherry-pick which diagnostics matter to your project, consolidating analyzer packs without conflicts.

SKILL.md

rendered from the published skill — quoted content, verbatim

Roslynator

Trigger On

  • the repo uses or wants Roslynator.Analyzers
  • the team wants Roslynator CLI or extra Roslyn-based rules
  • the user asks about C# linting, static analysis, code cleanup, or unused code

Value

  • produce a concrete project delta: code, docs, config, tests, CI, or review artifact
  • reduce ambiguity through explicit planning, verification, and final validation skills
  • leave reusable project context so future tasks are faster and safer

Do Not Use For

- repos that already have overlapping analyzer packs with no consolidation plan

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 5 files
catalog/Tools/Roslynator/skills/roslynator/SKILL.md
catalog/Tools/Roslynator/skills/roslynator/manifest.json
catalog/Tools/Roslynator/skills/roslynator/references/config.md
catalog/Tools/Roslynator/skills/roslynator/references/roslynator.md
catalog/Tools/Roslynator/skills/roslynator/references/rules.md

Related skills

Tags

code-quality-automation static-analysis-tool dotnet-linting roslyn-based-analyzer csharp-refactoring build-time-enforcement unused-code-detection analyzer-package-management ci-integration-ready