stylecop-analyzers

Configure StyleCop.Analyzers rules and stylecop.json settings for .NET projects.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? .NET teams often struggle to enforce consistent naming, layout, and documentation style conventions beyond what the built-in SDK analyzers provide, and misconfiguring StyleCop leads to rule conflicts and duplicated severity settings. ## Core Features & Use Cases - Package Setup and Detection: Detects existing StyleCop.Analyzers references in .csproj files and bootstraps the package when missing. - Configuration Ownership Split: Keeps rule severity in the root .editorconfig while reserving stylecop.json for StyleCop-specific behavioral settings like documentation, ordering, and layout rules. - Conflict Avoidance: Identifies overlaps with SDK analyzers and other analyzer packs such as Roslynator, and defines clear rule ownership. - Use Case: A team adopting StyleCop.Analyzers in an existing solution uses this Skill to add the package, configure SA rule severities in .editorconfig, and create a schema-backed stylecop.json without duplicating SDK analyzer rules. ## Quick Start Ask the agent to add StyleCop.Analyzers to this solution and configure its rules without losing .editorconfig ownership.

Frequently Asked Questions about stylecop-analyzers

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

FAQPage Schema
How do I add StyleCop.Analyzers to a .NET project?▼

Run dotnet add PROJECT.csproj package StyleCop.Analyzers after checking for existing references with a search for StyleCop.Analyzers or stylecop.json in csproj files. Then configure rule severity in the root .editorconfig and build the solution to verify.

What is the difference between stylecop.json and .editorconfig?▼

The .editorconfig owns rule severity, controlling whether each SA rule is a warning, error, suggestion, or disabled. stylecop.json holds StyleCop-specific behavioral settings like documentation rules, using directive placement, and layout options that .editorconfig cannot express.

Does StyleCop.Analyzers conflict with SDK analyzers or Roslynator?▼

Yes, several rules overlap, such as IDE0003 versus SA1101 for this-prefix qualification and RCS1018 versus SA1400 for access modifiers. Resolve conflicts by disabling the less-preferred analyzer in .editorconfig and assigning one pack ownership per rule category.

How do I disable specific StyleCop rules like SA1600 or SA1633?▼

Set the rule severity to none in .editorconfig, for example dotnet_diagnostic.SA1600.severity = none to skip documentation requirements or dotnet_diagnostic.SA1633.severity = none to skip file headers. Severity always belongs in .editorconfig, not stylecop.json.

When should I not use StyleCop.Analyzers?▼

Avoid it when the repo intentionally relies only on SDK analyzers for a lighter analyzer surface, or when an existing style package already covers the same rules and no consolidation is planned. In those cases the Skill returns status not_applicable.