@ozerohax/assistagents 0.1.1

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.
Files changed (82) hide show
  1. package/README.md +90 -0
  2. package/dist/cli.js +442 -0
  3. package/dist/cli.js.map +1 -0
  4. package/package.json +39 -0
  5. package/templates/agents/ask/ask.md +126 -0
  6. package/templates/agents/assist/research/code-research.md +116 -0
  7. package/templates/agents/assist/research/web-research.md +105 -0
  8. package/templates/agents/build/dev.md +131 -0
  9. package/templates/agents/planning/plan.md +103 -0
  10. package/templates/agents/planning/project.md +122 -0
  11. package/templates/agents/review/reviewer.md +121 -0
  12. package/templates/agents/test/tester.md +170 -0
  13. package/templates/skills/coder/csharp/coder-csharp-aspnetcore-api/SKILL.md +352 -0
  14. package/templates/skills/coder/csharp/coder-csharp-async-concurrency/SKILL.md +63 -0
  15. package/templates/skills/coder/csharp/coder-csharp-conventions/SKILL.md +405 -0
  16. package/templates/skills/coder/csharp/coder-csharp-efcore-config/SKILL.md +384 -0
  17. package/templates/skills/coder/csharp/coder-csharp-efcore-queries/SKILL.md +434 -0
  18. package/templates/skills/coder/csharp/coder-csharp-error-handling/SKILL.md +354 -0
  19. package/templates/skills/coder/csharp/coder-csharp-logging/SKILL.md +362 -0
  20. package/templates/skills/coder/csharp/coder-csharp-performance/SKILL.md +71 -0
  21. package/templates/skills/coder/csharp/coder-csharp-security/SKILL.md +57 -0
  22. package/templates/skills/coder/csharp/coder-csharp-testing/SKILL.md +398 -0
  23. package/templates/skills/coder/rust/coder-rust-async-concurrency/SKILL.md +63 -0
  24. package/templates/skills/coder/rust/coder-rust-axum-api/SKILL.md +104 -0
  25. package/templates/skills/coder/rust/coder-rust-conventions/SKILL.md +57 -0
  26. package/templates/skills/coder/rust/coder-rust-error-handling/SKILL.md +56 -0
  27. package/templates/skills/coder/rust/coder-rust-logging/SKILL.md +69 -0
  28. package/templates/skills/coder/rust/coder-rust-performance/SKILL.md +51 -0
  29. package/templates/skills/coder/rust/coder-rust-security/SKILL.md +49 -0
  30. package/templates/skills/coder/rust/coder-rust-serde/SKILL.md +61 -0
  31. package/templates/skills/coder/rust/coder-rust-sqlx-config/SKILL.md +54 -0
  32. package/templates/skills/coder/rust/coder-rust-sqlx-queries/SKILL.md +66 -0
  33. package/templates/skills/coder/rust/coder-rust-testing/SKILL.md +52 -0
  34. package/templates/skills/coder/rust/coder-rust-tokio/SKILL.md +69 -0
  35. package/templates/skills/coder/rust/coder-rust-tower-http/SKILL.md +56 -0
  36. package/templates/skills/coder/typescript/coder-typescript-async-concurrency/SKILL.md +73 -0
  37. package/templates/skills/coder/typescript/coder-typescript-conventions/SKILL.md +156 -0
  38. package/templates/skills/coder/typescript/coder-typescript-error-handling/SKILL.md +126 -0
  39. package/templates/skills/coder/typescript/coder-typescript-logging/SKILL.md +107 -0
  40. package/templates/skills/coder/typescript/coder-typescript-performance/SKILL.md +83 -0
  41. package/templates/skills/coder/typescript/coder-typescript-security/SKILL.md +78 -0
  42. package/templates/skills/coder/typescript/coder-typescript-testing/SKILL.md +111 -0
  43. package/templates/skills/coder/typescript/coder-typescript-vuejs/coder-typescript-vuejs-composables/SKILL.md +57 -0
  44. package/templates/skills/coder/typescript/coder-typescript-vuejs/coder-typescript-vuejs-core/SKILL.md +65 -0
  45. package/templates/skills/coder/typescript/coder-typescript-vuejs/coder-typescript-vuejs-performance/SKILL.md +48 -0
  46. package/templates/skills/coder/typescript/coder-typescript-vuejs/coder-typescript-vuejs-primevue/SKILL.md +140 -0
  47. package/templates/skills/coder/typescript/coder-typescript-vuejs/coder-typescript-vuejs-primevue/scripts/primevue-docs.js +502 -0
  48. package/templates/skills/coder/typescript/coder-typescript-vuejs/coder-typescript-vuejs-reactivity/SKILL.md +61 -0
  49. package/templates/skills/coder/typescript/coder-typescript-vuejs/coder-typescript-vuejs-testing/SKILL.md +63 -0
  50. package/templates/skills/planning/code/planning-code-feature/SKILL.md +148 -0
  51. package/templates/skills/planning/code/planning-code-fix/SKILL.md +207 -0
  52. package/templates/skills/planning/project/fast/planning-project-fast-delivery-deploy/SKILL.md +33 -0
  53. package/templates/skills/planning/project/fast/planning-project-fast-intake-questions/SKILL.md +82 -0
  54. package/templates/skills/planning/project/fast/planning-project-fast-mvp-slicing/SKILL.md +36 -0
  55. package/templates/skills/planning/project/fast/planning-project-fast-output-template/SKILL.md +79 -0
  56. package/templates/skills/planning/project/fast/planning-project-fast-session-plan/SKILL.md +30 -0
  57. package/templates/skills/planning/project/shared/planning-project-acceptance-criteria/SKILL.md +46 -0
  58. package/templates/skills/planning/project/shared/planning-project-artifact-storage/SKILL.md +68 -0
  59. package/templates/skills/planning/project/shared/planning-project-checkpoints-approval/SKILL.md +24 -0
  60. package/templates/skills/planning/project/shared/planning-project-save-revision/SKILL.md +33 -0
  61. package/templates/skills/planning/project/shared/planning-project-scope-control/SKILL.md +30 -0
  62. package/templates/skills/planning/project/shared/planning-project-success-metric-scope/SKILL.md +41 -0
  63. package/templates/skills/planning/project/shared/planning-project-task-decomposition/SKILL.md +47 -0
  64. package/templates/skills/planning/project/shared/planning-project-testing-validation/SKILL.md +31 -0
  65. package/templates/skills/planning/project/standard/planning-project-standard-architecture-adr-lite/SKILL.md +68 -0
  66. package/templates/skills/planning/project/standard/planning-project-standard-epics-stories/SKILL.md +41 -0
  67. package/templates/skills/planning/project/standard/planning-project-standard-implementation-readiness-lite/SKILL.md +32 -0
  68. package/templates/skills/planning/project/standard/planning-project-standard-prd-fr-nfr/SKILL.md +60 -0
  69. package/templates/skills/planning/project/standard/planning-project-standard-product-brief/SKILL.md +46 -0
  70. package/templates/skills/planning/project/standard/planning-project-standard-story-to-tasks/SKILL.md +52 -0
  71. package/templates/skills/research-strategy/research-strategy-code/SKILL.md +80 -0
  72. package/templates/skills/research-strategy/research-strategy-web/SKILL.md +63 -0
  73. package/templates/skills/review/review-checklists/SKILL.md +57 -0
  74. package/templates/skills/review/review-requirements/SKILL.md +42 -0
  75. package/templates/skills/review/review-strategy/SKILL.md +120 -0
  76. package/templates/skills/testing/testing-api-manual/SKILL.md +535 -0
  77. package/templates/skills/testing/testing-automation-web/SKILL.md +81 -0
  78. package/templates/skills/testing/testing-browser-manual/SKILL.md +528 -0
  79. package/templates/skills/testing/testing-checklists/SKILL.md +434 -0
  80. package/templates/skills/testing/testing-strategy/SKILL.md +471 -0
  81. package/templates/skills/testing/testing-test-cases/SKILL.md +362 -0
  82. package/templates/skills/testing/testing-triage-bugs/SKILL.md +457 -0
@@ -0,0 +1,352 @@
1
+ ---
2
+ name: coder-csharp-aspnetcore-api
3
+ description: ASP.NET Core Web API best practices including controllers, Minimal APIs, authentication, caching, and OpenAPI. Use when building REST APIs, configuring authentication, or optimizing API performance.
4
+ ---
5
+ <skill_overview>
6
+ <purpose>Build robust, performant, and well-documented ASP.NET Core APIs</purpose>
7
+ <triggers>
8
+ <trigger>Creating new API endpoints</trigger>
9
+ <trigger>Choosing Controllers vs Minimal APIs</trigger>
10
+ <trigger>Setting up authentication/authorization</trigger>
11
+ <trigger>Implementing caching or rate limiting</trigger>
12
+ <trigger>Documenting APIs with OpenAPI</trigger>
13
+ </triggers>
14
+ <sources>
15
+ <source url="https://learn.microsoft.com/en-us/aspnet/core/web-api/">Microsoft Web API Documentation</source>
16
+ </sources>
17
+ </skill_overview>
18
+ <controllers_vs_minimal>
19
+ <use_controllers_when>
20
+ <case>Large applications with complex routing</case>
21
+ <case>Need filters, model binding features</case>
22
+ <case>Team prefers MVC structure</case>
23
+ <case>Complex authorization with filters</case>
24
+ </use_controllers_when>
25
+ <use_minimal_when>
26
+ <case>Microservices, small APIs</case>
27
+ <case>Simple endpoints without much middleware</case>
28
+ <case>Performance-critical scenarios</case>
29
+ <case>Prefer less ceremony/boilerplate</case>
30
+ </use_minimal_when>
31
+ <controller_example>
32
+ <code>
33
+ [ApiController]
34
+ [Route("api/[controller]")]
35
+ public class UsersController : ControllerBase
36
+ {
37
+ private readonly IUserService _userService;
38
+
39
+ public UsersController(IUserService userService)
40
+ {
41
+ _userService = userService;
42
+ }
43
+
44
+ [HttpGet("{id}")]
45
+ [ProducesResponseType(typeof(UserDto), 200)]
46
+ [ProducesResponseType(404)]
47
+ public async Task&lt;ActionResult&lt;UserDto&gt;&gt; GetById(int id)
48
+ {
49
+ var user = await _userService.GetByIdAsync(id);
50
+ return user == null ? NotFound() : Ok(user);
51
+ }
52
+
53
+ [HttpPost]
54
+ [ProducesResponseType(typeof(UserDto), 201)]
55
+ [ProducesResponseType(400)]
56
+ public async Task&lt;ActionResult&lt;UserDto&gt;&gt; Create(CreateUserDto dto)
57
+ {
58
+ var user = await _userService.CreateAsync(dto);
59
+ return CreatedAtAction(nameof(GetById), new { id = user.Id }, user);
60
+ }
61
+ }
62
+ </code>
63
+ </controller_example>
64
+ <minimal_example>
65
+ <code>
66
+ var app = builder.Build();
67
+ var users = app.MapGroup("/api/users");
68
+ users.MapGet("/{id}", async (int id, IUserService service) =&gt;
69
+ await service.GetByIdAsync(id) is UserDto user
70
+ ? TypedResults.Ok(user)
71
+ : TypedResults.NotFound())
72
+ .WithName("GetUserById")
73
+ .Produces&lt;UserDto&gt;(200)
74
+ .Produces(404);
75
+ users.MapPost("/", async (CreateUserDto dto, IUserService service) =&gt;
76
+ {
77
+ var user = await service.CreateAsync(dto);
78
+ return TypedResults.Created($"/api/users/{user.Id}", user);
79
+ })
80
+ .WithName("CreateUser")
81
+ .Produces&lt;UserDto&gt;(201);
82
+ </code>
83
+ </minimal_example>
84
+ </controllers_vs_minimal>
85
+ <dtos_and_mapping>
86
+ <principle>Never expose entities directly - always use DTOs</principle>
87
+ <why>
88
+ <reason>Security: prevent over-posting attacks</reason>
89
+ <reason>Decoupling: API contract independent of database</reason>
90
+ <reason>Control: expose only needed fields</reason>
91
+ </why>
92
+ <mapping_options>
93
+ <option name="Manual">Fastest, explicit, most control</option>
94
+ <option name="Mapperly">Source-generated, fast, compile-time safe</option>
95
+ <option name="Mapster">Faster than AutoMapper, good DX</option>
96
+ <option name="AutoMapper">Most features, slower</option>
97
+ </mapping_options>
98
+ <example>
99
+ <code>
100
+ // Entity (never expose directly)
101
+ public class User
102
+ {
103
+ public int Id { get; set; }
104
+ public string Email { get; set; }
105
+ public string PasswordHash { get; set; } // Never expose!
106
+ public DateTime CreatedAt { get; set; }
107
+ }
108
+ // DTOs (expose these)
109
+ public record UserDto(int Id, string Email, DateTime CreatedAt);
110
+ public record CreateUserDto(string Email, string Password);
111
+ // Manual mapping
112
+ public static UserDto ToDto(this User user) =&gt;
113
+ new(user.Id, user.Email, user.CreatedAt);
114
+ </code>
115
+ </example>
116
+ </dtos_and_mapping>
117
+ <authentication>
118
+ <jwt_setup>
119
+ <code>
120
+ builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
121
+ .AddJwtBearer(options =&gt;
122
+ {
123
+ options.Authority = "https://your-auth-server";
124
+ options.Audience = builder.Configuration["Auth:Audience"];
125
+ options.TokenValidationParameters = new TokenValidationParameters
126
+ {
127
+ ValidateIssuer = true,
128
+ ValidateAudience = true,
129
+ ValidateLifetime = true,
130
+ ValidateIssuerSigningKey = true
131
+ };
132
+ });
133
+ builder.Services.AddAuthorization();
134
+ app.UseAuthentication();
135
+ app.UseAuthorization();
136
+ </code>
137
+ </jwt_setup>
138
+ <policy_authorization>
139
+ <code>
140
+ // Define policies
141
+ builder.Services.AddAuthorization(options =&gt;
142
+ {
143
+ options.AddPolicy("AdminOnly", policy =&gt;
144
+ policy.RequireRole("Admin"));
145
+
146
+ options.AddPolicy("CanEditOrders", policy =&gt;
147
+ policy.RequireClaim("Permission", "Orders.Edit"));
148
+
149
+ options.AddPolicy("MinAge18", policy =&gt;
150
+ policy.Requirements.Add(new MinimumAgeRequirement(18)));
151
+ });
152
+ // Apply to endpoints
153
+ [Authorize(Policy = "AdminOnly")]
154
+ public IActionResult AdminAction() =&gt; Ok();
155
+ // Minimal API
156
+ app.MapDelete("/orders/{id}", DeleteOrder)
157
+ .RequireAuthorization("CanEditOrders");
158
+ </code>
159
+ </policy_authorization>
160
+ </authentication>
161
+ <pagination>
162
+ <implementation>
163
+ <code>
164
+ public record PagedResult&lt;T&gt;(
165
+ IEnumerable&lt;T&gt; Items,
166
+ int TotalCount,
167
+ int Page,
168
+ int PageSize)
169
+ {
170
+ public int TotalPages =&gt; (int)Math.Ceiling(TotalCount / (double)PageSize);
171
+ public bool HasPrevious =&gt; Page &gt; 1;
172
+ public bool HasNext =&gt; Page &lt; TotalPages;
173
+ }
174
+ [HttpGet]
175
+ public async Task&lt;ActionResult&lt;PagedResult&lt;UserDto&gt;&gt;&gt; GetUsers(
176
+ [FromQuery] int page = 1,
177
+ [FromQuery] int pageSize = 10)
178
+ {
179
+ var query = _context.Users
180
+ .AsNoTracking()
181
+ .OrderBy(u =&gt; u.CreatedAt);
182
+
183
+ var totalCount = await query.CountAsync();
184
+
185
+ var items = await query
186
+ .Skip((page - 1) * pageSize)
187
+ .Take(pageSize)
188
+ .Select(u =&gt; u.ToDto())
189
+ .ToListAsync();
190
+
191
+ return Ok(new PagedResult&lt;UserDto&gt;(items, totalCount, page, pageSize));
192
+ }
193
+ </code>
194
+ </implementation>
195
+ <rule>Always include OrderBy before Skip/Take</rule>
196
+ </pagination>
197
+ <caching>
198
+ <output_caching description=".NET 7+">
199
+ <code>
200
+ builder.Services.AddOutputCache(options =&gt;
201
+ {
202
+ options.DefaultExpirationTimeSpan = TimeSpan.FromMinutes(5);
203
+ });
204
+ app.UseOutputCache();
205
+ // Apply to endpoint
206
+ app.MapGet("/products", GetProducts)
207
+ .CacheOutput(p =&gt; p.Expire(TimeSpan.FromMinutes(10)));
208
+ // With tag for invalidation
209
+ app.MapGet("/products/{id}", GetProduct)
210
+ .CacheOutput(p =&gt; p.Tag("products"));
211
+ app.MapPost("/products", async (Product p, IOutputCacheStore cache) =&gt;
212
+ {
213
+ // Invalidate cache after create
214
+ await cache.EvictByTagAsync("products", default);
215
+ return Results.Created();
216
+ });
217
+ </code>
218
+ </output_caching>
219
+ <response_caching>
220
+ <code>
221
+ builder.Services.AddResponseCaching();
222
+ app.UseResponseCaching();
223
+ [HttpGet]
224
+ [ResponseCache(Duration = 60, VaryByQueryKeys = new[] { "page" })]
225
+ public IActionResult GetProducts() =&gt; Ok();
226
+ </code>
227
+ </response_caching>
228
+ </caching>
229
+ <rate_limiting description=".NET 7+">
230
+ <code>
231
+ builder.Services.AddRateLimiter(options =&gt;
232
+ {
233
+ options.AddFixedWindowLimiter("fixed", opt =&gt;
234
+ {
235
+ opt.PermitLimit = 100;
236
+ opt.Window = TimeSpan.FromMinutes(1);
237
+ opt.QueueProcessingOrder = QueueProcessingOrder.OldestFirst;
238
+ opt.QueueLimit = 10;
239
+ });
240
+
241
+ options.AddSlidingWindowLimiter("sliding", opt =&gt;
242
+ {
243
+ opt.PermitLimit = 100;
244
+ opt.Window = TimeSpan.FromMinutes(1);
245
+ opt.SegmentsPerWindow = 4;
246
+ });
247
+
248
+ options.RejectionStatusCode = 429;
249
+ });
250
+ app.UseRateLimiter();
251
+ app.MapGet("/api/resource", GetResource)
252
+ .RequireRateLimiting("fixed");
253
+ </code>
254
+ </rate_limiting>
255
+ <response_compression>
256
+ <code>
257
+ builder.Services.AddResponseCompression(options =&gt;
258
+ {
259
+ options.EnableForHttps = true;
260
+ options.Providers.Add&lt;BrotliCompressionProvider&gt;();
261
+ options.Providers.Add&lt;GzipCompressionProvider&gt;();
262
+ });
263
+ builder.Services.Configure&lt;BrotliCompressionProviderOptions&gt;(options =&gt;
264
+ options.Level = CompressionLevel.Fastest);
265
+ app.UseResponseCompression(); // Before endpoints
266
+ </code>
267
+ </response_compression>
268
+ <openapi>
269
+ <setup>
270
+ <code>
271
+ builder.Services.AddEndpointsApiExplorer();
272
+ builder.Services.AddSwaggerGen(c =&gt;
273
+ {
274
+ c.SwaggerDoc("v1", new OpenApiInfo
275
+ {
276
+ Title = "My API",
277
+ Version = "v1",
278
+ Description = "API for managing resources"
279
+ });
280
+
281
+ // Include XML comments
282
+ var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
283
+ var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
284
+ c.IncludeXmlComments(xmlPath);
285
+
286
+ // JWT auth in Swagger
287
+ c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
288
+ {
289
+ Type = SecuritySchemeType.Http,
290
+ Scheme = "bearer",
291
+ BearerFormat = "JWT"
292
+ });
293
+ });
294
+ if (app.Environment.IsDevelopment())
295
+ {
296
+ app.UseSwagger();
297
+ app.UseSwaggerUI();
298
+ }
299
+ </code>
300
+ </setup>
301
+ <xml_comments>
302
+ <code>
303
+ /// &lt;summary&gt;
304
+ /// Gets a user by ID
305
+ /// &lt;/summary&gt;
306
+ /// &lt;param name="id"&gt;The user identifier&lt;/param&gt;
307
+ /// &lt;returns&gt;The user or 404 if not found&lt;/returns&gt;
308
+ /// &lt;response code="200"&gt;Returns the user&lt;/response&gt;
309
+ /// &lt;response code="404"&gt;User not found&lt;/response&gt;
310
+ [HttpGet("{id}")]
311
+ [ProducesResponseType(typeof(UserDto), 200)]
312
+ [ProducesResponseType(404)]
313
+ public async Task&lt;ActionResult&lt;UserDto&gt;&gt; GetById(int id)
314
+ </code>
315
+ </xml_comments>
316
+ <csproj_setting>
317
+ <code>
318
+ &lt;PropertyGroup&gt;
319
+ &lt;GenerateDocumentationFile&gt;true&lt;/GenerateDocumentationFile&gt;
320
+ &lt;NoWarn&gt;$(NoWarn);1591&lt;/NoWarn&gt;
321
+ &lt;/PropertyGroup&gt;
322
+ </code>
323
+ </csproj_setting>
324
+ </openapi>
325
+ <versioning>
326
+ <setup>
327
+ <code>
328
+ builder.Services.AddApiVersioning(options =&gt;
329
+ {
330
+ options.DefaultApiVersion = new ApiVersion(1, 0);
331
+ options.AssumeDefaultVersionWhenUnspecified = true;
332
+ options.ReportApiVersions = true;
333
+ options.ApiVersionReader = ApiVersionReader.Combine(
334
+ new UrlSegmentApiVersionReader(),
335
+ new HeaderApiVersionReader("X-Api-Version"));
336
+ });
337
+ // URL versioning
338
+ [ApiController]
339
+ [Route("api/v{version:apiVersion}/[controller]")]
340
+ [ApiVersion("1.0")]
341
+ [ApiVersion("2.0")]
342
+ public class UsersController : ControllerBase
343
+ {
344
+ [HttpGet, MapToApiVersion("1.0")]
345
+ public IActionResult GetV1() =&gt; Ok("v1");
346
+
347
+ [HttpGet, MapToApiVersion("2.0")]
348
+ public IActionResult GetV2() =&gt; Ok("v2");
349
+ }
350
+ </code>
351
+ </setup>
352
+ </versioning>
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: coder-csharp-async-concurrency
3
+ description: C# async/await and concurrency best practices. Use when writing async code, coordinating tasks, or handling cancellation.
4
+ ---
5
+ <skill_overview>
6
+ <purpose>Build reliable async flows and safe multi-threaded code</purpose>
7
+ <triggers>
8
+ <trigger>Writing async methods</trigger>
9
+ <trigger>Coordinating multiple tasks</trigger>
10
+ <trigger>Adding cancellation support</trigger>
11
+ <trigger>Working with concurrent collections</trigger>
12
+ </triggers>
13
+ <sources>
14
+ <source url="https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/async-scenarios">Async Scenarios</source>
15
+ <source url="https://learn.microsoft.com/en-us/dotnet/standard/collections/thread-safe/">Thread-Safe Collections</source>
16
+ <source url="https://learn.microsoft.com/en-us/dotnet/core/extensions/channels">System.Threading.Channels</source>
17
+ </sources>
18
+ </skill_overview>
19
+ <async_await_rules>
20
+ <rules>
21
+ <rule>Use async/await end-to-end; avoid blocking waits</rule>
22
+ <rule>Return Task/ValueTask, not void (except event handlers)</rule>
23
+ <rule>Use ConfigureAwait(false) in library code</rule>
24
+ </rules>
25
+ </async_await_rules>
26
+ <task_coordination>
27
+ <rules>
28
+ <rule>Use Task.WhenAll for independent work</rule>
29
+ <rule>Use Task.WhenAny for first-completion patterns</rule>
30
+ <rule>Handle exceptions from all tasks</rule>
31
+ </rules>
32
+ <example>
33
+ <code>
34
+ await Task.WhenAll(fetchUserTask, fetchOrdersTask);
35
+ </code>
36
+ </example>
37
+ </task_coordination>
38
+ <cancellation>
39
+ <rules>
40
+ <rule>Accept CancellationToken in cancellable APIs</rule>
41
+ <rule>Pass the token to all awaited operations</rule>
42
+ <rule>Respect cancellation promptly</rule>
43
+ </rules>
44
+ </cancellation>
45
+ <concurrency_primitives>
46
+ <rules>
47
+ <rule>Use ConcurrentDictionary, ConcurrentQueue, ConcurrentBag for shared collections</rule>
48
+ <rule>Use Channel for producer-consumer pipelines</rule>
49
+ <rule>Keep lock scope minimal and consistent</rule>
50
+ </rules>
51
+ </concurrency_primitives>
52
+ <deadlocks>
53
+ <rules>
54
+ <rule>Never use .Result or .Wait on async operations</rule>
55
+ <rule>Avoid blocking inside async methods</rule>
56
+ <rule>Do not capture synchronization context in libraries</rule>
57
+ </rules>
58
+ </deadlocks>
59
+ <anti_patterns>
60
+ <avoid name="sync_over_async">Blocking on async tasks</avoid>
61
+ <avoid name="async_void">async void outside event handlers</avoid>
62
+ <avoid name="shared_mutable_state">Mutable shared state without synchronization</avoid>
63
+ </anti_patterns>