dotnet-editorconfig

Generate .editorconfig files to enforce .NET code style and analysis rules.

Updated Aug 16, 2025
One-click install
npx skills add https://github.com/dodyg/blue-nile-pds --skill dotnet-editorconfig-dodyg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-editorconfig
Source: https://github.com/dodyg/blue-nile-pds/tree/main/.agents/skills/dotnet-editorconfig
Command: npx skills add https://github.com/dodyg/blue-nile-pds --skill dotnet-editorconfig-dodyg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Many .NET projects lack a centralized, hierarchical configuration for code style and analysis rules, leading to inconsistent formatting, missed diagnostics, and build failures.

Core Features & Use Cases

  • Rule Authoring: Detailed guidance to create .editorconfig files that configure IDE* and CA* rule severities, naming conventions, and analysis settings.
  • Hierarchical Precedence: Supports directory‑specific overrides and root termination for reproducible builds.
  • Build Enforcement: Instructions to enable EnforceCodeStyleInBuild so style rules are evaluated during CI.
  • Global Config: Optionally generate .globalconfig files for project‑wide analyzer settings.
  • Use Cases: Apply a baseline style across a solution, customize test project rules, or enforce security‑critical diagnostics in CI pipelines.

Quick Start

Use the dotnet-editorconfig skill to generate a baseline .editorconfig for the current repository.

Frequently Asked Questions about dotnet-editorconfig

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

FAQPage Schema
How do I generate an .editorconfig file to enforce .NET code style rules?

To generate an .editorconfig file for .NET code style, configure IDE* and CA* rule severities alongside naming conventions. This establishes consistent formatting and analysis settings that apply hierarchical rule precedence across repository directories.

How does .editorconfig hierarchical precedence work for C# projects?

EditorConfig hierarchical precedence applies directory-specific overrides by matching file paths from the root down. This mechanism ensures reproducible builds by allowing nested .editorconfig files to override parent settings for specific project folders.

How do I enforce code style in build pipelines using .editorconfig?

Enforce code style in build pipelines by enabling the `EnforceCodeStyleInBuild` property within your .editorconfig. This setting ensures style rules are evaluated as diagnostics during CI processes, causing build failures on violations.

Can I use .globalconfig files for project-wide analyzer settings in .NET?

You can use .globalconfig files to apply project-wide analyzer settings across your entire .NET solution. This provides an alternative to hierarchical .editorconfig files for enforcing baseline analysis rules globally.

What is the best way to configure rule severity levels for C# code analysis?

The best way to configure rule severity levels for C# code analysis is by defining them explicitly within an .editorconfig file. This allows granular customization of IDE* and CA* diagnostic severities to enforce security-critical rules.

When do I need an .editorconfig file for my dotnet repository?

You need an .editorconfig file for your dotnet repository when lacking centralized, hierarchical configuration for code style and analysis rules. This prevents inconsistent formatting, missed diagnostics, and build failures across development teams.