dotnet-roslyn-analyzers

Author custom Roslyn analyzers, code fix providers, and refactoring providers for C#.

10|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/AGIBuild/Agibuild.Fulora --skill dotnet-roslyn-analyzers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-roslyn-analyzers
Source: https://github.com/AGIBuild/Agibuild.Fulora/tree/main/.cursor/skills/dotnet-roslyn-analyzers
Command: npx skills add https://github.com/AGIBuild/Agibuild.Fulora --skill dotnet-roslyn-analyzers

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Microsoft.CodeAnalysis.CSharp, Microsoft.CodeAnalysis.Analyzers, Microsoft.CodeAnalysis.CSharp.Analyzer.Testing, Microsoft.CodeAnalysis.CSharp.CodeFix.Testing, xunit.v3, and includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance for developers who need to create their own Roslyn analyzers, code fix providers, and code refactoring providers to enforce custom coding standards or identify specific code patterns within C# projects.

Core Features & Use Cases

  • Analyzer Authoring: Learn to implement DiagnosticAnalyzer for detecting code issues.
  • Code Fixes & Refactorings: Implement CodeFixProvider and CodeRefactoringProvider for automated code corrections and transformations.
  • Multi-Version Targeting: Support multiple Roslyn versions for broader compatibility.
  • Testing Strategies: Utilize Microsoft.CodeAnalysis.Testing for robust unit tests.
  • Use Case: A team wants to enforce a specific naming convention for asynchronous methods. They can create a custom Roslyn analyzer using this Skill to automatically flag violations and provide a code fix to rename the methods correctly.

Quick Start

Create a new C# project targeting netstandard2.0 and add the necessary Roslyn SDK NuGet packages to begin authoring your analyzer.

Frequently Asked Questions about dotnet-roslyn-analyzers

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

FAQPage Schema
How do I create a custom Roslyn analyzer to enforce coding standards in C#?

To create a custom Roslyn analyzer, you implement a DiagnosticAnalyzer to detect specific code patterns and register analysis context. This Skill guides you through project setup, diagnostic descriptor conventions, and context registration to flag violations in C# code.

How do I add a code fix provider to automate corrections for my Roslyn analyzer?

You add a code fix provider by implementing a CodeFixProvider that generates automated code corrections for detected diagnostic issues. This Skill covers creating code fix actions and code refactoring providers to transform and fix C# code automatically.

What is the best way to unit test custom Roslyn analyzers and code fixes?

The best way to unit test custom Roslyn analyzers is by using the Microsoft.CodeAnalysis.Testing framework. This Skill provides testing strategies utilizing CSharp.Analyzer.Testing and CSharp.CodeFix.Testing packages alongside xunit.v3 for robust verification.

Can I target multiple Roslyn versions with a single custom analyzer project?

Yes, you can support multiple Roslyn versions for broader compatibility. This Skill covers multi-version targeting strategies, allowing your custom analyzers and code fix providers to function across different versions of the .NET ecosystem.

What dependencies do I need to start authoring Roslyn analyzers for C#?

You need the Microsoft.CodeAnalysis.CSharp and Microsoft.CodeAnalysis.Analyzers NuGet packages to start authoring Roslyn analyzers. Your project should target netstandard2.0 and include testing packages like Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.