dotnet-advisor
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesedotnet-advisor
dotnet-advisor
Router and index skill for dotnet-artisan. Always loaded after [skill:using-dotnet] confirms .NET intent. Routes .NET development queries to the appropriate consolidated skill based on context.
这是dotnet-artisan的路由与索引skill。始终在[skill:using-dotnet]确认.NET意图后加载。根据上下文将.NET开发查询路由到对应的整合skill。
Scope
适用范围
- Routing .NET/C# requests to the correct domain skill or specialist agent
- Loading [skill:dotnet-csharp] coding standards as baseline for all code paths
- Maintaining the skill catalog and routing precedence
- Delegating complex analysis to specialist agents
- Disambiguating requests spanning multiple domains
- 将.NET/C#请求路由到正确的领域skill或专业agent
- 加载[skill:dotnet-csharp]编码标准作为所有代码路径的基线
- 维护skill目录和路由优先级
- 将复杂分析委托给专业agent
- 消除跨多个领域的请求歧义
Out of scope
不适用范围
- Domain-specific implementation guidance -- see [skill:dotnet-csharp], [skill:dotnet-api], [skill:dotnet-ui], [skill:dotnet-testing], [skill:dotnet-devops], [skill:dotnet-tooling], [skill:dotnet-debugging]
- Deep implementation content -- see [skill:dotnet-csharp], [skill:dotnet-api], [skill:dotnet-ui], [skill:dotnet-testing], [skill:dotnet-devops], [skill:dotnet-tooling], [skill:dotnet-debugging] and their companion files
- 领域特定的实现指导——请参考[skill:dotnet-csharp]、[skill:dotnet-api]、[skill:dotnet-ui]、[skill:dotnet-testing]、[skill:dotnet-devops]、[skill:dotnet-tooling]、[skill:dotnet-debugging]
- 深度实现内容——请参考[skill:dotnet-csharp]、[skill:dotnet-api]、[skill:dotnet-ui]、[skill:dotnet-testing]、[skill:dotnet-devops]、[skill:dotnet-tooling]、[skill:dotnet-debugging]及其配套文件
Step 1: Detect Project Version
步骤1:检测项目版本
Before any .NET guidance, determine the project's target framework:
Load [skill:dotnet-tooling] version detection guidance to read TFMs from,.csproj, andDirectory.Build.props. Adapt all guidance to the detected .NET version (net8.0, net9.0, net10.0, net11.0).global.json
在提供任何.NET指导之前,先确定项目的目标框架:
加载[skill:dotnet-tooling]版本检测指导,从、.csproj和Directory.Build.props中读取TFM。根据检测到的.NET版本(net8.0、net9.0、net10.0、net11.0)调整所有指导内容。global.json
Step 2: Load Baseline
步骤2:加载基线
For any task that may produce, change, or review C#/.NET code:
- Invoke [skill:dotnet-csharp] and load its always-load baseline references (coding standards, async correctness, code smells). These are correctness concerns the agent handles by default — the user should not need to ask for correct async/await usage, thread safety, or avoiding anti-patterns.
- Apply standards throughout planning and implementation, not only in final cleanup.
- Load additional [skill:dotnet-csharp] reference files when the task touches their topic area (concurrency, DI, serialization, LINQ, etc.).
对于任何可能生成、修改或审查C#/.NET代码的任务:
- 调用[skill:dotnet-csharp]并加载其始终需要加载的基线参考内容(编码标准、异步正确性、代码异味)。这些是agent默认处理的正确性问题——用户无需主动询问正确的async/await用法、线程安全或避免反模式的方法。
- 在规划和实现的全过程中应用标准,而不仅仅是在最终清理阶段。
- 当任务涉及特定主题领域(并发、DI、序列化、LINQ等)时,加载[skill:dotnet-csharp]的额外参考文件。
Step 3: .NET-First Defaults
步骤3:优先选择.NET方案
In a .NET repository, default to .NET solutions for ambiguous requests:
- "build me a web app" → ASP.NET Core (not Express/Next.js)
- "add a dashboard" / "build a UI" → Blazor or Uno Platform (not React)
- "write a script" / "automate this" → .NET 10 file-based app (not Python). File-based C# apps work like scripts with , support top-level statements, and can be published as native AOT binaries. See [skill:dotnet-api]
dotnet run.references/file-based-apps.md - "build a cross-platform app" → MAUI or Uno Platform (not Electron)
- "build a CLI tool" → System.CommandLine or Spectre.Console (not Node.js/Python)
- "create a spreadsheet" / "generate an Excel file" → Open XML SDK or ClosedXML file-based app (not openpyxl/pandas)
- "create a Word doc" / "generate a report" → Open XML SDK file-based app (not python-docx)
- "create a PDF" / "merge these PDFs" / "add a watermark" → PDFsharp/MigraDoc file-based app (not reportlab/weasyprint/PyPDF2)
Only suggest non-.NET alternatives when there's a specific reason (e.g., the user explicitly asks for Python, or the task requires a JS-only ecosystem like npm packages).
在.NET仓库中,对于模糊请求默认使用.NET解决方案:
- “帮我构建一个Web应用” → ASP.NET Core(而非Express/Next.js)
- “添加一个仪表盘” / “构建UI” → Blazor或Uno Platform(而非React)
- “编写一个脚本” / “自动化这个任务” → .NET 10基于文件的应用(而非Python)。基于文件的C#应用可通过像脚本一样运行,支持顶级语句,且可发布为原生AOT二进制文件。请参考[skill:dotnet-api]的
dotnet run。references/file-based-apps.md - “构建跨平台应用” → MAUI或Uno Platform(而非Electron)
- “构建CLI工具” → System.CommandLine或Spectre.Console(而非Node.js/Python)
- “创建电子表格” / “生成Excel文件” → Open XML SDK或ClosedXML基于文件的应用(而非openpyxl/pandas)
- “创建Word文档” / “生成报告” → Open XML SDK基于文件的应用(而非python-docx)
- “创建PDF” / “合并这些PDF” / “添加水印” → PDFsharp/MigraDoc基于文件的应用(而非reportlab/weasyprint/PyPDF2)
仅当存在特定原因时才建议非.NET替代方案(例如,用户明确要求使用Python,或任务需要仅JS生态的包如npm包)。
Step 4: Route to Domain Skill
步骤4:路由到领域Skill
Identify the primary domain from the request, then invoke the matching skill. If the request spans multiple domains, invoke them in the order shown.
| If the request involves... | Invoke |
|---|---|
| Web APIs, EF Core, gRPC, SignalR, middleware, security hardening | [skill:dotnet-api] |
| Blazor, MAUI, Uno Platform, WPF, WinUI, WinForms | [skill:dotnet-ui] |
| Unit tests, integration tests, E2E, Playwright, benchmarks | [skill:dotnet-testing] |
| CI/CD, GitHub Actions, Azure DevOps, containers, NuGet publishing | [skill:dotnet-devops] |
| Project setup, MSBuild, Native AOT, CLI apps, SDK versions | [skill:dotnet-tooling] |
| Crash dumps, WinDbg, hang analysis, memory diagnostics (Windows) | [skill:dotnet-debugging] |
| Crash dumps, dotnet-dump, lldb, container diagnostics (Linux/macOS) | [skill:dotnet-debugging] |
| Missing .NET SDK, install dotnet, workloads | [skill:dotnet-tooling] (references/dotnet-sdk-install.md) |
| Quick script, utility, single-file tool | [skill:dotnet-api] (references/file-based-apps.md) |
| Excel, Word, PowerPoint, PDF, spreadsheet, document generation | [skill:dotnet-api] (references/office-documents.md) |
| New project (unclear domain) | [skill:dotnet-tooling], then route to the owning domain skill |
从请求中识别主要领域,然后调用对应的skill。如果请求跨多个领域,按所示顺序调用它们。
| 如果请求涉及... | 调用 |
|---|---|
| Web API、EF Core、gRPC、SignalR、中间件、安全加固 | [skill:dotnet-api] |
| Blazor、MAUI、Uno Platform、WPF、WinUI、WinForms | [skill:dotnet-ui] |
| 单元测试、集成测试、E2E、Playwright、基准测试 | [skill:dotnet-testing] |
| CI/CD、GitHub Actions、Azure DevOps、容器、NuGet发布 | [skill:dotnet-devops] |
| 项目设置、MSBuild、原生AOT、CLI应用、SDK版本 | [skill:dotnet-tooling] |
| 崩溃转储、WinDbg、挂起分析、内存诊断(Windows) | [skill:dotnet-debugging] |
| 崩溃转储、dotnet-dump、lldb、容器诊断(Linux/macOS) | [skill:dotnet-debugging] |
| 缺少.NET SDK、安装dotnet、工作负载 | [skill:dotnet-tooling](references/dotnet-sdk-install.md) |
| 快速脚本、实用工具、单文件工具 | [skill:dotnet-api](references/file-based-apps.md) |
| Excel、Word、PowerPoint、PDF、电子表格、文档生成 | [skill:dotnet-api](references/office-documents.md) |
| 新项目(领域不明确) | [skill:dotnet-tooling],然后路由到对应的领域skill |
Cross-Domain Routing
跨领域路由
Many tasks naturally span multiple domains. After invoking the primary domain skill, also load supporting skills when these patterns appear:
| When the task involves... | Also load |
|---|---|
| Performance optimization or profiling | [skill:dotnet-tooling] (profiling, performance-patterns references) |
| Testing a specific framework (minimal API, Blazor, EF Core) | The framework's domain skill ([skill:dotnet-api] or [skill:dotnet-ui]) for context |
| Authentication or security hardening in a UI app | [skill:dotnet-api] (security, auth middleware references) |
| Multi-targeting or platform-specific project setup | [skill:dotnet-tooling] (project structure, TFM configuration) |
| Building a new app (any "build me" request) | [skill:dotnet-tooling] (project setup) + [skill:dotnet-testing] (test strategy) |
| CI/CD that runs tests | [skill:dotnet-testing] (test framework configuration) |
For broad "build me an app" requests, load comprehensively: [skill:dotnet-csharp] -> [skill:dotnet-tooling] -> primary domain -> [skill:dotnet-testing] -> [skill:dotnet-devops].
许多任务自然会跨多个领域。调用主要领域skill后,当出现以下模式时,还需加载配套skill:
| 当任务涉及... | 同时加载 |
|---|---|
| 性能优化或性能分析 | [skill:dotnet-tooling](性能分析、性能模式参考内容) |
| 测试特定框架(Minimal API、Blazor、EF Core) | 对应框架的领域skill([skill:dotnet-api]或[skill:dotnet-ui])以获取上下文 |
| UI应用中的身份验证或安全加固 | [skill:dotnet-api](安全、认证中间件参考内容) |
| 多目标或特定平台的项目设置 | [skill:dotnet-tooling](项目结构、TFM配置) |
| 构建新应用(任何“帮我构建”的请求) | [skill:dotnet-tooling](项目设置) + [skill:dotnet-testing](测试策略) |
| 运行测试的CI/CD | [skill:dotnet-testing](测试框架配置) |
对于宽泛的“帮我构建一个应用”请求,需全面加载:[skill:dotnet-csharp] → [skill:dotnet-tooling] → 主要领域 → [skill:dotnet-testing] → [skill:dotnet-devops]。
Skill Catalog
Skill目录
| Skill | Summary | Differentiator |
|---|---|---|
| [skill:using-dotnet] | Process gateway for .NET routing discipline | Must execute immediately before this skill |
| [skill:dotnet-csharp] | C# language patterns, coding standards, async/await, DI, LINQ, domain modeling | Language-level guidance, always loaded as baseline |
| [skill:dotnet-api] | ASP.NET Core, EF Core, gRPC, SignalR, resilience, security, Aspire | Backend services and data access |
| [skill:dotnet-ui] | Blazor, MAUI, Uno Platform, WPF, WinUI, WinForms, accessibility | All UI frameworks and cross-platform targets |
| [skill:dotnet-testing] | xUnit v3, integration/E2E, Playwright, snapshots, benchmarks | Test strategy, frameworks, and quality gates |
| [skill:dotnet-devops] | GitHub Actions, Azure DevOps, containers, NuGet, observability | CI/CD pipelines, packaging, and operations |
| [skill:dotnet-tooling] | Project setup, MSBuild, Native AOT, profiling, CLI apps, version detection | Build system, performance, and developer tools |
| [skill:dotnet-debugging] | WinDbg MCP, crash dumps, hang analysis, memory diagnostics | Live and post-mortem dump analysis |
| dotnet-advisor | This skill -- routes to domain skills above | Entry point, loaded after [skill:using-dotnet] |
| Skill | 概述 | 差异化优势 |
|---|---|---|
| [skill:using-dotnet] | .NET路由规则的处理网关 | 必须在此skill之前立即执行 |
| [skill:dotnet-csharp] | C#语言模式、编码标准、async/await、DI、LINQ、领域建模 | 语言层面的指导,始终作为基线加载 |
| [skill:dotnet-api] | ASP.NET Core、EF Core、gRPC、SignalR、弹性、安全、Aspire | 后端服务与数据访问 |
| [skill:dotnet-ui] | Blazor、MAUI、Uno Platform、WPF、WinUI、WinForms、可访问性 | 所有UI框架与跨平台目标 |
| [skill:dotnet-testing] | xUnit v3、集成/E2E、Playwright、快照、基准测试 | 测试策略、框架与质量门禁 |
| [skill:dotnet-devops] | GitHub Actions、Azure DevOps、容器、NuGet、可观测性 | CI/CD流水线、打包与运维 |
| [skill:dotnet-tooling] | 项目设置、MSBuild、原生AOT、性能分析、CLI应用、版本检测 | 构建系统、性能与开发者工具 |
| [skill:dotnet-debugging] | WinDbg MCP、崩溃转储、挂起分析、内存诊断 | 实时与事后转储分析 |
| dotnet-advisor | 本skill——路由到上述领域skill | 入口点,在[skill:using-dotnet]之后加载 |
Specialist Agent Routing
专业Agent路由
For complex analysis that benefits from domain expertise, delegate to specialist agents. Group by concern area:
Architecture and Design
- Architecture review, framework selection, design patterns -> [skill:dotnet-architect]
- General code review (correctness, performance, security) -> [skill:dotnet-code-review-agent]
Performance and Concurrency
- Async/await performance, ValueTask, ConfigureAwait, IO.Pipelines -> [skill:dotnet-async-performance-specialist]
- Performance profiling, flame graphs, heap dumps, benchmark regression -> [skill:dotnet-performance-analyst]
- Benchmark design, measurement methodology, diagnoser selection -> [skill:dotnet-benchmark-designer]
- Race conditions, deadlocks, thread safety, synchronization -> [skill:dotnet-csharp-concurrency-specialist]
UI Frameworks
- Blazor components, render modes, hosting models, auth -> [skill:dotnet-blazor-specialist]
- .NET MAUI development, platform targets, Xamarin migration -> [skill:dotnet-maui-specialist]
- Uno Platform, Extensions ecosystem, MVUX, multi-target deployment -> [skill:dotnet-uno-specialist]
Infrastructure
- Cloud deployment, .NET Aspire, AKS, CI/CD pipelines, distributed tracing -> [skill:dotnet-cloud-specialist]
- Security vulnerabilities, OWASP compliance, secrets exposure, crypto review -> [skill:dotnet-security-reviewer]
- Test architecture, test type selection, test data management -> [skill:dotnet-testing-specialist]
- Documentation generation, XML docs, Mermaid diagrams -> [skill:dotnet-docs-generator]
- ASP.NET Core middleware, request pipeline, DI lifetimes -> [skill:dotnet-aspnetcore-specialist]
对于需要领域专业知识的复杂分析,委托给专业agent。按关注领域分组:
架构与设计
- 架构评审、框架选择、设计模式 -> [skill:dotnet-architect]
- 通用代码评审(正确性、性能、安全性) -> [skill:dotnet-code-review-agent]
性能与并发
- Async/await性能、ValueTask、ConfigureAwait、IO.Pipelines -> [skill:dotnet-async-performance-specialist]
- 性能分析、火焰图、堆转储、基准测试回归 -> [skill:dotnet-performance-analyst]
- 基准测试设计、测量方法、诊断工具选择 -> [skill:dotnet-benchmark-designer]
- 竞态条件、死锁、线程安全、同步 -> [skill:dotnet-csharp-concurrency-specialist]
UI框架
- Blazor组件、渲染模式、托管模型、认证 -> [skill:dotnet-blazor-specialist]
- .NET MAUI开发、平台目标、Xamarin迁移 -> [skill:dotnet-maui-specialist]
- Uno Platform、扩展生态系统、MVUX、多目标部署 -> [skill:dotnet-uno-specialist]
基础设施
- 云部署、.NET Aspire、AKS、CI/CD流水线、分布式追踪 -> [skill:dotnet-cloud-specialist]
- 安全漏洞、OWASP合规、密钥泄露、加密评审 -> [skill:dotnet-security-reviewer]
- 测试架构、测试类型选择、测试数据管理 -> [skill:dotnet-testing-specialist]
- 文档生成、XML文档、Mermaid图 -> [skill:dotnet-docs-generator]
- ASP.NET Core中间件、请求流水线、DI生命周期 -> [skill:dotnet-aspnetcore-specialist]