@moon791017/neo-skills 1.1.33 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moon791017/neo-skills",
3
- "version": "1.1.33",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
5
  "description": "Neo Skills: A Universal AI Agent Skills Extension",
6
6
  "homepage": "https://neo-blog-iota.vercel.app/",
@@ -5,9 +5,9 @@ description: >
5
5
  Pipelines YAML for CI/CD, especially .NET builds, Azure App Service deploys, or
6
6
  IIS/on-premises deploys. Prefer bundled templates and verify task syntax against
7
7
  Microsoft docs when version-specific accuracy matters.
8
- compatibility: "Supports .NET 6.0 up to .NET 10.0."
8
+ compatibility: "Supports .NET 6.0 up to .NET 11.0."
9
9
  metadata:
10
- version: "1.0.0"
10
+ version: "1.1.0"
11
11
  category: "DevOps"
12
12
  ---
13
13
 
@@ -53,7 +53,7 @@ metadata:
53
53
 
54
54
  ### CI Workflow: .NET Build Pipeline
55
55
  When configuring a CI process for a .NET project:
56
- 1. Scan the project directory to identify the .NET version (e.g., .NET 6/8), project name, and solution file (`.sln`).
56
+ 1. Scan the project directory to identify the .NET version (e.g., .NET 8/10/11), project name, and solution file (`.sln`).
57
57
  2. Check for any existing pipeline configurations.
58
58
  3. Create the `.pipelines/templates/build/` and `.pipelines/templates/util/` directories.
59
59
  4. Copy `build/build-dotnet.yml` and `util/clean-artifact.yml` templates to their respective locations.
@@ -5,9 +5,9 @@ description: >
5
5
  projects. Trigger for .cs/.csproj files, C# language-version questions, nullable
6
6
  reference types, records, pattern matching, async/cancellation, or version-appropriate
7
7
  syntax from C# 10+.
8
- compatibility: "Supports C# 10 through 14. Adaptive to .NET 6.0, 7.0, 8.0, 9.0, and 10.0 environments."
8
+ compatibility: "Supports C# 10 through 15. Adaptive to .NET 6.0 through 11.0 environments."
9
9
  metadata:
10
- version: "1.4.0"
10
+ version: "1.5.0"
11
11
  category: "Core"
12
12
  ---
13
13
 
@@ -27,6 +27,7 @@ metadata:
27
27
  - `net8.0`: C# 12 (Primary Constructors, Collection Expressions).
28
28
  - `net9.0`: C# 13 (`params` collections, `Lock` object).
29
29
  - `net10.0`: C# 14 (Extension members, `field` keyword).
30
+ - `net11.0`: C# 15 (Union types, closed hierarchies, collection-spread arguments, labeled break/continue, extension indexers, inline unsafe expressions).
30
31
  2. **Reason (Planning Phase):**
31
32
  - Evaluate the modernization level of the current code to determine the refactoring strategy.
32
33
  - In lower version environments (like .NET 6), avoid using higher version syntax (like Primary Constructors), but prioritize using File-scoped namespaces.
@@ -40,7 +41,7 @@ metadata:
40
41
  - Check if asynchronous operations correctly handle cancellation tokens (`CancellationToken`).
41
42
  - Ensure naming conventions comply with official .NET recommendations.
42
43
 
43
- ## Feature Roadmap (C# 10 - 14)
44
+ ## Feature Roadmap (C# 10 - 15)
44
45
 
45
46
  ### C# 10 & 11 (Foundation)
46
47
  - **File-scoped Namespaces:** Reduce indentation levels.
@@ -55,12 +56,20 @@ metadata:
55
56
  - **`params` Collections:** Method parameters support various collection types.
56
57
  - **Implicit Span Conversion:** Handle memory-safe code more naturally.
57
58
 
58
- ### C# 14+ (Version-Specific Features)
59
+ ### C# 14 (Language Extensions)
59
60
  - **Extension Members:** Extension properties, operators, and static members.
60
61
  - **`field` Keyword:** Directly access backing fields in property logic.
61
62
  - **Null-conditional Assignment:** `target?.Property = value;`.
62
63
  - **Scripting:** Support `dotnet run file.cs` for direct execution.
63
64
 
65
+ ### C# 15 (Advanced Types & Productivity)
66
+ - **Union Types:** `public union Pet(Cat, Dog, Bird);` with exhaustive compiler-checked `switch` expressions without discarding `_`.
67
+ - **Closed Hierarchies:** `public closed record class State;` restricts inheritance strictly within the defining project/assembly for domain safety.
68
+ - **Collection Expression Arguments:** `[with(capacity: values.Length * 2), .. values]` or `[with(StringComparer.OrdinalIgnoreCase), ...]` for inline constructor customization.
69
+ - **Labeled Break & Continue:** Jump out of deeply nested loops directly with `break outer;` and `continue outer;`.
70
+ - **Extension Indexers:** Support `this[int index]` on extended types.
71
+ - **Localized Unsafe Expressions:** Fine-grained `unsafe(...)` expressions for localized pointer operations without marking entire methods unsafe.
72
+
64
73
  ## Coding Standards
65
74
  - **Clean Structure:** Prioritize using File-scoped namespaces.
66
75
  - **Immutability:** Use `record` for Data Transfer Objects (DTO).
@@ -79,6 +88,7 @@ metadata:
79
88
 
80
89
  ## Documentation
81
90
  ### Official References
91
+ - [What's new in C# 15 (Union types, closed hierarchies)](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-15)
82
92
  - [What's new in C# 14 (Extension Members, field keyword)](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-14)
83
93
  - [What's new in C# 13 (params collections, Lock object)](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-13)
84
94
  - [What's new in C# 12 (Primary Constructors, Collection Expressions)](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12)
@@ -123,6 +123,31 @@ This document lists common mistakes (Anti-Patterns) in C# development and their
123
123
  public string Name { get; set => field = value.Trim(); } // Using the field keyword
124
124
  ```
125
125
 
126
+ ### 4.4 Discarding Cases in Union Type Pattern Matching (C# 15+)
127
+ - **Legacy / Bad**:
128
+ ```csharp
129
+ // Blindly adding a discard case bypasses compile-time exhaustiveness checking!
130
+ string desc = pet switch
131
+ {
132
+ Cat c => "Cat",
133
+ _ => "Other" // When a new variant (e.g. Bird) is added to the union, no compiler error will trigger
134
+ };
135
+ ```
136
+ - **Modern / Good**:
137
+ ```csharp
138
+ // Rely on compiler exhaustiveness enforcement:
139
+ string desc = pet switch
140
+ {
141
+ Cat c => "Cat",
142
+ Dog d => "Dog",
143
+ Bird b => "Bird"
144
+ };
145
+ ```
146
+
147
+ ### 4.5 Leaking Domain Inheritance Without Closed Hierarchies (C# 15+)
148
+ - **Bad**: Exposing domain state hierarchies publicly without `closed`, allowing external assemblies to inherit and corrupt domain invariants.
149
+ - **Good**: Mark domain state record or class hierarchies as `closed` so only the defining assembly can declare subclasses.
150
+
126
151
  ---
127
152
 
128
153
  ## 5. Resource Management
@@ -1,6 +1,6 @@
1
1
  # Modern C# Patterns Guide
2
2
 
3
- This document introduces recommended development patterns in C# 10 through 14+, aiming to simplify code and improve performance using modern syntax.
3
+ This document introduces recommended development patterns in C# 10 through 15+, aiming to simplify code and improve performance using modern syntax.
4
4
 
5
5
  ## 1. Architecture and Declaration Patterns
6
6
 
@@ -139,4 +139,62 @@ if (input is not null) { ... }
139
139
 
140
140
  // Use null-coalescing assignment operator
141
141
  _logger ??= NullLogger.Instance;
142
- ```
142
+ ```
143
+
144
+ ---
145
+
146
+ ## 7. C# 15 Modern Patterns
147
+
148
+ ### 7.1 Union Types for Domain Modeling
149
+ **Recommendation**: Use `union` types to model closed variants without complex inheritance hierarchies, enabling exhaustive pattern matching.
150
+ ```csharp
151
+ public record class Cat(string Name);
152
+ public record class Dog(string Name);
153
+ public record class Bird(string Name);
154
+
155
+ public union Pet(Cat, Dog, Bird);
156
+
157
+ // Exhaustive switch expression enforced by compiler
158
+ public string DescribePet(Pet pet) => pet switch
159
+ {
160
+ Cat c => $"Cat named {c.Name}",
161
+ Dog d => $"Dog named {d.Name}",
162
+ Bird b => $"Bird named {b.Name}"
163
+ // No default discard _ needed
164
+ };
165
+ ```
166
+
167
+ ### 7.2 Closed Hierarchies for Secure Domain Classes
168
+ **Recommendation**: Use the `closed` modifier on base classes or records to prevent external libraries from subclassing domain states.
169
+ ```csharp
170
+ public closed abstract record class OrderStatus;
171
+ public record class Pending() : OrderStatus;
172
+ public record class Shipped(DateTime ShippedAt) : OrderStatus;
173
+ ```
174
+
175
+ ### 7.3 Collection Expressions with Arguments
176
+ **Recommendation**: Use `with(...)` at the start of a collection expression to supply constructor arguments such as capacity or comparers inline.
177
+ ```csharp
178
+ // Inline capacity
179
+ List<string> items = [with(capacity: initialCount * 2), .. existingItems];
180
+
181
+ // Inline comparer
182
+ HashSet<string> keywords = [with(StringComparer.OrdinalIgnoreCase), "NET", "C#", "Rust"];
183
+ ```
184
+
185
+ ### 7.4 Labeled Break and Continue
186
+ **Recommendation**: In nested loops, use labeled `break` or `continue` to escape directly to the desired level without boolean flags.
187
+ ```csharp
188
+ search:
189
+ foreach (var batch in batches)
190
+ {
191
+ foreach (var item in batch)
192
+ {
193
+ if (item.IsTarget)
194
+ {
195
+ Process(item);
196
+ break search;
197
+ }
198
+ }
199
+ }
200
+ ```
@@ -5,9 +5,9 @@ description: >
5
5
  from an existing class. Trigger for extracting public members, filtering virtual
6
6
  or non-public members, enforcing getter-only properties, and safely creating,
7
7
  appending, or replacing interface blocks.
8
- compatibility: "Supports C# 12/13 and .NET 10.0."
8
+ compatibility: "Supports C# 12 through 15 and .NET 10.0/11.0."
9
9
  metadata:
10
- version: "1.0.0"
10
+ version: "1.1.0"
11
11
  category: "Core"
12
12
  ---
13
13
 
@@ -19,6 +19,7 @@ metadata:
19
19
  - Identify members with the `virtual` keyword.
20
20
  - Identify non-`public` members.
21
21
  3. **Environment Awareness**: When the user specifies a target file, read the file content to check for the existence of an Interface with the same name.
22
+ 4. **Language Constructs Check (C# 15)**: Verify whether the target type is a C# 15 `union` or a standard class/record. Union types represent closed type choices and usually do not require extracting traditional interfaces.
22
23
 
23
24
  ## Reason
24
25
  1. **Interface Generation Logic**:
@@ -5,9 +5,9 @@ description: >
5
5
  .sln/.csproj files and the exact ASP.NET/EF/C# subdomain is not yet clear. Detect
6
6
  the SDK/project shape, run or recommend .NET CLI commands, and route to Minimal
7
7
  APIs, Web API, MVC, Tag Helper, EF Core, or C# skills when appropriate.
8
- compatibility: "Supports .NET 6.0 and above. Requires .NET SDK installed on the local machine."
8
+ compatibility: "Supports .NET 6.0 through .NET 11.0+. Requires .NET SDK installed on the local machine."
9
9
  metadata:
10
- version: "1.0.0"
10
+ version: "1.1.0"
11
11
  category: "Framework"
12
12
  ---
13
13
 
@@ -20,28 +20,32 @@ This skill serves as the unified entry point for the .NET development environmen
20
20
 
21
21
  1. **Environment Detection and Version Validation**
22
22
  - Run `dotnet --version` to check the currently installed SDK version.
23
- - **Mandatory requirement**: Only **.NET 6 or higher** is supported. If a version lower than .NET 6 is detected, prompt the user to upgrade.
23
+ - **Mandatory requirement**: Only **.NET 6 or higher** is supported (including .NET 8 LTS, .NET 9, .NET 10 LTS, and .NET 11 STS). If a version lower than .NET 6 is detected, prompt the user to upgrade.
24
+ - For `net11.0` target frameworks, verify developer environment has the .NET 11 SDK installed.
24
25
 
25
26
  2. **Execute Appropriate .NET CLI**
26
27
  - Provide or execute modern CLI commands based on the detected version and project state.
27
- - Examples:
28
+ - Take advantage of modern tooling improvements:
29
+ - In .NET 11+, the Native AOT CLI host and MSBuild server significantly reduce invocation latency.
28
30
  - Build and run: `dotnet build`, `dotnet run`
29
- - Test: `dotnet test`
31
+ - Test: `dotnet test` (with multi-architecture and cross-platform testing enhancements in .NET 11)
30
32
  - Package management: `dotnet add package`, `dotnet tool restore`
31
33
 
32
34
  3. **Requirement Analysis and Dynamic Skill Routing**
33
35
  - Determine the involved domain based on the user's specific problem or project architecture.
34
36
  - If the user's task falls into the following specific domains, prepare to use or recommend the corresponding sub-skill:
37
+ - **`neo-csharp`**: When the requirement involves writing, refactoring, or modernizing C# language code (C# 10 through C# 15, Union Types, pattern matching, async safety).
35
38
  - **`neo-dotnet-minimal-apis`**: When the requirement is for lightweight routing development, high-performance microservices, and Controllers are not used.
36
39
  - **`neo-dotnet-webapi`**: When the requirement is for traditional RESTful API development following the controller pattern.
37
40
  - **`neo-dotnet-mvc`**: When the requirement involves Server-Side Rendering (SSR), Razor views, and ViewModels.
38
41
  - **`neo-dotnet-tag-helper`**: When the requirement is for developing custom Razor Tag Helpers using pure C# (without CSHTML), focusing on reusable UI components and logic.
39
- - **`neo-dotnet-ef-core`**: When the requirement involves database migrations, Linq query optimization, or model mapping.
42
+ - **`neo-dotnet-ef-core`**: When the requirement involves database migrations, Linq query optimization, model mapping, or EF Core 11 vector search.
40
43
 
41
44
  ## Usage Guidelines
42
- When this skill is triggered, please prioritize checking the SDK environment, then answer the user's .NET-related questions. If the problem is found to belong to one of the four professional domains mentioned above, proactively suggest and prepare to delegate it to the corresponding expert skill for processing.
45
+ When this skill is triggered, please prioritize checking the SDK environment, then answer the user's .NET-related questions. If the problem is found to belong to one of the professional domains mentioned above, proactively suggest and prepare to delegate it to the corresponding expert skill for processing.
43
46
 
44
47
  ## Documentation
45
48
 
46
49
  ### Official References
50
+ - [.NET 11 Overview & What's New](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-11)
47
51
  - [.NET CLI Tools Overview](https://learn.microsoft.com/en-us/dotnet/core/tools/)
@@ -4,9 +4,9 @@ description: >
4
4
  Use this skill when the task involves Entity Framework Core models, DbContext,
5
5
  migrations, LINQ queries, change tracking, database providers, performance tuning,
6
6
  or data access review in .NET projects.
7
- compatibility: "Supports .NET 6.0 through 10.0 environments. Compatible with SQL Server, PostgreSQL, MySQL, and SQLite."
7
+ compatibility: "Supports .NET 6.0 through 11.0 environments. Compatible with SQL Server, PostgreSQL, MySQL, and SQLite."
8
8
  metadata:
9
- version: "1.0.0"
9
+ version: "1.1.0"
10
10
  category: "Framework"
11
11
  ---
12
12
 
@@ -36,7 +36,7 @@ metadata:
36
36
  - Validate concurrency conflict handling logic.
37
37
  - Ensure all database accesses follow asynchronous patterns.
38
38
 
39
- ## Feature Roadmap (.NET 6 - 10)
39
+ ## Feature Roadmap (.NET 6 - 11)
40
40
 
41
41
  ### .NET 6 & 7 (Foundation)
42
42
  - **Split Queries**: Solve the Cartesian product problem.
@@ -50,10 +50,16 @@ metadata:
50
50
  - **Auto-compiled Queries**: Further optimize the query compilation process.
51
51
  - **Complex Types**: Better support for Value Objects.
52
52
 
53
- ### .NET 10+ (Version-Specific Features)
53
+ ### .NET 10 (Interceptors & AOT)
54
54
  - **Advanced Interceptors**: More query lifecycle hooks.
55
55
  - **Optimized AOT Support**: AOT pre-compilation optimization for cloud-native environments.
56
56
 
57
+ ### .NET 11 (Advanced Querying & AI Vector Integration)
58
+ - **Complex Types & JSON Columns in TPT/TPC**: Full modeling support for complex types and JSON columns across Table-Per-Type and Table-Per-Concrete-Type hierarchies.
59
+ - **LINQ Translation Enhancements**: `Queryable.FullJoin` translating directly to SQL `FULL OUTER JOIN`, `NULLIF` translation, and `EF.Functions.JsonPathExists()`.
60
+ - **Approximate Vector Search (SQL Server 2025)**: Native `.VectorSearch().WithApproximate()` leveraging `WITH APPROXIMATE` vector index searches; default SQL Server compatibility level upgraded to 160 (SQL Server 2022+).
61
+ - **Breaking Changes Awareness**: `SqlVector<T>` columns return `null` by default on queries without explicit projection; Cosmos DB synchronous I/O and `__jObject` shadow property removed; generic `CoreTypeMapping<T>` for NativeAOT.
62
+
57
63
  ## Coding Standards
58
64
  - **Fluent API Preference**: Prioritize entity configuration classes over Data Annotations.
59
65
  - **Async Always**: All I/O operations must be asynchronous.
@@ -72,6 +78,7 @@ metadata:
72
78
 
73
79
  ## Documentation
74
80
  ### Official References
81
+ - [What's new in EF Core 11](https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-11.0/whatsnew)
75
82
  - [Entity Framework Core Overview](https://learn.microsoft.com/en-us/ef/core/)
76
83
  - [Performance Optimization in EF Core](https://learn.microsoft.com/en-us/ef/core/performance/)
77
84
  - [Supported Database Providers](https://learn.microsoft.com/en-us/ef/core/providers/)
@@ -49,3 +49,28 @@ This document lists common mistakes in Entity Framework Core development and the
49
49
  ### 4.1 Avoid Decoupling the Development Database from Migration Scripts
50
50
  - **Problem**: Directly modifying the database schema without creating Migrations.
51
51
  - **Good**: Always use `dotnet ef migrations add` to manage schema changes, ensuring team environment consistency.
52
+
53
+ ---
54
+
55
+ ## 5. EF Core 11 Breaking Changes & Anti-Patterns
56
+
57
+ ### 5.1 Expecting Automatic `SqlVector<T>` Loading
58
+ - **Problem**: In EF Core 11, `SqlVector<T>` properties return `null` by default in regular entity queries to prevent dragging multi-megabyte embeddings across the wire.
59
+ - **Bad**:
60
+ ```csharp
61
+ var doc = await context.Documents.FindAsync(id);
62
+ // doc.Embedding will be null in EF Core 11!
63
+ ```
64
+ - **Good**: Explicitly project the vector property when needed:
65
+ ```csharp
66
+ var embedding = await context.Documents
67
+ .Where(d => d.Id == id)
68
+ .Select(d => d.Embedding)
69
+ .FirstOrDefaultAsync();
70
+ ```
71
+
72
+ ### 5.2 Synchronous Calls in Azure Cosmos DB Provider
73
+ - **Problem**: EF Core 11 completely removed synchronous I/O from the Azure Cosmos DB provider.
74
+ - **Bad**: Calling `.ToList()`, `.FirstOrDefault()`, or `.SaveChanges()` on Cosmos DB context.
75
+ - **Good**: Always use `.ToListAsync()`, `.FirstOrDefaultAsync()`, and `.SaveChangesAsync()`.
76
+
@@ -1,6 +1,6 @@
1
1
  # EF Core Modern Patterns
2
2
 
3
- This document introduces recommended development patterns in the Entity Framework Core domain for .NET 6 to 10+.
3
+ This document introduces recommended development patterns in the Entity Framework Core domain for .NET 6 to 11+.
4
4
 
5
5
  ## 1. Advanced Query Patterns
6
6
 
@@ -51,3 +51,41 @@ await context.Orders
51
51
 
52
52
  ### 5.1 Extension Types for Computed Properties on Entities
53
53
  **Recommendation**: Leverage C# 14's Extension Types to add computed properties to POCO entities without affecting the database schema.
54
+
55
+ ---
56
+
57
+ ## 6. EF Core 11 Modern Patterns
58
+
59
+ ### 6.1 LINQ FullJoin (SQL FULL OUTER JOIN)
60
+ **Recommendation**: Use `Queryable.FullJoin` to express full outer joins directly in LINQ rather than writing complex union queries or raw SQL:
61
+ ```csharp
62
+ var query = context.Customers
63
+ .FullJoin(
64
+ context.Orders,
65
+ c => c.Id,
66
+ o => o.CustomerId,
67
+ (customer, order) => new { Customer = customer, Order = order });
68
+ ```
69
+
70
+ ### 6.2 Approximate Nearest Neighbor Vector Search (SQL Server 2025)
71
+ **Recommendation**: For high-dimensional vector search with vector indexing, use `.WithApproximate()` to trigger SQL Server's approximate search:
72
+ ```csharp
73
+ var results = await context.Documents
74
+ .OrderBy(d => EF.Functions.VectorDistance("cosine", d.Embedding, queryVector))
75
+ .VectorSearch()
76
+ .WithApproximate()
77
+ .Take(5)
78
+ .Select(d => new { d.Id, d.Title }) // Always explicitly project non-vector fields
79
+ .ToListAsync();
80
+ ```
81
+
82
+ ### 6.3 Complex Types & JSON in TPT/TPC Hierarchies
83
+ **Recommendation**: Model domain value objects as complex types or JSON columns even on polymorphic hierarchies using Table-Per-Type (TPT) or Table-Per-Concrete-Type (TPC):
84
+ ```csharp
85
+ public abstract class Payment
86
+ {
87
+ public int Id { get; set; }
88
+ public required Money Amount { get; set; } // Complex Type supported in EF Core 11 TPT/TPC
89
+ }
90
+ ```
91
+
@@ -4,9 +4,9 @@ description: >
4
4
  Use this skill when building, debugging, refactoring, or reviewing ASP.NET Core
5
5
  Minimal APIs, lightweight endpoints, route groups, endpoint filters, typed results,
6
6
  OpenAPI metadata, or high-performance .NET API services without controllers.
7
- compatibility: "Supports .NET 6.0 through 10.0 environments. Requires .NET SDK installed locally."
7
+ compatibility: "Supports .NET 6.0 through 11.0 environments. Requires .NET SDK installed locally."
8
8
  metadata:
9
- version: "1.0.0"
9
+ version: "1.1.0"
10
10
  category: "Framework"
11
11
  ---
12
12
 
@@ -36,7 +36,7 @@ metadata:
36
36
  - Check whether the generated OpenAPI documentation is complete.
37
37
  - Ensure asynchronous operations correctly pass the `CancellationToken`.
38
38
 
39
- ## Feature Roadmap (.NET 6 - 10)
39
+ ## Feature Roadmap (.NET 6 - 11)
40
40
 
41
41
  ### .NET 6 & 7 (Foundation)
42
42
  - **Minimal Hosting**: Simplified startup process and top-level statements.
@@ -50,10 +50,16 @@ metadata:
50
50
  - **HybridCache**: High-performance multi-level caching support.
51
51
  - **OpenAPI Improvements**: Better OpenAPI code generation.
52
52
 
53
- ### .NET 10+ (Version-Specific Features)
53
+ ### .NET 10 (AOT & Middleware)
54
54
  - **Native AOT Optimization**: AOT-optimized compilation tailored for Minimal APIs.
55
55
  - **Enhanced Middleware Patterns**: New middleware designed for lightweight architectures.
56
56
 
57
+ ### .NET 11+ (Version-Specific Features)
58
+ - **Asynchronous Validation Support**: Native async validation rules across Minimal API endpoints and parameter binding, awaiting validation logic seamlessly.
59
+ - **OpenAPI 3.2 by Default**: Updated default specification to OpenAPI 3.2, with support for `OpenApiGenerationEnvironment` in build-time generation.
60
+ - **Zstandard (zstd) Compression**: Native high-ratio, low-latency compression provider for response compression and request decompression.
61
+ - **Runtime Async Performance**: Reduced task state machine allocations and cleaner async stack traces across endpoint handlers.
62
+
57
63
  ## Coding Standards
58
64
  - **Clean Routing**: Prioritize using extension methods to modularize routes.
59
65
  - **Strong Typing**: Prioritize using `TypedResults` and `Results<T1, T2>`.
@@ -72,6 +78,7 @@ metadata:
72
78
 
73
79
  ## Documentation
74
80
  ### Official References
81
+ - [What's new in ASP.NET Core in .NET 11](https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-11.0)
75
82
  - [Minimal APIs Overview](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis)
76
83
  - [Route groups and filters](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis/route-handlers)
77
84
  - [Typed responses in Minimal APIs](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis/responses)
@@ -1,6 +1,6 @@
1
1
  # .NET Minimal APIs Modern Patterns
2
2
 
3
- This document introduces recommended development patterns in the Minimal APIs domain for .NET 6 to 10+.
3
+ This document introduces recommended development patterns in the Minimal APIs domain for .NET 6 to 11+.
4
4
 
5
5
  ## 1. Architectural Patterns
6
6
 
@@ -66,3 +66,51 @@ app.MapGet("/users", () => ...)
66
66
  ```csharp
67
67
  app.MapGet("/health", static () => "Healthy");
68
68
  ```
69
+
70
+ ---
71
+
72
+ ## 5. .NET 11 Modern Patterns
73
+
74
+ ### 5.1 Asynchronous Endpoint Validation
75
+ **Recommendation**: In .NET 11, leverage native async validation directly in endpoint filters or validation pipelines to perform async service lookups without blocking threads.
76
+ ```csharp
77
+ app.MapPost("/users", async (UserCreateDto dto, IUserService userService) =>
78
+ {
79
+ // Native async validation flows through EndpointFilter cleanly
80
+ return TypedResults.Created($"/users/{dto.Username}");
81
+ }).AddEndpointFilter(async (invocationContext, next) =>
82
+ {
83
+ var dto = invocationContext.GetArgument<UserCreateDto>(0);
84
+ var userService = invocationContext.HttpContext.RequestServices.GetRequiredService<IUserService>();
85
+ if (await userService.ExistsAsync(dto.Username))
86
+ {
87
+ return TypedResults.Conflict("Username already taken.");
88
+ }
89
+ return await next(invocationContext);
90
+ });
91
+ ```
92
+
93
+ ### 5.2 Zstandard (zstd) HTTP Response Compression
94
+ **Recommendation**: Register Zstandard response compression provider in `Program.cs` to achieve higher compression ratios and faster streaming for high-throughput Minimal APIs.
95
+ ```csharp
96
+ builder.Services.AddResponseCompression(options =>
97
+ {
98
+ options.EnableForHttps = true;
99
+ options.Providers.Add<ZstandardCompressionProvider>();
100
+ });
101
+ ```
102
+
103
+ ### 5.3 OpenAPI 3.2 Environment Transformers
104
+ **Recommendation**: Utilize OpenAPI 3.2 default generation and environment transformers to separate development and production schemas.
105
+ ```csharp
106
+ builder.Services.AddOpenApi(options =>
107
+ {
108
+ // OpenAPI 3.2 is default in .NET 11
109
+ options.AddDocumentTransformer((document, context, cancellationToken) =>
110
+ {
111
+ document.Info.Description = $"Generated for {builder.Environment.EnvironmentName}";
112
+ return Task.CompletedTask;
113
+ });
114
+ });
115
+ ```
116
+
@@ -4,9 +4,9 @@ description: >
4
4
  Use this skill when building, debugging, refactoring, or reviewing ASP.NET Core
5
5
  MVC apps with Razor views, controllers, ViewModels, validation, Tag Helpers,
6
6
  View Components, layouts, or server-rendered workflows.
7
- compatibility: "Supports .NET 6.0 through 10.0 environments. Requires .NET SDK installed locally."
7
+ compatibility: "Supports .NET 6.0 through 11.0 environments. Requires .NET SDK installed locally."
8
8
  metadata:
9
- version: "1.0.0"
9
+ version: "1.1.0"
10
10
  category: "Framework"
11
11
  ---
12
12
 
@@ -36,7 +36,7 @@ metadata:
36
36
  - Check whether model validation correctly operates on both the frontend and backend.
37
37
  - Ensure Antiforgery tokens are correctly applied to all state-modifying requests.
38
38
 
39
- ## Feature Roadmap (.NET 6 - 10)
39
+ ## Feature Roadmap (.NET 6 - 11)
40
40
 
41
41
  ### .NET 6 & 7 (Foundation)
42
42
  - **Tag Helpers**: Declarative HTML attribute extensions.
@@ -50,10 +50,16 @@ metadata:
50
50
  - **Keyed Services in Controllers**: Finer-grained dependency injection support.
51
51
  - **Native AOT for MVC**: Metadata compilation optimization tailored for AOT.
52
52
 
53
- ### .NET 10+ (Version-Specific Features)
53
+ ### .NET 10 (Extensions & Serialization)
54
54
  - **Extension Members for IHtmlHelper**: Extending view helper functions.
55
55
  - **Advanced Serialization in Views**: Performance optimization for large view models.
56
56
 
57
+ ### .NET 11+ (Version-Specific Features)
58
+ - **Zstandard (zstd) Compression for SSR**: High-efficiency compression for server-rendered HTML payloads and static assets.
59
+ - **Asynchronous Form Validation**: Extended async validation coordination for complex input pipelines.
60
+ - **Agentic UI & Blazor Component Integration**: Native AG-UI / Blazor AI components in hybrid MVC apps, with `TempData` support in static SSR.
61
+ - **Runtime Async Performance**: Reduced async allocation and cleaner execution traces in Razor view generation.
62
+
57
63
  ## Coding Standards
58
64
  - **Strongly Typed Views**: All views must have an explicit `@model`.
59
65
  - **ViewModel Separation**: Strictly prohibit exposing database entities directly to views.
@@ -72,6 +78,7 @@ metadata:
72
78
 
73
79
  ## Documentation
74
80
  ### Official References
81
+ - [What's new in ASP.NET Core in .NET 11](https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-11.0)
75
82
  - [Overview of ASP.NET Core MVC](https://learn.microsoft.com/en-us/aspnet/core/mvc/overview)
76
83
  - [Tag Helpers in ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/intro)
77
84
  - [View components in ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/mvc/views/view-components)
@@ -1,6 +1,6 @@
1
1
  # .NET MVC Modern Patterns
2
2
 
3
- This document introduces recommended development patterns in the ASP.NET Core MVC mode for .NET 6 to 10+.
3
+ This document introduces recommended development patterns in the ASP.NET Core MVC mode for .NET 6 to 11+.
4
4
 
5
5
  ## 1. UI Modularization
6
6
 
@@ -54,3 +54,40 @@ public class ShoppingCartViewComponent : ViewComponent
54
54
 
55
55
  ### 5.1 Extension Types for IHtmlHelper
56
56
  **Recommendation**: Leverage C# 14's Extension Types to add domain-specific rendering methods to `IHtmlHelper`, not just static extension methods.
57
+
58
+ ---
59
+
60
+ ## 6. .NET 11 Modern Patterns
61
+
62
+ ### 6.1 Zstandard (zstd) Compression for Server-Side Rendering
63
+ **Recommendation**: Enable Zstandard compression provider to dramatically accelerate the transmission of large HTML DOM trees rendered by Razor views:
64
+ ```csharp
65
+ builder.Services.AddResponseCompression(options =>
66
+ {
67
+ options.EnableForHttps = true;
68
+ options.Providers.Add<ZstandardCompressionProvider>();
69
+ });
70
+ ```
71
+
72
+ ### 6.2 Asynchronous Validation in MVC Forms
73
+ **Recommendation**: Coordinate async form validation rules with ViewModels to perform async verification (e.g. database uniqueness checks) before committing form transactions:
74
+ ```csharp
75
+ [HttpPost]
76
+ [ValidateAntiForgeryToken]
77
+ public async Task<IActionResult> RegisterAsync(RegisterViewModel model, IUserService userService)
78
+ {
79
+ if (await userService.IsEmailTakenAsync(model.Email))
80
+ {
81
+ ModelState.AddModelError(nameof(model.Email), "Email is already registered.");
82
+ }
83
+
84
+ if (!ModelState.IsValid)
85
+ {
86
+ return View(model);
87
+ }
88
+
89
+ await userService.CreateUserAsync(model);
90
+ return RedirectToAction(nameof(Index));
91
+ }
92
+ ```
93
+
@@ -4,9 +4,9 @@ description: >
4
4
  Use this skill when the user asks to design, implement, refactor, or review custom
5
5
  ASP.NET Core Tag Helpers in C#, including TagBuilder usage, strongly typed attributes,
6
6
  dependency injection, ProcessAsync, and reusable Razor UI behavior.
7
- compatibility: "Supports .NET 6.0 through 10.0+ environments."
7
+ compatibility: "Supports .NET 6.0 through 11.0+ environments."
8
8
  metadata:
9
- version: "1.0.0"
9
+ version: "1.1.0"
10
10
  category: "Framework"
11
11
  pattern: generator
12
12
  output-format: csharp
@@ -4,9 +4,9 @@ description: >
4
4
  Use this skill when building, debugging, refactoring, or reviewing controller-based
5
5
  ASP.NET Core Web APIs, including ControllerBase, ActionResult<T>, Problem Details,
6
6
  API versioning, global exception handling, DTOs, and OpenAPI behavior.
7
- compatibility: "Supports .NET 6.0 through 10.0 environments. Requires .NET SDK installed locally."
7
+ compatibility: "Supports .NET 6.0 through 11.0 environments. Requires .NET SDK installed locally."
8
8
  metadata:
9
- version: "1.0.0"
9
+ version: "1.1.0"
10
10
  category: "Framework"
11
11
  ---
12
12
 
@@ -36,7 +36,7 @@ metadata:
36
36
  - Check NRT (Nullable Reference Types) safety.
37
37
  - Ensure asynchronous operations correctly pass down `CancellationToken`.
38
38
 
39
- ## Feature Roadmap (.NET 6 - 10)
39
+ ## Feature Roadmap (.NET 6 - 11)
40
40
 
41
41
  ### .NET 6 & 7 (Foundation)
42
42
  - **Controllers Architecture**: Traditional controller patterns and attribute routing.
@@ -50,10 +50,16 @@ metadata:
50
50
  - **Keyed Services**: More flexible dependency injection options.
51
51
  - **HybridCache**: Multi-level caching optimization.
52
52
 
53
- ### .NET 10+ (Version-Specific Features)
53
+ ### .NET 10 (Extensions & Serialization)
54
54
  - **Extension Members for Controllers**: Extending base controller functionality.
55
55
  - **Enhanced Serialization**: JSON optimization for large payloads.
56
56
 
57
+ ### .NET 11+ (Version-Specific Features)
58
+ - **OpenAPI 3.2 Specification by Default**: Upgraded documentation standards with enhanced schema generation.
59
+ - **Zstandard (zstd) Compression**: Native high-speed, high-ratio compression via `ZstandardCompressionProviderOptions`.
60
+ - **TLS Channel Binding for Negotiate Authentication**: Enhanced transport security for Kerberos / NTLM multi-round auth.
61
+ - **Runtime Async Controller Execution**: Reduced Task allocation overhead and cleaner stack traces during controller action execution.
62
+
57
63
  ## Coding Standards
58
64
  - **Strong Typing**: Prioritize `ActionResult<T>` to improve Swagger support.
59
65
  - **NRT Compliance**: Strictly enforce Null safety to reduce runtime errors.
@@ -72,6 +78,7 @@ metadata:
72
78
 
73
79
  ## Documentation
74
80
  ### Official References
81
+ - [What's new in ASP.NET Core in .NET 11](https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-11.0)
75
82
  - [ASP.NET Core Web API Overview](https://learn.microsoft.com/en-us/aspnet/core/web-api/)
76
83
  - [Handle errors in ASP.NET Core web APIs (Problem Details)](https://learn.microsoft.com/en-us/aspnet/core/web-api/handle-errors)
77
84
  - [Controller action return types in ASP.NET Core web API](https://learn.microsoft.com/en-us/aspnet/core/web-api/action-return-types)
@@ -1,6 +1,6 @@
1
1
  # .NET Web API Modern Patterns
2
2
 
3
- This document introduces recommended development patterns in the Controller-based mode for .NET 6 to 10+.
3
+ This document introduces recommended development patterns in the Controller-based mode for .NET 6 to 11+.
4
4
 
5
5
  ## 1. Error Handling and Response Formats
6
6
 
@@ -50,3 +50,38 @@ This document introduces recommended development patterns in the Controller-base
50
50
 
51
51
  ### 5.1 Extension Types for Controllers
52
52
  **Recommendation**: Leverage Extension Types to expand common auxiliary properties or methods for the base `ControllerBase`.
53
+
54
+ ---
55
+
56
+ ## 6. .NET 11 Modern Patterns
57
+
58
+ ### 6.1 Zstandard (zstd) Response Compression for Controllers
59
+ **Recommendation**: Configure Zstandard compression options to reduce payload size on heavy JSON responses from API controllers:
60
+ ```csharp
61
+ builder.Services.AddResponseCompression(options =>
62
+ {
63
+ options.EnableForHttps = true;
64
+ options.Providers.Add<ZstandardCompressionProvider>();
65
+ });
66
+ builder.Services.Configure<ZstandardCompressionProviderOptions>(options =>
67
+ {
68
+ options.Level = System.IO.Compression.CompressionLevel.Fastest;
69
+ });
70
+ ```
71
+
72
+ ### 6.2 OpenAPI 3.2 Specification Integration
73
+ **Recommendation**: Target OpenAPI 3.2 metadata in API controllers to provide richer schema details for downstream clients and agentic tools:
74
+ ```csharp
75
+ [ApiController]
76
+ [Route("api/[controller]")]
77
+ [Produces("application/json")]
78
+ public class CatalogController : ControllerBase
79
+ {
80
+ [HttpGet("{id:int}")]
81
+ [EndpointSummary("Retrieve item by unique identifier")]
82
+ [ProducesResponseType(typeof(ItemDto), StatusCodes.Status200OK)]
83
+ [ProducesResponseType(StatusCodes.Status404NotFound)]
84
+ public async Task<ActionResult<ItemDto>> GetItemAsync(int id, CancellationToken ct) => ...;
85
+ }
86
+ ```
87
+