Token导航 LogoToken导航

Agent Skill · 研究检索

dotnet-editorconfig(点网编辑器配置)

dotnet-editorconfig 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

dotnet-editorconfig 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 62,939。

总安装 324周安装 13GitHub Stars 15下载 105核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:dotnet-editorconfig(点网编辑器配置)
来源仓库:https://github.com/wshaddix/dotnet-skills
仓库路径:skills/dotnet-editorconfig
安装命令:
npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-editorconfig
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-editorconfig

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

该技能指导通过 .editorconfig 和 AnalyzerConfig 配置 .NET 代码分析规则。适用于统一团队代码风格和质量的 IDE 级别规则控制。核心能力包括 CA* 规则集管理、严重性分级和目录层级优先级处理。使用时应区分规则配置与包引入和自定义分析器的职责边界。

安装前需确认项目已启用 .NET 分析器和全局配置支持。

来源仓库内路径:skills/dotnet-editorconfig

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-editorco…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

dotnet-editorconfig 怎么安装?

在终端执行 npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-editorconfig。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

dotnet-editorconfig 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

dotnet-editorconfig 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

dotnet-editorconfig 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

dotnet-editorconfig 用的人多吗?

公开数据是累计安装 324 次,近一周安装 13 次,下载 105 次,GitHub 15 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

dotnet-editorconfig 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
dotnet-editorconfig

点网编辑器配置 · 本页

32415需要联网未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

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.

# 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:

PatternMatches
[*.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

RangeCategoryExamples
IDE0001-IDE0009SimplificationIDE0001 (simplify name), IDE0003 (remove this. qualification), IDE0005 (remove unnecessary using)
IDE0010-IDE0039Expression preferencesIDE0016 (throw expression), IDE0017 (object initializer), IDE0018 (inline variable), IDE0028 (collection initializer), IDE0034 (simplify default), IDE0039 (use local function)
IDE0040-IDE0069Modifier and access preferencesIDE0040 (add accessibility modifiers), IDE0044 (add readonly), IDE0062 (make local function static)
IDE0070-IDE0090+Pattern matching and modern syntaxIDE0071 (simplify interpolation), IDE0078 (use pattern matching), IDE0090 (simplify new expression)
IDE0100-IDE0180Additional simplificationIDE0130 (namespace match folder), IDE0160/IDE0161 (block vs file-scoped namespace)
IDE0200-IDE0260Lambda and method preferencesIDE0200 (remove unnecessary lambda), IDE0230 (use UTF-8 string literal)
IDE1005-IDE1006Naming rulesIDE1006 (naming rule violation)

Configuring Code Style Preferences

[*.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:

[*.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

[*.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:

SeverityBuild OutputIDE SquigglesError ListFails Build (TreatWarningsAsErrors)
errorYes (error)RedError tabAlways
warningYes (warning)GreenWarning tabYes (with TreatWarningsAsErrors)
suggestionNoGray dotsMessage tabNo
silentNoNoNoNo (code fix available, not shown in build or Error List)
noneNoNoNoNo (rule fully disabled)

Bulk Severity Configuration

Set default severity for entire categories:

[*.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, Documentation, Globalization, Interoperability, Maintainability, Naming, Performance, SingleFile, Reliability, Security, Usage. IDE* rules do not participate in category-level bulk configuration -- configure them individually via dotnet_diagnostic.IDE*.severity.

Per-rule entries override category-level settings. Category-level settings override AnalysisLevel defaults.

Precedence order (highest to lowest):

  1. Per-rule: dotnet_diagnostic.CA1822.severity = error
  2. Per-category: dotnet_analyzer_diagnostic.category-Performance.severity = warning
  3. AnalysisLevel baseline (set in MSBuild properties)

AnalysisLevel and EnforceCodeStyleInBuild

AnalysisLevel controls which built-in CA rules are enabled and their default severities. Values range from latest (default, correctness only) through latest-all (all rules). Pin to a specific.NET SDK major version (e.g., 8-all, 10-all) to lock the rule set across SDK upgrades. Use preview-all for the broadest coverage including experimental rules. For the full AnalysisLevel values table and setup guidance, see [skill:dotnet-add-analyzers].

EnforceCodeStyleInBuild

By default, IDE* rules only run in the IDE, not during dotnet build. Enable build enforcement:

<PropertyGroup>
  <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

This is critical for CI enforcement -- without it, code style violations slip through even if configured as warnings or errors in .editorconfig. Combine with TreatWarningsAsErrors for strict enforcement:

<PropertyGroup>
  <AnalysisLevel>latest-all</AnalysisLevel>
  <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
  <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

Global AnalyzerConfig Files (.globalconfig)

Global AnalyzerConfig files (.globalconfig) provide an alternative to .editorconfig for analyzer configuration. They apply globally to all files in the compilation without requiring directory-relative placement.

When to Use.globalconfig vs.editorconfig

Aspect.editorconfig.globalconfig
ScopeDirectory-relative (file glob sections)Entire compilation (no file sections)
HierarchyMerges upward through directoriesFlat -- no directory traversal
IDE supportFull (formatting, refactoring, analysis)Analysis rules only
Use casePer-directory formatting + analysisShared rule configuration across projects or NuGet packages

.globalconfig Syntax

# Filename: .globalconfig (or any name with is_global = true)
is_global = true

# Global level determines priority (higher number = higher priority)
global_level = 100

# Configure rules (same syntax as .editorconfig, without [*.cs] sections)
dotnet_diagnostic.CA1822.severity = warning
dotnet_diagnostic.CA2007.severity = none
dotnet_diagnostic.IDE0005.severity = warning

Including.globalconfig in a Project

Reference via MSBuild GlobalAnalyzerConfigFiles item:

<!-- Directory.Build.props -->
<ItemGroup>
  <GlobalAnalyzerConfigFiles Include="$(MSBuildThisFileDirectory).globalconfig" />
</ItemGroup>

NuGet analyzer packages can ship .globalconfig files in buildTransitive/ to apply default severities to consumers.

global_level Precedence

When multiple .globalconfig files apply, the global_level value determines which one wins. Higher values take precedence. The SDK default global config uses global_level = -1. User configs should use global_level = 0 or higher (default when omitted is 0). NuGet-shipped configs use negative values to allow user overrides.

Full precedence order (highest to lowest):

  1. Per-rule .editorconfig entries
  2. Per-category .editorconfig entries
  3. .globalconfig with highest global_level
  4. .globalconfig with lower global_level
  5. SDK default configuration (AnalysisLevel)

Naming Rules (IDE1006)

EditorConfig supports custom naming rules that enforce naming conventions at build time (when EnforceCodeStyleInBuild is enabled):

[*.cs]
# Define symbol groups
dotnet_naming_symbols.public_members.applicable_kinds = property, method, field, event
dotnet_naming_symbols.public_members.applicable_accessibilities = public

dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private

dotnet_naming_symbols.interfaces.applicable_kinds = interface

# Define naming styles
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.underscore_prefix.capitalization = camel_case
dotnet_naming_style.underscore_prefix.required_prefix = _

dotnet_naming_style.interface_prefix.capitalization = pascal_case
dotnet_naming_style.interface_prefix.required_prefix = I

# Bind rules (lower number = higher priority)
dotnet_naming_rule.interfaces_must_start_with_i.symbols = interfaces
dotnet_naming_rule.interfaces_must_start_with_i.style = interface_prefix
dotnet_naming_rule.interfaces_must_start_with_i.severity = warning

dotnet_naming_rule.public_members_pascal_case.symbols = public_members
dotnet_naming_rule.public_members_pascal_case.style = pascal_case
dotnet_naming_rule.public_members_pascal_case.severity = warning

dotnet_naming_rule.private_fields_underscore.symbols = private_fields
dotnet_naming_rule.private_fields_underscore.style = underscore_prefix
dotnet_naming_rule.private_fields_underscore.severity = warning

Common Configuration Templates

Recommended Baseline (.editorconfig)

root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.cs]
# Namespace and using preferences
csharp_style_namespace_declarations = file_scoped:warning
csharp_using_directive_placement = outside_namespace:warning
dotnet_sort_system_directives_first = true

# Code style enforcement in build
dotnet_diagnostic.IDE0005.severity = warning
dotnet_diagnostic.IDE0161.severity = warning
dotnet_diagnostic.IDE0090.severity = suggestion

# CA rule adjustments
dotnet_diagnostic.CA1848.severity = warning
dotnet_diagnostic.CA2016.severity = warning

Test Project Overrides (tests/.editorconfig)

Place a separate .editorconfig in the tests/ directory to relax rules that conflict with test readability. For common per-project-type suppression patterns (ASP.NET Core apps, libraries, test projects), see [skill:dotnet-add-analyzers].

[*.cs]
# Relax rules for test readability
dotnet_diagnostic.CA1707.severity = none          # Allow underscores in test names
dotnet_diagnostic.CA1822.severity = none          # Test methods often not static
dotnet_diagnostic.IDE0058.severity = none         # Expression value is never used

Generated Code Configuration

Source generators and scaffolding tools produce code that often triggers IDE/CA warnings. Use the generated_code = true setting or file glob patterns to suppress analysis on generated files:

# Suppress warnings in generated code files
[*.g.cs]
generated_code = true

[*.generated.cs]
generated_code = true

When generated_code = true is set, Roslyn treats the file as generated code and applies the GeneratedCodeAnalysisFlags configured in each analyzer (most analyzers skip generated code by default). This is particularly relevant when using source generators -- see [skill:dotnet-csharp-source-generators].


References

平台分布

Codex

36.14%
按下载量换算38

Claude

27.97%
按下载量换算29

Cursor

18.59%
按下载量换算20

Gemini CLI

8.46%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

未通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills