重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
dotnet-csharp by novotnyllc/dotnet-artisan
npx skills add https://github.com/novotnyllc/dotnet-artisan --skill dotnet-csharpC# 语言模式、编码标准以及 .NET 运行时特性,用于编写地道、高性能的代码。此整合技能涵盖 25 个主题领域。请根据下方的路由表,从 references/ 目录加载相应的配套文件。
这些参考文件定义了适用于所有 C# 代码的正确性和质量标准——无论用户请求什么,在生成或审查代码时都应默认加载它们:
references/coding-standards.md — 命名约定、文件布局、样式规则references/async-patterns.md — async/await 正确性、ConfigureAwait、取消传播(几乎所有 .NET 代码都使用异步)references/solid-principles.md — SOLID、DRY、单一职责、依赖倒置、反模式检测references/code-smells.md — 代理应避免的常见错误(无需被告知),例如 async void、DI 生命周期误用、吞没异常references/dotnet-releases.md — .NET 10/11 和 C# 14/15 特性、版本矩阵、特定于 TFM 的代码生成规则(弥补训练数据截止日期)当主题匹配时加载这些文件(参见路由表关键词):
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 主题 | 关键词 | 描述 | 配套文件 |
|---|---|---|---|
| 编码标准 | naming, file layout, style rules | 基线 C# 约定(命名、布局、样式规则) | references/coding-standards.md |
| 异步/等待 | async, Task, ConfigureAwait, cancellation | async/await、Task 模式、ConfigureAwait、取消 | references/async-patterns.md |
| 依赖注入 | DI, services, scopes, keyed, lifetimes | MS DI、键控服务、作用域、装饰器、生命周期 | references/dependency-injection.md |
| 配置 | Options pattern, user secrets, feature flags | Options 模式、用户机密、功能标志、IOptions<T> | references/configuration.md |
| 源生成器 | IIncrementalGenerator, GeneratedRegex, LoggerMessage | IIncrementalGenerator、GeneratedRegex、LoggerMessage、STJ | references/source-generators.md |
| 可空引用类型 | annotations, migration, agent mistakes | 注解策略、迁移、代理常见错误 | references/nullable-reference-types.md |
| 序列化 | System.Text.Json, Protobuf, MessagePack, AOT | System.Text.Json 源生成器、Protobuf、MessagePack | references/serialization.md |
| 通道 | Channel<T>, bounded/unbounded, backpressure | Channel<T>、有界/无界、背压、排空 | references/channels.md |
| LINQ 优化 | IQueryable vs IEnumerable, compiled queries | IQueryable 与 IEnumerable、编译查询、内存分配 | references/linq-optimization.md |
| 领域建模 | aggregates, value objects, domain events | 聚合、值对象、领域事件、仓储 | references/domain-modeling.md |
| SOLID 原则 | SRP, DRY, anti-patterns, compliance checks | SOLID 和 DRY 原则、C# 反模式、修复方案 | references/solid-principles.md |
| 并发 | lock, SemaphoreSlim, Interlocked, concurrent collections | lock、SemaphoreSlim、Interlocked、并发集合 | references/concurrency-patterns.md |
| Roslyn 分析器 | DiagnosticAnalyzer, CodeFixProvider, multi-version | DiagnosticAnalyzer、CodeFixProvider、CodeRefactoring | references/roslyn-analyzers.md |
| Editorconfig | IDE/CA severity, AnalysisLevel, globalconfig | IDE/CA 严重性、AnalysisLevel、globalconfig、强制执行 | references/editorconfig.md |
| 文件 I/O | FileStream, RandomAccess, FileSystemWatcher, paths | FileStream、RandomAccess、FileSystemWatcher、MemoryMappedFile | references/file-io.md |
| 原生互操作 | P/Invoke, LibraryImport, ComWrappers, marshalling | P/Invoke、LibraryImport、ComWrappers、封送处理、跨平台 | references/native-interop.md |
| 输入验证 | .NET 10 AddValidation, FluentValidation | .NET 10 AddValidation、FluentValidation、ProblemDetails | references/input-validation.md |
| 验证模式 | DataAnnotations, IValidatableObject, IValidateOptions | DataAnnotations、IValidatableObject、IValidateOptions<T> | references/validation-patterns.md |
| 现代模式 | records, pattern matching, primary constructors | 记录类型、模式匹配、主构造函数、C# 12-15 | references/modern-patterns.md |
| API 设计 | naming, parameter ordering, return types, extensions | 命名、参数顺序、返回类型、错误模式 | references/api-design.md |
| 类型设计/性能 | struct vs class, sealed, Span/Memory, collections | struct 与 class、sealed、Span/Memory、集合 | references/type-design-performance.md |
| 代码异味 | anti-patterns, async misuse, DI mistakes, fixes | 反模式、异步误用、DI 错误、修复方案 | references/code-smells.md |
| .NET 版本 | .NET 10, .NET 11, C# 14, C# 15, TFM, version, union, extension blocks, field keyword | 版本矩阵、新特性、特定于 TFM 的代码生成 | references/dotnet-releases.md |
| 全球化 | CultureInfo, StringComparison, TimeZoneInfo, Rune, encoding | 文化感知编码、字符串比较、时区、字符处理 | references/globalization.md |
| WASM 互操作 | JSImport, JSExport, standalone WASM, wasm-experimental, browser | JSImport/JSExport、独立的 .NET WASM、浏览器 API、WASM AOT | references/wasm-interop.md |
每周安装次数
72
代码仓库
GitHub 星标数
196
首次出现
2026年2月27日
安全审计
安装于
github-copilot69
opencode69
codex69
gemini-cli68
amp68
cline68
C# language patterns, coding standards, and .NET runtime features for idiomatic, performant code. This consolidated skill spans 25 topic areas. Load the appropriate companion file from references/ based on the routing table below.
These references define correctness and quality standards that apply to all C# code — load them by default whenever producing or reviewing code, regardless of what the user asked for:
references/coding-standards.md — naming conventions, file layout, style rulesreferences/async-patterns.md — async/await correctness, ConfigureAwait, cancellation propagation (nearly all .NET code uses async)references/solid-principles.md — SOLID, DRY, single responsibility, dependency inversion, anti-pattern detectionreferences/code-smells.md — common mistakes the agent should avoid without being told (async void, DI lifetime misuse, swallowed exceptions)references/dotnet-releases.md — .NET 10/11 and C# 14/15 features, version matrix, TFM-specific code generation rules (compensates for training data cutoff)Load these when the topic matches (see Routing Table keywords):
| Topic | Keywords | Description | Companion File |
|---|---|---|---|
| Coding standards | naming, file layout, style rules | Baseline C# conventions (naming, layout, style rules) | references/coding-standards.md |
| Async/await | async, Task, ConfigureAwait, cancellation | async/await, Task patterns, ConfigureAwait, cancellation | references/async-patterns.md |
| Dependency injection | DI, services, scopes, keyed, lifetimes | MS DI, keyed services, scopes, decoration, lifetimes | references/dependency-injection.md |
| Configuration | Options pattern, user secrets, feature flags | Options pattern, user secrets, feature flags, IOptions<T> | references/configuration.md |
| Source generators | IIncrementalGenerator, GeneratedRegex, LoggerMessage | IIncrementalGenerator, GeneratedRegex, LoggerMessage, STJ | references/source-generators.md |
| Nullable reference types | annotations, migration, agent mistakes |
Weekly Installs
72
Repository
GitHub Stars
196
First Seen
Feb 27, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
github-copilot69
opencode69
codex69
gemini-cli68
amp68
cline68
minimax-docx:基于 OpenXML SDK 的 DOCX 文档自动化创建与编辑工具
1,300 周安装
| Annotation strategies, migration, agent mistakes |
| references/nullable-reference-types.md |
| Serialization | System.Text.Json, Protobuf, MessagePack, AOT | System.Text.Json source generators, Protobuf, MessagePack | references/serialization.md |
| Channels | Channel<T>, bounded/unbounded, backpressure | Channel<T>, bounded/unbounded, backpressure, drain | references/channels.md |
| LINQ optimization | IQueryable vs IEnumerable, compiled queries | IQueryable vs IEnumerable, compiled queries, allocations | references/linq-optimization.md |
| Domain modeling | aggregates, value objects, domain events | Aggregates, value objects, domain events, repositories | references/domain-modeling.md |
| SOLID principles | SRP, DRY, anti-patterns, compliance checks | SOLID and DRY principles, C# anti-patterns, fixes | references/solid-principles.md |
| Concurrency | lock, SemaphoreSlim, Interlocked, concurrent collections | lock, SemaphoreSlim, Interlocked, concurrent collections | references/concurrency-patterns.md |
| Roslyn analyzers | DiagnosticAnalyzer, CodeFixProvider, multi-version | DiagnosticAnalyzer, CodeFixProvider, CodeRefactoring | references/roslyn-analyzers.md |
| Editorconfig | IDE/CA severity, AnalysisLevel, globalconfig | IDE/CA severity, AnalysisLevel, globalconfig, enforcement | references/editorconfig.md |
| File I/O | FileStream, RandomAccess, FileSystemWatcher, paths | FileStream, RandomAccess, FileSystemWatcher, MemoryMappedFile | references/file-io.md |
| Native interop | P/Invoke, LibraryImport, ComWrappers, marshalling | P/Invoke, LibraryImport, ComWrappers, marshalling, cross-platform | references/native-interop.md |
| Input validation | .NET 10 AddValidation, FluentValidation | .NET 10 AddValidation, FluentValidation, ProblemDetails | references/input-validation.md |
| Validation patterns | DataAnnotations, IValidatableObject, IValidateOptions | DataAnnotations, IValidatableObject, IValidateOptions<T> | references/validation-patterns.md |
| Modern patterns | records, pattern matching, primary constructors | Records, pattern matching, primary constructors, C# 12-15 | references/modern-patterns.md |
| API design | naming, parameter ordering, return types, extensions | Naming, parameter ordering, return types, error patterns | references/api-design.md |
| Type design/perf | struct vs class, sealed, Span/Memory, collections | struct vs class, sealed, Span/Memory, collections | references/type-design-performance.md |
| Code smells | anti-patterns, async misuse, DI mistakes, fixes | Anti-patterns, async misuse, DI mistakes, fixes | references/code-smells.md |
| .NET releases | .NET 10, .NET 11, C# 14, C# 15, TFM, version, union, extension blocks, field keyword | Version matrix, new features, TFM-specific code generation | references/dotnet-releases.md |
| Globalization | CultureInfo, StringComparison, TimeZoneInfo, Rune, encoding | Culture-aware coding, string comparison, time zones, character processing | references/globalization.md |
| WASM interop | JSImport, JSExport, standalone WASM, wasm-experimental, browser | JSImport/JSExport, standalone .NET WASM, browser APIs, WASM AOT | references/wasm-interop.md |