dotnet-editorconfig
Authoring .editorconfig rules. IDE/CA severity, AnalysisLevel, globalconfig, code style enforcement.
What this skill does
# dotnet-editorconfig
Comprehensive guide to configuring .NET code analysis rules via `.editorconfig` and global AnalyzerConfig files. Covers code style rules (IDE*), code quality rules (CA*), severity levels, `AnalysisLevel`, `EnforceCodeStyleInBuild`, directory hierarchy precedence, and `.globalconfig` files.
**Scope boundary:** This skill covers *configuring and tuning* analyzer rules. For *adding analyzer packages to a project*, see [skill:dotnet-add-analyzers]. For *authoring custom analyzers*, see [skill:dotnet-roslyn-analyzers]. For *project-level build configuration* (Directory.Build.props, solution layout), see [skill:dotnet-project-structure].
Cross-references: [skill:dotnet-add-analyzers] for adding analyzer packages and AnalysisLevel setup, [skill:dotnet-roslyn-analyzers] for authoring custom analyzers, [skill:dotnet-project-structure] for Directory.Build.props and solution layout, [skill:dotnet-csharp-coding-standards] for naming and formatting conventions enforced by EditorConfig rules.
---
## EditorConfig Overview
`.editorconfig` is the standard configuration file for controlling code style and analysis rule behavior in .NET projects. The .NET compiler (Roslyn) reads `.editorconfig` to determine:
- **Code style preferences** -- naming, formatting, expression-level patterns (IDE* rules)
- **Code quality rule severity** -- suppress, demote, or escalate CA* and IDE* diagnostics
- **Formatting rules** -- indentation, spacing, newlines
### Directory Hierarchy and Precedence
EditorConfig files apply hierarchically. The compiler searches upward from the source file to the filesystem root, merging settings from each `.editorconfig` found. **Closest file wins** -- a setting in `src/MyApp/.editorconfig` overrides the same setting in the repo root `.editorconfig`.
```
repo-root/
.editorconfig # Shared baseline (root = true)
src/
.editorconfig # Overrides for production code
MyApp.Api/
.editorconfig # API-specific overrides (if needed)
tests/
.editorconfig # Relaxed rules for test projects
```
Set `root = true` in the topmost file to stop upward traversal. Without this, the editor traverses above the repo root into user or system-level EditorConfig files, producing non-reproducible behavior.
```ini
# repo-root/.editorconfig
root = true
[*.cs]
indent_style = space
indent_size = 4
```
### File Glob Patterns
EditorConfig sections use glob patterns to scope settings to specific files:
| Pattern | Matches |
|---------|---------|
| `[*.cs]` | All C# files |
| `[*.{cs,vb}]` | C# and Visual Basic files |
| `[**/test/**/*.cs]` | C# files under any `test` directory |
| `[Program.cs]` | Exact file name |
---
## Code Style Rules (IDE*)
IDE rules control code style preferences enforced by the Roslyn compiler and IDE. They are configured with `dotnet_style_*`, `csharp_style_*`, and `dotnet_diagnostic.IDE*.severity` entries.
### Key IDE Rule Categories
| Range | Category | Examples |
|-------|----------|----------|
| IDE0001-IDE0009 | Simplification | IDE0001 (simplify name), IDE0003 (remove `this.` qualification), IDE0005 (remove unnecessary using) |
| IDE0010-IDE0039 | Expression preferences | IDE0016 (throw expression), IDE0017 (object initializer), IDE0018 (inline variable), IDE0028 (collection initializer), IDE0034 (simplify default), IDE0039 (use local function) |
| IDE0040-IDE0069 | Modifier and access preferences | IDE0040 (add accessibility modifiers), IDE0044 (add readonly), IDE0062 (make local function static) |
| IDE0070-IDE0090+ | Pattern matching and modern syntax | IDE0071 (simplify interpolation), IDE0078 (use pattern matching), IDE0090 (simplify `new` expression) |
| IDE0100-IDE0180 | Additional simplification | IDE0130 (namespace match folder), IDE0160/IDE0161 (block vs file-scoped namespace) |
| IDE0200-IDE0260 | Lambda and method preferences | IDE0200 (remove unnecessary lambda), IDE0230 (use UTF-8 string literal) |
| IDE1005-IDE1006 | Naming rules | IDE1006 (naming rule violation) |
### Configuring Code Style Preferences
```ini
[*.cs]
# Expression-level preferences
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
csharp_style_expression_bodied_properties = true:suggestion
csharp_style_expression_bodied_constructors = false:silent
# Pattern matching
csharp_style_prefer_pattern_matching = true:suggestion
csharp_style_prefer_switch_expression = true:suggestion
csharp_style_prefer_not_pattern = true:suggestion
# Null checking
csharp_style_prefer_null_check_over_type_check = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
# var preferences
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = false:suggestion
# Namespace style (.NET 6+)
csharp_style_namespace_declarations = file_scoped:warning
# Using directives
csharp_using_directive_placement = outside_namespace:warning
dotnet_sort_system_directives_first = true
```
### IDE Rule Severity via dotnet_diagnostic
Each IDE rule can have its severity set independently:
```ini
[*.cs]
# Enforce removal of unnecessary usings as a build warning
dotnet_diagnostic.IDE0005.severity = warning
# Enforce file-scoped namespaces as a build error
dotnet_diagnostic.IDE0161.severity = error
# Demote new-expression simplification to suggestion
dotnet_diagnostic.IDE0090.severity = suggestion
# Disable this. qualification rule entirely
dotnet_diagnostic.IDE0003.severity = none
```
---
## Code Quality Rules (CA*)
CA rules detect design, performance, security, reliability, and usage issues. They are shipped with the .NET SDK and controlled by `AnalysisLevel`. For a complete CA rule category table and `AnalysisLevel` setup guidance, see [skill:dotnet-add-analyzers].
The main CA categories are: Design (CA1000s), Globalization (CA1300s), Interoperability (CA1400s), Maintainability (CA1500s), Naming (CA1700s), Performance (CA1800s), Reliability (CA2000s), Security (CA2100s, CA3xxx, CA5xxx), and Usage (CA2200s).
### CA Rule Severity Configuration
```ini
[*.cs]
# Suppress rules not applicable to your project type
dotnet_diagnostic.CA1062.severity = none # Nullable handles parameter validation
dotnet_diagnostic.CA2007.severity = none # ConfigureAwait not needed in ASP.NET Core apps
# Escalate important rules
dotnet_diagnostic.CA1822.severity = warning # Mark members as static
dotnet_diagnostic.CA1848.severity = warning # Use LoggerMessage delegates
dotnet_diagnostic.CA2016.severity = warning # Forward CancellationToken
# Error-level for security rules
dotnet_diagnostic.CA2100.severity = error # SQL injection review
dotnet_diagnostic.CA5350.severity = error # Weak cryptographic algorithms
```
---
## Severity Levels
The five severity levels control how a diagnostic is reported:
| Severity | Build Output | IDE Squiggles | Error List | Fails Build (`TreatWarningsAsErrors`) |
|----------|-------------|---------------|------------|---------------------------------------|
| `error` | Yes (error) | Red | Error tab | Always |
| `warning` | Yes (warning) | Green | Warning tab | Yes (with `TreatWarningsAsErrors`) |
| `suggestion` | No | Gray dots | Message tab | No |
| `silent` | No | No | No | No (code fix available, not shown in build or Error List) |
| `none` | No | No | No | No (rule fully disabled) |
### Bulk Severity Configuration
Set default severity for entire categories:
```ini
[*.cs]
# Set all design rules to warning
dotnet_analyzer_diagnostic.category-Design.severity = warning
# Set all performance rules to error
dotnet_analyzer_diagnostic.category-Performance.severity = error
# Set all naming rules to suggestion
dotnet_analyzer_diagnostic.category-Naming.severity = suggestion
```
Valid category names for `dotnet_analyzer_diagnostic.category-{Category}.severity` include: `Design`, Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.