[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79WVDG1MTP65Q489WZTVVBD":3,"skill-same:01M79WVDG1MTP65Q489WZTVVBD":65},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M79WVDG1MTP65Q489WZTVVBD","modern-csharp-coding-standards",null,"Write modern, high-performance C# code using records, pattern matching, value objects, async\u002Fawait, Span\u003CT>\u002FMemory\u003CT>, and best-practice API design patterns. Emphasizes functional-style programming with C# 12+ features.","Blind-Striker\u002Fagent-skills-and-plugins","Blind-Striker","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1965259?v=4","01M79WFXTE5PH0C1VB7B54ANMN","Deniz İrgin","01M79WFXV5KZ5GST1K8G035DM5",1,"MIT","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fcodex\u002Fdeniz-dotnet-general\u002Fskills\u002Fmodern-csharp-coding-standards\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: modern-csharp-coding-standards\ndescription: Write modern, high-performance C# code using records, pattern\n  matching, value objects, async\u002Fawait, Span\u003CT>\u002FMemory\u003CT>, and best-practice API\n  design patterns. Emphasizes functional-style programming with C# 12+ features.\n---\n\n# Modern C# Coding Standards\n\n## When to Use This Skill\n\nUse this skill when:\n- Writing new C# code or refactoring existing code\n- Designing public APIs for libraries or services\n- Optimizing performance-critical code paths\n- Implementing domain models with strong typing\n- Building async\u002Fawait-heavy applications\n- Working with binary data, buffers, or high-throughput scenarios\n\nA request to modernize existing code without changing its behavior belongs to the `$deniz-dotnet-general:csharp-refactoring` skill, which applies only the idioms the repository's analyzers enforce: this skill's record and value-object preferences change equality and copying, so they are for new code or a requested redesign.\n\n## Reference Files\n\n- [value-objects-and-patterns.md](value-objects-and-patterns.md): Full value object examples and pattern matching code\n- [performance-and-api-design.md](performance-and-api-design.md): Span\u003CT>\u002FMemory\u003CT> examples and API design principles\n- [composition-and-error-handling.md](composition-and-error-handling.md): Composition over inheritance, Result type, testing patterns\n- [anti-patterns-and-reflection.md](anti-patterns-and-reflection.md): Reflection avoidance and common anti-patterns\n\n## Core Principles\n\n1. **Immutability by Default** - Use `record` types and `init`-only properties\n2. **Type Safety** - Leverage nullable reference types and value objects\n3. **Modern Pattern Matching** - Use `switch` expressions and patterns extensively\n4. **Async Everywhere** - Prefer async APIs with proper cancellation support\n5. **Zero-Allocation Patterns** - Use `Span\u003CT>` and `Memory\u003CT>` for performance-critical code\n6. **API Design** - Accept abstractions, return appropriately specific types\n7. **Composition Over Inheritance** - Avoid abstract base classes, prefer composition\n8. **Value Objects as Structs** - Use `readonly record struct` for value objects\n\n---\n\n## Language Patterns\n\n### Records for Immutable Data (C# 9+)\n\nUse `record` types for DTOs, messages, events, and domain entities.\n\n```csharp\n\u002F\u002F Simple immutable DTO\npublic record CustomerDto(string Id, string Name, string Email);\n\n\u002F\u002F Record with validation in constructor\npublic record EmailAddress\n{\n    public string Value { get; init; }\n\n    public EmailAddress(string value)\n    {\n        if (string.IsNullOrWhiteSpace(value) || !value.Contains('@'))\n            throw new ArgumentException(\"Invalid email address\", nameof(value));\n\n        Value = value;\n    }\n}\n\n\u002F\u002F Records with collections - use IReadOnlyList\npublic record ShoppingCart(\n    string CartId,\n    string CustomerId,\n    IReadOnlyList\u003CCartItem> Items\n)\n{\n    public decimal Total => Items.Sum(item => item.Price * item.Quantity);\n}\n```\n\n**When to use `record class` vs `record struct`:**\n- `record class` (default): Reference types, use for entities, aggregates, DTOs with multiple properties\n- `record struct`: Value types, use for value objects (see next section)\n\n### Value Objects as readonly record struct\n\nValue objects should **always be `readonly record struct`** for performance and value semantics. Use explicit conversions, never implicit operators.\n\n```csharp\npublic readonly record struct OrderId(string Value)\n{\n    public OrderId(string value) : this(\n        !string.IsNullOrWhiteSpace(value)\n            ? value\n            : throw new ArgumentException(\"OrderId cannot be empty\", nameof(value)))\n    { }\n    public override string ToString() => Value;\n}\n\npublic readonly record struct Money(decimal Amount, string Currency);\npublic readonly record struct CustomerId(Guid Value)\n{\n    public static CustomerId New() => new(Guid.NewGuid());\n}\n```\n\nSee [value-objects-and-patterns.md](value-objects-and-patterns.md) for complete examples including multi-value objects, factory patterns, and the no-implicit-conversion rule.\n\n### Pattern Matching (C# 8-12)\n\nUse switch expressions, property patterns, relational patterns, and list patterns for cleaner code.\n\n```csharp\npublic decimal CalculateDiscount(Order order) => order switch\n{\n    { Total: > 1000m } => order.Total * 0.15m,\n    { Total: > 500m } => order.Total * 0.10m,\n    { Total: > 100m } => order.Total * 0.05m,\n    _ => 0m\n};\n```\n\nSee [value-objects-and-patterns.md](value-objects-and-patterns.md) for full pattern matching examples.\n\n---\n\n### Nullable Reference Types (C# 8+)\n\nEnable nullable reference types in your project and handle nulls explicitly.\n\n```csharp\n\u002F\u002F In .csproj\n\u003CPropertyGroup>\n    \u003CNullable>enable\u003C\u002FNullable>\n\u003C\u002FPropertyGroup>\n\n\u002F\u002F Explicit nullability\npublic string? FindUserName(string userId)\n{\n    var user = _repository.Find(userId);\n    return user?.Name;\n}\n\n\u002F\u002F Pattern matching with null checks\npublic decimal GetDiscount(Customer? customer) => customer switch\n{\n    null => 0m,\n    { IsVip: true } => 0.20m,\n    { OrderCount: > 10 } => 0.10m,\n    _ => 0.05m\n};\n\n\u002F\u002F Guard clauses with ArgumentNullException.ThrowIfNull (C# 11+)\npublic void ProcessOrder(Order? order)\n{\n    ArgumentNullException.ThrowIfNull(order);\n    \u002F\u002F order is now non-nullable in this scope\n    Console.WriteLine(order.Id);\n}\n```\n\n---\n\n## Composition Over Inheritance\n\n**Avoid abstract base classes.** Use interfaces + composition. Use static helpers for shared logic. Use records with factory methods for variants.\n\nSee [composition-and-error-handling.md](composition-and-error-handling.md) for full examples.\n\n---\n\n## Performance Patterns\n\n### Async\u002FAwait Best Practices\n\n```csharp\n\u002F\u002F Async all the way - always accept CancellationToken\npublic async Task\u003COrder> GetOrderAsync(string orderId, CancellationToken cancellationToken)\n{\n    var order = await _repository.GetAsync(orderId, cancellationToken);\n    return order;\n}\n\n\u002F\u002F ValueTask for frequently-called, often-synchronous methods\npublic ValueTask\u003COrder?> GetCachedOrderAsync(string orderId, CancellationToken cancellationToken)\n{\n    if (_cache.TryGetValue(orderId, out var order))\n        return ValueTask.FromResult\u003COrder?>(order);\n    return GetFromDatabaseAsync(orderId, cancellationToken);\n}\n\n\u002F\u002F IAsyncEnumerable for streaming\npublic async IAsyncEnumerable\u003COrder> StreamOrdersAsync(\n    string customerId,\n    [EnumeratorCancellation] CancellationToken cancellationToken = default)\n{\n    await foreach (var order in _repository.StreamAllAsync(cancellationToken))\n    {\n        if (order.CustomerId == customerId)\n            yield return order;\n    }\n}\n```\n\n**Key rules:**\n- Always accept `CancellationToken` with `= default`\n- Use `ConfigureAwait(false)` in library code\n- Never block on async code (no `.Result` or `.Wait()`)\n- Use linked CancellationTokenSource for timeouts\n\n### Span\u003CT> and Memory\u003CT>\n\nUse `Span\u003CT>` for synchronous zero-allocation operations, `Memory\u003CT>` for async, and `ArrayPool\u003CT>` for large temporary buffers.\n\nSee [performance-and-api-design.md](performance-and-api-design.md) for complete Span\u002FMemory examples and the API design section.\n\n---\n\n## Error Handling: Result Type\n\nFor expected errors, use a domain-specific result type instead of exceptions, not a generic `Result\u003CT>`. Use exceptions only for unexpected\u002Fsystem errors.\n\nSee [composition-and-error-handling.md](composition-and-error-handling.md) for the full Result type implementation and usage examples.\n\n---\n\n## Avoid Reflection-Based Metaprogramming\n\n**Banned:** AutoMapper, Mapster, ExpressMapper. Use explicit mapping extension methods instead. Use `UnsafeAccessorAttribute` (.NET 8+) when you genuinely need private member access.\n\nSee [anti-patterns-and-reflection.md](anti-patterns-and-reflection.md) for full guidance.\n\n---\n\n## Code Organization\n\n```csharp\n\u002F\u002F File: Domain\u002FOrders\u002FOrder.cs\n\nnamespace MyApp.Domain.Orders;\n\n\u002F\u002F 1. Primary domain type\npublic record Order(\n    OrderId Id,\n    CustomerId CustomerId,\n    Money Total,\n    OrderStatus Status,\n    IReadOnlyList\u003COrderItem> Items\n)\n{\n    public bool IsCompleted => Status is OrderStatus.Completed;\n\n    public Result\u003COrder, OrderError> AddItem(OrderItem item)\n    {\n        if (Status is not OrderStatus.Draft)\n            return Result\u003COrder, OrderError>.Failure(\n                new OrderError(\"ORDER_NOT_DRAFT\", \"Can only add items to draft orders\"));\n\n        var newItems = Items.Append(item).ToList();\n        var newTotal = new Money(\n            Items.Sum(i => i.Total.Amount) + item.Total.Amount,\n            Total.Currency);\n\n        return Result\u003COrder, OrderError>.Success(\n            this with { Items = newItems, Total = newTotal });\n    }\n}\n\n\u002F\u002F 2. Enums for state\npublic enum OrderStatus { Draft, Submitted, Processing, Completed, Cancelled }\n\n\u002F\u002F 3. Related types\npublic record OrderItem(ProductId ProductId, Quantity Quantity, Money UnitPrice)\n{\n    public Money Total => new(UnitPrice.Amount * Quantity.Value, UnitPrice.Currency);\n}\n\n\u002F\u002F 4. Value objects\npublic readonly record struct OrderId(Guid Value)\n{\n    public static OrderId New() => new(Guid.NewGuid());\n}\n\n\u002F\u002F 5. Errors\npublic readonly record struct OrderError(string Code, string Message);\n```\n\n---\n\n## Best Practices Summary\n\n### DO's\n- Use `record` for DTOs, messages, and domain entities\n- Use `readonly record struct` for value objects\n- Leverage pattern matching with `switch` expressions\n- Enable and respect nullable reference types\n- Use async\u002Fawait for all I\u002FO operations\n- Accept `CancellationToken` in all async methods\n- Use `Span\u003CT>` and `Memory\u003CT>` for high-performance scenarios\n- Accept abstractions (`IEnumerable\u003CT>`, `IReadOnlyList\u003CT>`)\n- Use `Result\u003CT, TError>` for expected errors\n- Pool buffers with `ArrayPool\u003CT>` for large allocations\n- Prefer composition over inheritance\n\n### DON'Ts\n- Don't use mutable classes when records work\n- Don't use classes for value objects (use `readonly record struct`)\n- Don't create deep inheritance hierarchies\n- Don't ignore nullable reference type warnings\n- Don't block on async code (`.Result`, `.Wait()`)\n- Don't use `byte[]` when `Span\u003Cbyte>` suffices\n- Don't forget `CancellationToken` parameters\n- Don't return mutable collections from APIs\n- Don't throw exceptions for expected business errors\n- Don't allocate large arrays repeatedly (use `ArrayPool`)\n\nSee [anti-patterns-and-reflection.md](anti-patterns-and-reflection.md) for detailed anti-pattern examples.\n\n---\n\n## Additional Resources\n\n- **C# Language Specification**: https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fdotnet\u002Fcsharp\u002F\n- **Pattern Matching**: https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fdotnet\u002Fcsharp\u002Ffundamentals\u002Ffunctional\u002Fpattern-matching\n- **Span\u003CT> and Memory\u003CT>**: https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fdotnet\u002Fstandard\u002Fmemory-and-spans\u002F\n- **Async Best Practices**: https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Farchive\u002Fmsdn-magazine\u002F2013\u002Fmarch\u002Fasync-await-best-practices-in-asynchronous-programming\n- **.NET Performance Tips**: https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fdotnet\u002Fframework\u002Fperformance\u002F\n","# Modern C# Coding Standards\n\n## When to Use This Skill\n\nUse this skill when:\n- Writing new C# code or refactoring existing code\n- Designing public APIs for libraries or services\n- Optimizing performance-critical code paths\n- Implementing domain models with strong typing\n- Building async\u002Fawait-heavy applications\n- Working with binary data, buffers, or high-throughput scenarios\n\nA request to modernize existing code without changing its behavior belongs to the `$deniz-dotnet-general:csharp-refactoring` skill, which applies only the idioms the repository's analyzers enforce: this skill's record and value-object preferences change equality and copying, so they are for new code or a requested redesign.\n\n## Reference Files\n\n- [value-objects-and-patterns.md](value-objects-and-patterns.md): Full value object examples and pattern matching code\n- [performance-and-api-design.md](performance-and-api-design.md): Span\u003CT>\u002FMemory\u003CT> examples and API design principles\n- [composition-and-error-handling.md](composition-and-error-handling.md): Composition over inheritance, Result type, testing patterns\n- [anti-patterns-and-reflection.md](anti-patterns-and-reflection.md): Reflection avoidance and common anti-patterns\n\n## Core Principles\n\n1. **Immutability by Default** - Use `record` types and `init`-only properties\n2. **Type Safety** - Leverage nullable reference types and value objects\n3. **Modern Pattern Matching** - Use `switch` expressions and patterns extensively\n4. **Async Everywhere** - Prefer async APIs with proper cancellation support\n5. **Zero-Allocation Patterns** - Use `Span\u003CT>` and `Memory\u003CT>` for performance-critical code\n6. **API Design** - Accept abstractions, return appropriately specific types\n7. **Composition Over Inheritance** - Avoid abstract base classes, prefer composition\n8. **Value Objects as Structs** - Use `readonly record struct` for value objects\n\n---\n\n## Language Patterns\n\n### Records for Immutable Data (C# 9+)\n\nUse `record` types for DTOs, messages, events, and domain entities.\n\n```csharp\n\u002F\u002F Simple immutable DTO\npublic record CustomerDto(string Id, string Name, string Email);\n\n\u002F\u002F Record with validation in constructor\npublic record EmailAddress\n{\n    public string Value { get; init; }\n\n    public EmailAddress(string value)\n    {\n        if (string.IsNullOrWhiteSpace(value) || !value.Contains('@'))\n            throw new ArgumentException(\"Invalid email address\", nameof(value));\n\n        Value = value;\n    }\n}\n\n\u002F\u002F Records with collections - use IReadOnlyList\npublic record ShoppingCart(\n    string CartId,\n    string CustomerId,\n    IReadOnlyList\u003CCartItem> Items\n)\n{\n    public decimal Total => Items.Sum(item => item.Price * item.Quantity);\n}\n```\n\n**When to use `record class` vs `record struct`:**\n- `record class` (default): Reference types, use for entities, aggregates, DTOs with multiple properties\n- `record struct`: Value types, use for value objects (see next section)\n\n### Value Objects as readonly record struct\n\nValue objects should **always be `readonly record struct`** for performance and value semantics. Use explicit conversions, never implicit operators.\n\n```csharp\npublic readonly record struct OrderId(string Value)\n{\n    public OrderId(string value) : this(\n        !string.IsNullOrWhiteSpace(value)\n            ? value\n            : throw new ArgumentException(\"OrderId cannot be empty\", nameof(value)))\n    { }\n    public override string ToString() => Value;\n}\n\npublic readonly record struct Money(decimal Amount, string Currency);\npublic readonly record struct CustomerId(Guid Value)\n{\n    public static CustomerId New() => new(Guid.NewGuid());\n}\n```\n\nSee [value-objects-and-patterns.md](value-objects-and-patterns.md) for complete examples including multi-value objects, factory patterns, and the no-implicit-conversion rule.\n\n### Pattern Matching (C# 8-12)\n\nUse switch expressions, property patterns, relational patterns, and list patterns for cleaner code.\n\n```csharp\npublic decimal CalculateDiscount(Order order) => order switch\n{\n    { Total: > 1000m } => order.Total * 0.15m,\n    { Total: > 500m } => order.Total * 0.10m,\n    { Total: > 100m } => order.Total * 0.05m,\n    _ => 0m\n};\n```\n\nSee [value-objects-and-patterns.md](value-objects-and-patterns.md) for full pattern matching examples.\n\n---\n\n### Nullable Reference Types (C# 8+)\n\nEnable nullable reference types in your project and handle nulls explicitly.\n\n```csharp\n\u002F\u002F In .csproj\n\u003CPropertyGroup>\n    \u003CNullable>enable\u003C\u002FNullable>\n\u003C\u002FPropertyGroup>\n\n\u002F\u002F Explicit nullability\npublic string? FindUserName(string userId)\n{\n    var user = _repository.Find(userId);\n    return user?.Name;\n}\n\n\u002F\u002F Pattern matching with null checks\npublic decimal GetDiscount(Customer? customer) => customer switch\n{\n    null => 0m,\n    { IsVip: true } => 0.20m,\n    { OrderCount: > 10 } => 0.10m,\n    _ => 0.05m\n};\n\n\u002F\u002F Guard clauses with ArgumentNullException.ThrowIfNull (C# 11+)\npublic void ProcessOrder(Order? order)\n{\n    ArgumentNullException.ThrowIfNull(order);\n    \u002F\u002F order is now non-nullable in this scope\n    Console.WriteLine(order.Id);\n}\n```\n\n---\n\n## Composition Over Inheritance\n\n**Avoid abstract base classes.** Use interfaces + composition. Use static helpers for shared logic. Use records with factory methods for variants.\n\nSee [composition-and-error-handling.md](composition-and-error-handling.md) for full examples.\n\n---\n\n## Performance Patterns\n\n### Async\u002FAwait Best Practices\n\n```csharp\n\u002F\u002F Async all the way - always accept CancellationToken\npublic async Task\u003COrder> GetOrderAsync(string orderId, CancellationToken cancellationToken)\n{\n    var order = await _repository.GetAsync(orderId, cancellationToken);\n    return order;\n}\n\n\u002F\u002F ValueTask for frequently-called, often-synchronous methods\npublic ValueTask\u003COrder?> GetCachedOrderAsync(string orderId, CancellationToken cancellationToken)\n{\n    if (_cache.TryGetValue(orderId, out var order))\n        return ValueTask.FromResult\u003COrder?>(order);\n    return GetFromDatabaseAsync(orderId, cancellationToken);\n}\n\n\u002F\u002F IAsyncEnumerable for streaming\npublic async IAsyncEnumerable\u003COrder> StreamOrdersAsync(\n    string customerId,\n    [EnumeratorCancellation] CancellationToken cancellationToken = default)\n{\n    await foreach (var order in _repository.StreamAllAsync(cancellationToken))\n    {\n        if (order.CustomerId == customerId)\n            yield return order;\n    }\n}\n```\n\n**Key rules:**\n- Always accept `CancellationToken` with `= default`\n- Use `ConfigureAwait(false)` in library code\n- Never block on async code (no `.Result` or `.Wait()`)\n- Use linked CancellationTokenSource for timeouts\n\n### Span\u003CT> and Memory\u003CT>\n\nUse `Span\u003CT>` for synchronous zero-allocation operations, `Memory\u003CT>` for async, and `ArrayPool\u003CT>` for large temporary buffers.\n\nSee [performance-and-api-design.md](performance-and-api-design.md) for complete Span\u002FMemory examples and the API design section.\n\n---\n\n## Error Handling: Result Type\n\nFor expected errors, use a domain-specific result type instead of exceptions, not a generic `Result\u003CT>`. Use exceptions only for unexpected\u002Fsystem errors.\n\nSee [composition-and-error-handling.md](composition-and-error-handling.md) for the full Result type implementation and usage examples.\n\n---\n\n## Avoid Reflection-Based Metaprogramming\n\n**Banned:** AutoMapper, Mapster, ExpressMapper. Use explicit mapping extension methods instead. Use `UnsafeAccessorAttribute` (.NET 8+) when you genuinely need private member access.\n\nSee [anti-patterns-and-reflection.md](anti-patterns-and-reflection.md) for full guidance.\n\n---\n\n## Code Organization\n\n```csharp\n\u002F\u002F File: Domain\u002FOrders\u002FOrder.cs\n\nnamespace MyApp.Domain.Orders;\n\n\u002F\u002F 1. Primary domain type\npublic record Order(\n    OrderId Id,\n    CustomerId CustomerId,\n    Money Total,\n    OrderStatus Status,\n    IReadOnlyList\u003COrderItem> Items\n)\n{\n    public bool IsCompleted => Status is OrderStatus.Completed;\n\n    public Result\u003COrder, OrderError> AddItem(OrderItem item)\n    {\n        if (Status is not OrderStatus.Draft)\n            return Result\u003COrder, OrderError>.Failure(\n                new OrderError(\"ORDER_NOT_DRAFT\", \"Can only add items to draft orders\"));\n\n        var newItems = Items.Append(item).ToList();\n        var newTotal = new Money(\n            Items.Sum(i => i.Total.Amount) + item.Total.Amount,\n            Total.Currency);\n\n        return Result\u003COrder, OrderError>.Success(\n            this with { Items = newItems, Total = newTotal });\n    }\n}\n\n\u002F\u002F 2. Enums for state\npublic enum OrderStatus { Draft, Submitted, Processing, Completed, Cancelled }\n\n\u002F\u002F 3. Related types\npublic record OrderItem(ProductId ProductId, Quantity Quantity, Money UnitPrice)\n{\n    public Money Total => new(UnitPrice.Amount * Quantity.Value, UnitPrice.Currency);\n}\n\n\u002F\u002F 4. Value objects\npublic readonly record struct OrderId(Guid Value)\n{\n    public static OrderId New() => new(Guid.NewGuid());\n}\n\n\u002F\u002F 5. Errors\npublic readonly record struct OrderError(string Code, string Message);\n```\n\n---\n\n## Best Practices Summary\n\n### DO's\n- Use `record` for DTOs, messages, and domain entities\n- Use `readonly record struct` for value objects\n- Leverage pattern matching with `switch` expressions\n- Enable and respect nullable reference types\n- Use async\u002Fawait for all I\u002FO operations\n- Accept `CancellationToken` in all async methods\n- Use `Span\u003CT>` and `Memory\u003CT>` for high-performance scenarios\n- Accept abstractions (`IEnumerable\u003CT>`, `IReadOnlyList\u003CT>`)\n- Use `Result\u003CT, TError>` for expected errors\n- Pool buffers with `ArrayPool\u003CT>` for large allocations\n- Prefer composition over inheritance\n\n### DON'Ts\n- Don't use mutable classes when records work\n- Don't use classes for value objects (use `readonly record struct`)\n- Don't create deep inheritance hierarchies\n- Don't ignore nullable reference type warnings\n- Don't block on async code (`.Result`, `.Wait()`)\n- Don't use `byte[]` when `Span\u003Cbyte>` suffices\n- Don't forget `CancellationToken` parameters\n- Don't return mutable collections from APIs\n- Don't throw exceptions for expected business errors\n- Don't allocate large arrays repeatedly (use `ArrayPool`)\n\nSee [anti-patterns-and-reflection.md](anti-patterns-and-reflection.md) for detailed anti-pattern examples.\n\n---\n\n## Additional Resources\n\n- **C# Language Specification**: https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fdotnet\u002Fcsharp\u002F\n- **Pattern Matching**: https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fdotnet\u002Fcsharp\u002Ffundamentals\u002Ffunctional\u002Fpattern-matching\n- **Span\u003CT> and Memory\u003CT>**: https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fdotnet\u002Fstandard\u002Fmemory-and-spans\u002F\n- **Async Best Practices**: https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Farchive\u002Fmsdn-magazine\u002F2013\u002Fmarch\u002Fasync-await-best-practices-in-asynchronous-programming\n- **.NET Performance Tips**: https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fdotnet\u002Fframework\u002Fperformance\u002F\n",{"name":5,"description":7},"master","b30b1c1908dbc56a8184128f18803053d762ccb5","codex\u002Fdeniz-dotnet-general\u002Fskills\u002Fmodern-csharp-coding-standards",0,"https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins","https:\u002F\u002Fgithub.com\u002FBlind-Striker","denizirgin.com","VP of Engineering - \r\n@armutcom @homeruntech @prontopro\r\n |  Speaker \r\n@CodeFiction\r\n, http:\u002F\u002Fcodefiction.tech | Developer, gamer, blogger, maiden iron fan","2026-11-13 00:23:18",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Blind-Striker\u002Fagent-skills-and-plugins --skill modern-csharp-coding-standards",{"tool":39,"command":40},"bunx","bunx skills add Blind-Striker\u002Fagent-skills-and-plugins --skill modern-csharp-coding-standards",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Blind-Striker\u002Fagent-skills-and-plugins --skill modern-csharp-coding-standards","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fcodex\u002Fdeniz-dotnet-general\u002Fskills\u002Fmodern-csharp-coding-standards\u002FSKILL.md",true,[47,53,57,61],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"anti-patterns-and-reflection.md","REFERENCE","参考文档",8770,"https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fcodex\u002Fdeniz-dotnet-general\u002Fskills\u002Fmodern-csharp-coding-standards\u002Fanti-patterns-and-reflection.md",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"composition-and-error-handling.md",8082,"https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fcodex\u002Fdeniz-dotnet-general\u002Fskills\u002Fmodern-csharp-coding-standards\u002Fcomposition-and-error-handling.md",{"path":58,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":59,"sourceHtmlUrl":60},"performance-and-api-design.md",10263,"https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fcodex\u002Fdeniz-dotnet-general\u002Fskills\u002Fmodern-csharp-coding-standards\u002Fperformance-and-api-design.md",{"path":62,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":63,"sourceHtmlUrl":64},"value-objects-and-patterns.md",12610,"https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fcodex\u002Fdeniz-dotnet-general\u002Fskills\u002Fmodern-csharp-coding-standards\u002Fvalue-objects-and-patterns.md",[66,73,80,87,94,101],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M79YGWBJ52PHMSTKJ3RJ3AWR","writing-tunit-tests","Write tests in TUnit — the attributes, the async assertion model, data-driven cases, lifecycle hooks, and the parallelism rules. USE FOR writing or fixing a test in a TUnit project, translating a test idea into TUnit syntax, or reviewing TUnit test code for API mistakes. DO NOT USE FOR deciding what to test, judging whether a test is any good, or running tests.","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fskills\u002Fdeniz-dotnet-general\u002Fwriting-tunit-tests\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M79YGR3Y9RCRS6TD71D0KKP8","dotnet-walls","Walls for a .NET change in a repository without its own quality gates — pinned, ephemeral analyzer, format, clone and scanner commands for the verify step, their identity ratchet, and the build traps. Use during a walls preflight, or when a worker's verify step needs .NET quality gates.","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fskills\u002Fdeniz-dotnet-general\u002Fdotnet-walls\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M79YGFNJBST7D803NQW3SBYM","csharp-15","Write, review and modernize C# 15 (.NET 11) code correctly. Covers every C# 15 feature - collection expression arguments (`[with(...), ...]`), union types (`union`, `[Union]`, `IUnion`, custom unions), closed class hierarchies (`closed`), extension indexers, labeled `break`\u002F`continue`, non-virtual static interface members on runtimes without default interface methods, and the preview memory-safety model (`unsafe(expr)`, `safe`, requires-unsafe members). Use when code targets net11.0 or LangVersion 15\u002Fpreview, when the user mentions any of these features, when replacing marker interfaces, OneOf-style results, `goto`\u002Fflag loop exits or capacity\u002Fcomparer boilerplate, or when the build reports CS8121, CS8509, CS8655, CS8510, CS0121\u002FCS0411 on a `with(...)` element, CS9370, CS9380 or CS9363.","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fskills\u002Fdeniz-dotnet-general\u002Fcsharp-15\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M79YGAV031473HSX6FN87ENH","verified-waves","Run one task as verified multi-agent waves. Plans the fan-out, sends findings to fresh skeptics, keeps a ledger, and reports N of M done; small tasks stay solo.","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fskills\u002Fdeniz-coordination\u002Fverified-waves\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M79YG6QXNND4WRPP3GATSY8J","harness","The bundled dispatch harness, which runs a task file on worker models through OpenCode or Codex, fences their writes, escalates their asks to the operator, settles each result from git and its verify commands, and records every step in a ledger. Its commands, task file, modes and write fence, configuration, runs and their recovery, ledger and exit codes.","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fskills\u002Fdeniz-coordination\u002Fharness\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M79YG2P5S91SDTA5912XJ4FV","delegating-to-worker-models","Use when you hand off implementation, a plan, research a decision will rely on, or a review, and you brief the worker and check what comes back. A subagent that searches, reads in parallel, or keeps your context small is ordinary tool use. Covers what stays with you, the mechanism, assigning work by strength, the walls preflight, prompts without contradictions, the worker contract and model profiles, evidence from your own run, review, and the fix-up loop.","https:\u002F\u002Fgithub.com\u002FBlind-Striker\u002Fagent-skills-and-plugins\u002Fblob\u002Fmaster\u002Fskills\u002Fdeniz-coordination\u002Fdelegating-to-worker-models\u002FSKILL.md",[],[]]