一键导入
dck-modern-csharp
Use when writing or reviewing AHKFlowApp C# for .NET 10, C# 14, primary constructors, records, patterns, or collections.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when writing or reviewing AHKFlowApp C# for .NET 10, C# 14, primary constructors, records, patterns, or collections.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | dck-modern-csharp |
| description | Use when writing or reviewing AHKFlowApp C# for .NET 10, C# 14, primary constructors, records, patterns, or collections. |
[]) instead of verbose collection initialization.sealed unless a class is designed for inheritance.TimeProvider instead of DateTime.Now or DateTime.UtcNow.var when the type is apparent.| Feature | Use |
|---|---|
| Primary constructors | DI services, controllers, handlers |
| Records | DTOs, commands, queries, value objects |
| Collection expressions | Empty collections and small literals |
| Pattern matching | Result/state branching where it improves clarity |
| Raw string literals | JSON, SQL snippets, expected text blocks |
required | Configuration options and input objects that must be initialized |
field keyword | Property validation without manual backing fields when supported |
public sealed record CreateHotstringCommand(CreateHotstringDto Input);
internal sealed class ListHotstringsHandler(AppDbContext db)
: IUseCaseHandler<ListHotstringsQuery, Result<PagedList<HotstringDto>>>
{
public async Task<Result<PagedList<HotstringDto>>> ExecuteAsync(
ListHotstringsQuery request,
CancellationToken cancellationToken)
{
var items = await db.Hotstrings
.AsNoTracking()
.OrderBy(x => x.Trigger)
.ToListAsync(cancellationToken);
return Result.Success(Map(items));
}
}
string[] allowedExtensions = [".ahk", ".txt"];
List<Guid> selectedProfileIds = [defaultProfileId, .. request.ProfileIds];
Modern syntax is a tool, not a goal. Avoid deeply nested property/list patterns when simple local variables are clearer. Do not replace clear domain methods with clever expressions.
_field = field ceremony for simple DI.new List<T>() for simple empty or literal collections.| Scenario | Use |
|---|---|
| API request/response | sealed record |
| Handler/controller DI | Primary constructor |
| Domain state | private setters plus factory/domain methods |
| Small immutable value | readonly record struct when appropriate |
| Multi-line expected JSON | Raw string literal |
| Current time | TimeProvider.GetUtcNow() |
Use when creating, removing, or troubleshooting AHKFlowApp git worktrees across Claude Code, Codex, or Copilot.
Use when optimizing AHKFlowApp agent workflow, worktrees, planning, verification loops, context budget, or tool usage.
Use when verifying AHKFlowApp build, tests, formatting, diagnostics, security, or readiness before commit, push, or PR.
Compact the current conversation into a handoff document for another agent to pick up.
Use to scan .NET code for performance anti-patterns across async, memory, strings, collections, LINQ, regex, and I/O.
Use to evaluate assertion depth and diversity across a test suite and flag assertion-free, shallow, or tautological tests.