csharp-expert
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseC# Expert
C# 专家
Purpose
用途
Act as the front door for C# and .NET work. Determine what the user wants, identify the kind of
solution that owns the work, invoke the narrowest installed specialist, and give exact
marketplace installation steps when that specialist is missing. Keep direct C#
language guidance as the fallback, not the default.
dotnet/skills作为C#和.NET相关工作的入口。判断用户需求,识别负责该工作的解决方案类型,调用最细分的已安装专门技能;若该专门技能未安装,则提供准确的市场安装步骤。将直接的C#语言指导作为兜底方案,而非默认选项。
dotnet/skillsRouting Contract
路由规则
- Classify the requested outcome from the prompt.
- Inspect the smallest set of repository files needed to identify the solution type.
- Compare both signals with the descriptions of the skills currently available to the runtime.
- If the best skill is available and the user asked to perform the downstream work, invoke it with
the tool as the first external action; do not emit a routing explanation before the invocation and do not merely recommend the skill. For selection or preparation-only requests, name the installed specialist and stop without invoking it.
skill - If the best skill is missing, identify its plugin in
, then decide whether the current task can still be completed safely with repository tools and general .NET knowledge.
references/dotnet-skills-marketplace.md - Use multiple skills only when the request has distinct phases with different owners.
- If no narrower marketplace skill owns the request, continue with the C# fallback workflow.
Routing is not task completion. A missing specialist changes the confidence and preferred workflow;
it does not automatically justify stopping. Continue in the same turn when the task can be completed
and validated without the specialist. Stop for installation only when the missing capability is
actually required to proceed safely or the user asked specifically to install or load it.
Use these fast paths before general repository exploration:
- Marketplace selection only: when the prompt already states the framework, lifecycle, host, and required behavior, read only the bundled marketplace reference. Do not inspect the fixture, repository, GitHub, or plugin source. Name the exact skill and plugin, explain the decisive mapping, give host-correct acquisition steps, and stop.
- Only surviving diagnostic artifact: inspect that artifact first with the narrowest available
query. For a supplied , do not glob, list, or search unrelated workspace files before extracting its recorded error, property, target, and path evidence.
.binlog
Choose the operating mode from the user's requested outcome:
| User asks for | Required behavior |
|---|---|
| Implement, fix, diagnose, migrate, or create | Invoke the installed specialist, or complete a safe local fallback. If a narrower specialist exists but is unavailable, report its optional plugin afterward unless the user prohibited installation advice. |
| Identify, choose, install, prepare, or load the right marketplace capability | Inspect enough solution evidence to choose the owner, name it whether installed or missing, give acquisition steps only when needed, and stop without invoking the specialist, editing files, or generating the requested application artifact. |
Recover a plugin already installed but absent from | Refresh discovery first; do not reinstall or update on the first response. |
Choose one owner per phase. Do not expose internal routing ceremony or turn the answer into a menu.
- 对用户提示中请求的结果进行分类。
- 检查识别解决方案类型所需的最少仓库文件集合。
- 将上述两个信号与运行时当前可用的技能描述进行比对。
- 如果最佳技能可用且用户请求执行下游工作,将使用工具调用该技能作为首个外部操作;调用前不要输出路由说明,也不要仅推荐该技能。对于仅选择或准备类的请求,只需说明已安装的专门技能名称即可,无需调用。
skill - 如果最佳技能缺失,在中查找其对应的插件,然后判断当前任务是否仍可通过仓库工具和通用.NET知识安全完成。
references/dotnet-skills-marketplace.md - 仅当请求包含由不同技能负责的不同阶段时,才使用多个技能。
- 如果没有更细分的市场技能可处理该请求,则继续执行C#兜底工作流。
路由不等于任务完成。专门技能缺失会降低置信度并改变首选工作流,但并不意味着必须停止。如果无需该专门技能即可完成并验证任务,则在当前轮次继续处理。仅当缺失的能力是安全推进任务的必要条件,或用户明确要求安装/加载该技能时,才停止任务并进行安装。
在进行通用仓库探查之前,可使用以下快速路径:
- 仅市场选择场景: 当用户提示已明确说明框架、生命周期、宿主和所需行为时,仅读取随附的市场参考文档即可。无需检查测试配置、仓库、GitHub或插件源码。说明准确的技能和插件名称,解释关键匹配依据,提供对应宿主的安装步骤,然后结束处理。
- 仅存诊断工件场景: 首先使用最精准的可用查询检查该工件。对于提供的文件,在提取其记录的错误、属性、目标和路径证据之前,不要进行通配符匹配、列出或搜索不相关的工作区文件。
.binlog
根据用户请求的结果选择操作模式:
| 用户请求 | 所需行为 |
|---|---|
| 实现、修复、诊断、迁移或创建 | 调用已安装的专门技能,或完成安全的本地兜底处理。如果存在更细分的专门技能但不可用,除非用户禁止安装建议,否则在后续说明其可选插件。 |
| 识别、选择、安装、准备或加载合适的市场能力 | 检查足够的解决方案证据以选择负责技能,无论是否安装都说明其名称,仅在必要时提供安装步骤,然后结束处理,无需调用专门技能、编辑文件或生成请求的应用程序工件。 |
恢复已安装但在 | 首先刷新发现机制;首次响应时不要重新安装或更新。 |
每个阶段选择一个负责技能。不要暴露内部路由流程,也不要将答案变成菜单列表。
Step 1: Classify the Prompt
步骤1:对用户提示进行分类
Identify the primary action before inspecting implementation details.
| Prompt intent | Prefer skills whose description owns |
|---|---|
| Create or scaffold | Project/template creation for the detected solution type |
| Add application behavior | The framework or component where the behavior lives |
| Fix a compiler/runtime defect | The narrow language, framework, data, or interop owner |
| Build or restore failure | MSBuild, SDK, workload, project-reference, or NuGet diagnosis |
| Write, run, review, or migrate tests | The exact testing lifecycle or migration requested |
| Upgrade or migrate | The source version, target version, and artifact being migrated |
| Diagnose slowness, crash, hang, or memory growth | Runtime diagnostics unless evidence points to build performance or a local code hot path |
| Refactor without changing behavior | Refactoring rather than feature or bug-fix guidance |
| Package, publish, or trust a feed | NuGet/package-publishing workflow |
| Ask about C# syntax, types, nullability, async, or APIs | A language specialist unless solution-specific behavior is load-bearing |
Treat user nouns as clues, not proof. "Performance" may mean runtime tracing, a microbenchmark, EF
query shape, SIMD, allocation-heavy C#, or MSBuild evaluation. "API" may mean ASP.NET Core, a public
library contract, or an external service client.
When a deployed .NET process needs CPU and allocation evidence and no observability vendor is named,
prefer the vendor-neutral .NET runtime diagnostics route. Do not substitute an APM-vendor agent for
raw process evidence merely because it can also report performance data. In a selection answer,
state that runtime trace collection gathers deployed-process evidence before a hot method is known,
whereas source optimization starts from code or an already identified hot path.
在检查实现细节之前,先确定主要操作。
| 提示意图 | 优先选择的负责技能描述 |
|---|---|
| 创建或脚手架搭建 | 对应检测到的解决方案类型的项目/模板创建 |
| 添加应用程序行为 | 该行为所属的框架或组件 |
| 修复编译器/运行时缺陷 | 最细分的语言、框架、数据或互操作负责技能 |
| 构建或还原失败 | MSBuild、SDK、工作负载、项目引用或NuGet诊断 |
| 编写、运行、评审或迁移测试 | 请求的具体测试生命周期或迁移 |
| 升级或迁移 | 源版本、目标版本以及待迁移的工件 |
| 诊断速度慢、崩溃、挂起或内存增长 | 运行时诊断,除非有证据表明是构建性能或本地代码热路径问题 |
| 不改变行为的重构 | 重构相关技能,而非功能或bug修复指导 |
| 打包、发布或信任源 | NuGet/包发布工作流 |
| 询问C#语法、类型、可空性、异步或API | 语言专门技能,除非解决方案特定行为是关键影响因素 |
将用户提到的名词作为线索而非定论。「性能」可能指运行时追踪、微基准测试、EF查询形态、SIMD、高分配C#代码或MSBuild求值。「API」可能指ASP.NET Core、公共库契约或外部服务客户端。
当已部署的.NET进程需要CPU和分配证据且未指定可观测性厂商时,优先选择厂商中立的.NET运行时诊断路径。不要仅因为APM厂商的Agent也能报告性能数据,就用它替代原始进程证据。在选择类回答中,需说明:运行时追踪收集是在已知热方法之前收集已部署进程的证据,而源码优化是从代码或已识别的热路径开始的。
Step 2: Detect the Solution Type
步骤2:检测解决方案类型
Inspect only likely manifests and nearby owning files. Prefer a solution/project file and the file
named by the prompt over broad repository searches.
Use LSP navigation when available to trace a prompt-named symbol or file to its owning project and
nearby callers. Use LSP diagnostics as early evidence, but do not treat them as a substitute for the
specialist's required build or runtime validation.
When the prompt names a C# source file with an editor/compiler defect and LSP is available, request
diagnostics before running a build or broad search. Use the diagnostic location and code to scope
the edit, request diagnostics again after the edit, then run the narrowest build or test that proves
the fix.
| Evidence | Solution or concern |
|---|---|
| ASP.NET Core |
| Blazor |
| .NET MAUI |
| Windows Forms |
EF Core package references, | .NET data / EF Core |
| .NET testing |
| MSBuild |
| NuGet |
| Old and new TFMs, framework-version migration request, compatibility warnings | .NET upgrade |
| AOT, interop, or deployment compatibility |
| Aspire AppHost or distributed-application model | Aspire |
| AI/ML/LLM packages or agent/RAG/MCP application code | .NET AI |
| No project plus an explicit request for a one-file C# program | File-based C# |
| None of the above; correctness depends on C# semantics | C# language fallback |
When several project types exist, trace from the file or behavior named in the prompt to its owning
project. Do not route the whole solution from the first found.
.csproj仅检查可能的清单文件和附近的负责文件。优先查看解决方案/项目文件和用户提示中提到的文件,而非进行广泛的仓库搜索。
如果可用,使用LSP导航将用户提示中提到的符号或文件追溯到其所属项目和附近的调用方。将LSP诊断作为早期证据,但不要用它替代专门技能所需的构建或运行时验证。
当用户提示提到存在编辑器/编译器缺陷的C#源文件且LSP可用时,在运行构建或广泛搜索之前先请求诊断。使用诊断位置和代码确定编辑范围,编辑后再次请求诊断,然后运行最精准的构建或测试以证明修复有效。
| 证据 | 解决方案或关注点 |
|---|---|
| ASP.NET Core |
| Blazor |
| .NET MAUI |
| Windows Forms |
EF Core包引用、 | .NET 数据 / EF Core |
| .NET 测试 |
| MSBuild |
| NuGet |
| 新旧TFM、框架版本迁移请求、兼容性警告 | .NET 升级 |
| AOT、互操作或部署兼容性 |
| Aspire AppHost或分布式应用模型 | Aspire |
| AI/ML/LLM包或Agent/RAG/MCP应用代码 | .NET AI |
| 无项目且明确请求单文件C#程序 | 基于文件的C# |
| 以上都不是;正确性取决于C#语义 | C# 语言兜底 |
当存在多种项目类型时,从用户提示中提到的文件或行为追溯到其所属项目。不要根据找到的第一个文件对整个解决方案进行路由。
.csprojStep 3: Match the Skill and Marketplace Plugin
步骤3:匹配技能与市场插件
Use the runtime-provided available-skill names and descriptions as the source of truth. Do not
search for a skill installation directory or invoke a remembered skill that is not currently
available.
Rank candidates in this order:
- An exact transformation or lifecycle skill, such as a specific test migration, framework conversion, template operation, query optimization, or diagnostic collection workflow.
- A framework/component skill matching the owning project and requested behavior.
- A tooling skill matching the failing subsystem, such as MSBuild, NuGet, test execution, SDK setup, or runtime diagnostics.
- A cross-cutting specialist matching the actual mechanism, such as interop, vectorization, serialization, AOT, or microbenchmarking.
- for behavior-preserving structural change.
csharp-refactoring - The C# language fallback below when no narrower available skill owns the work.
Because ships in the core plugin, prefer its installed sibling skills
, , and when they own the request. Do not require the
user to install merely to analyze an ordinary build failure or binlog that the
core entry already covers.
csharp-expertdotnetcsharp-refactoringmsbuildsetup-local-sdkdotnet-msbuildmsbuildThe most specific noun is not always the owner. Route by the decision that determines success:
| Ambiguous request | Distinguishing evidence |
|---|---|
| "Make this faster" | Build duration -> build-performance skill; SQL/query shape -> data skill; process CPU/memory -> diagnostics; isolated code comparison -> microbenchmarking/vectorization |
| "Fix the API" | HTTP pipeline/endpoint -> ASP.NET Core; public type contract -> C# fallback; JSON version behavior -> serialization specialist |
| "Upgrade the tests" | Framework version change -> exact migration skill; failing execution -> run-tests/platform skill; quality review -> analysis skill |
| "Fix nullability" | Project-wide nullable adoption -> migration skill; one incorrect flow/contract -> C# fallback; generated framework binding -> owning framework skill |
| "Add authentication" | Framework-specific application auth -> owning framework skill; token parsing primitive -> C# fallback |
If two candidates remain plausible, gather one more decisive artifact rather than loading both.
After selecting the capability:
- If its skill appears in the runtime's available-skill catalog, invoke it immediately only when the operating mode requires downstream implementation. For selection or preparation-only mode, name the installed skill and stop after the requested plan or availability guidance.
- If it does not appear, open and map the capability or skill name to the owning marketplace plugin.
references/dotnet-skills-marketplace.md - Recommend the smallest plugin that contains the needed skill. Do not install every .NET plugin.
- Follow the missing-skill workflow below. Do not claim that an unavailable skill was loaded, and do not stop if a safe, verifiable local fallback can still complete the request.
When the bundled reference contains a maintained marketplace capability, recommend that capability.
Do not ask the user to author a repository-local agent or skill as a substitute. For migrations,
state the source-to-target lifecycle and parameterization mappings that make the chosen capability
fit, not only its name.
For marketplace-planning requests, name both the narrow skill and its plugin. Use project evidence
to disambiguate framework nouns, but do not perform the downstream implementation the user asked to
prepare for.
For migration selection, quote concrete source-to-target syntax from the bundled reference: include
at least one lifecycle mapping and one parameterization mapping instead of saying only that those
behaviors are supported.
Use the bundled marketplace reference as the authoritative lookup. Do not search GitHub, inspect
unrelated plugin source, or enumerate alternatives after the prompt and one nearby manifest already
identify the owner. If the prompt already names the source and target lifecycle or an unambiguous
artifact constraint, do not inspect files merely to reconfirm it. A selection request that states
the framework, lifecycle, and required behavior needs no repository search: read only the bundled
reference, choose the owner, and answer. Do not inspect the local skill source, marketplace checkout,
or fixture merely to prove that a named capability exists.
Answer in four compact parts:
- Exact skill name and plugin; never substitute a generic capability label when the bundled reference contains an exact route.
- One sentence matching the decisive behavior or artifact evidence. Use the user's concrete mechanism: N+1/database round trips for repeated EF related-data queries; deployed-process CPU/allocation collection before a known hot path for runtime tracing; source and target TFM plus compatibility work for upgrades.
- Host-correct install steps.
- Restart/discovery verification, when the host requires it.
For a selection answer, completeness beats extra exploration. Read the bundled reference once,
then answer. Do not call host help, search the web, or inspect plugin source to reconfirm commands
already present in the reference.
Do not add a header in marketplace-planning mode; lead with the capability and plugin.
Do not mention this skill's step numbers, fallback labels, routing contract, or internal selection
process in the user-facing answer.
Route:以运行时提供的可用技能名称和描述为唯一事实来源。不要搜索技能安装目录,也不要调用记忆中但当前不可用的技能。
按以下顺序对候选技能进行排序:
- 精准的转换或生命周期技能,例如特定的测试迁移、框架转换、模板操作、查询优化或诊断收集工作流。
- 与所属项目和请求行为匹配的框架/组件技能。
- 与故障子系统匹配的工具类技能,例如MSBuild、NuGet、测试执行、SDK安装或运行时诊断。
- 与实际机制匹配的跨领域专门技能,例如互操作、向量化、序列化、AOT或微基准测试。
- 用于行为不变的结构变更的。
csharp-refactoring - 当没有更细分的可用技能负责该工作时,使用下文的C#语言兜底。
由于随核心插件发布,当请求由、和这些已安装的同级技能负责时,优先使用这些技能。不要仅为了分析普通构建失败或binlog就要求用户安装,因为核心条目已经覆盖了这些场景。
csharp-expertdotnetcsharp-refactoringmsbuildsetup-local-sdkdotnet-msbuildmsbuild最具体的名词并不总是负责方。应根据决定成功的关键因素进行路由:
| 模糊请求 | 区分依据 |
|---|---|
| 「让这个更快」 | 构建时长 -> 构建性能技能;SQL/查询形态 -> 数据技能;进程CPU/内存 -> 诊断技能;独立代码对比 -> 微基准测试/向量化 |
| 「修复API」 | HTTP管道/端点 -> ASP.NET Core;公共类型契约 -> C#兜底;JSON版本行为 -> 序列化专门技能 |
| 「升级测试」 | 框架版本变更 -> 精准迁移技能;执行失败 -> 运行测试/平台技能;质量评审 -> 分析技能 |
| 「修复可空性问题」 | 项目级可空性启用 -> 迁移技能;单个错误流程/契约 -> C#兜底;生成的框架绑定 -> 所属框架技能 |
| 「添加身份验证」 | 框架特定的应用认证 -> 所属框架技能;令牌解析基础功能 -> C#兜底 |
如果仍有两个候选技能都合理,则再收集一个关键工件来判断,而不是同时加载两个。
选择能力后:
- 如果该技能出现在运行时的可用技能目录中,仅当操作模式需要下游实现时才立即调用。对于选择或仅准备模式,只需说明已安装的技能名称,并在提供请求的计划或可用性指导后结束。
- 如果该技能未出现,打开,将该能力或技能名称映射到对应的市场插件。
references/dotnet-skills-marketplace.md - 推荐包含所需技能的最小插件,不要安装所有.NET插件。
- 遵循下文的缺失技能工作流。不要声称已加载不可用的技能,若仍有安全、可验证的本地兜底方案可完成请求,则不要停止。
当随附的参考文档中包含维护中的市场能力时,推荐该能力。不要要求用户编写仓库本地的Agent或技能作为替代。对于迁移场景,需说明使所选能力适用的源到目标生命周期和参数化映射,而不仅仅是名称。
对于市场规划类请求,同时说明细分技能及其插件。使用项目证据消除框架名词的歧义,但不要执行用户要求准备的下游实现工作。
对于迁移选择场景,从随附的参考文档中引用具体的源到目标语法:至少包含一个生命周期映射和一个参数化映射,而不是仅说支持这些行为。
将随附的市场参考文档作为权威查找依据。当用户提示和附近的一个清单文件已经确定负责方后,不要搜索GitHub、检查不相关的插件源码或枚举替代方案。如果用户提示已经指定了源和目标生命周期或明确的工件约束,不要仅为了再次确认而检查文件。对于已说明框架、生命周期和所需行为的选择类请求,无需进行仓库搜索:仅需阅读随附的参考文档,选择负责方并回答即可。不要仅为了证明某个指定能力存在而检查本地技能源码、市场检出代码或测试配置。
回答分为四个简洁部分:
- 准确的技能名称和插件;当随附参考文档中包含精确路由时,绝不要用通用能力标签代替。
- 一句话说明关键行为或工件证据的匹配关系。使用用户的具体机制:例如EF重复关联数据查询的N+1/数据库往返;运行时追踪中在已知热路径之前的已部署进程CPU/分配收集;升级中的源和目标TFM以及兼容性工作。
- 对应宿主的正确安装步骤。
- 宿主要求时的重启/发现验证。
对于选择类回答,完整性比额外探查更重要。阅读一次随附的参考文档,然后给出回答。不要调用宿主帮助、搜索网页或检查插件源码来再次确认参考文档中已有的命令。
在市场规划模式下不要添加标题;以能力和插件开头。在面向用户的回答中,不要提及本技能的步骤编号、兜底标签、路由规则或内部选择流程。
Route:Step 4: Obtain a Missing Skill
步骤4:获取缺失的技能
For GitHub Copilot CLI or Claude Code, give these exact commands with the selected plugin substituted:
text
/plugin marketplace add dotnet/skills
/plugin install <plugin>@dotnet-agent-skillsWhen installation is the next step, require:
text
Restart the host, run `/skills` to confirm the specialist is available, and rerun the request.When the task can proceed without the specialist:
- State the missing specialist and reduced coverage in one concise sentence.
- Complete the requested work now using the repository, standard .NET tooling, and the fallback rules that match the task.
- Validate the result as narrowly as possible.
- Put optional installation guidance after the result. Do not ask whether to proceed, defer the implementation, or make the user repeat the request.
If the user explicitly says not to recommend or discuss installation, omit the missing-plugin
sentence and all acquisition guidance. Complete and validate the safe fallback with the capabilities
available in the current run.
This reduced-coverage path may still perform framework, migration, diagnostics, or tooling work.
Preserve the selected domain's invariants and report specialist-specific checks that were unavailable.
Rules:
- The marketplace name is ; the source repository is
dotnet-agent-skills.dotnet/skills - The install target is the plugin name, not the individual skill name.
- If the marketplace is already registered, the add command may report that fact; continue with the install command.
- Slash commands are host actions. Present them exactly; do not run shell commands that pretend to install a Copilot or Claude plugin.
- Do not pretend to continue with the unavailable specialist workflow. Use an explicit local fallback when the task remains safely achievable.
- If the plugin is installed but the skill is absent, ask the user to restart and check before recommending a reinstall.
/skills - For Codex CLI, VS Code, Cursor, or individual-skill installation, use the host-specific commands in
.
references/dotnet-skills-marketplace.md - If installation is impossible, declined, or not necessary for the immediate task, state the reduced coverage and use the safest local fallback when it can still satisfy the request.
- Never trade away implementation or validation merely to produce installation instructions.
对于GitHub Copilot CLI或Claude Code,提供以下准确命令,并替换为所选插件:
text
/plugin marketplace add dotnet/skills
/plugin install <plugin>@dotnet-agent-skills当下一步是安装时,要求:
text
Restart the host, run `/skills` to confirm the specialist is available, and rerun the request.当无需该专门技能也可继续任务时:
- 用一句简洁的话说明缺失的专门技能和覆盖范围的缩减。
- 立即使用仓库、标准.NET工具和匹配任务的兜底规则完成请求的工作。
- 尽可能精准地验证结果。
- 将可选的安装指导放在结果之后。不要询问是否继续、推迟实现,或让用户重复请求。
如果用户明确表示不建议或不讨论安装,则省略缺失插件的说明和所有获取指导。使用当前运行中可用的能力完成并验证安全兜底方案。
这种缩减覆盖范围的路径仍可执行框架、迁移、诊断或工具类工作。保留所选领域的不变量,并说明无法进行的专门技能特定检查。
规则:
- 市场名称为;源仓库为
dotnet-agent-skills。dotnet/skills - 安装目标是插件名称,而非单个技能名称。
- 如果市场已注册,添加命令可能会报告该情况;继续执行安装命令即可。
- 斜杠命令是宿主操作。准确呈现它们;不要运行假装安装Copilot或Claude插件的shell命令。
- 不要假装继续执行不可用的专门技能工作流。当任务仍可安全完成时,使用明确的本地兜底方案。
- 如果插件已安装但技能缺失,在建议重新安装之前,请用户重启并检查。
/skills - 对于Codex CLI、VS Code、Cursor或单个技能安装,使用中的宿主特定命令。
references/dotnet-skills-marketplace.md - 如果安装不可行、被拒绝,或对当前任务不是必需的,说明缩减的覆盖范围,并在仍能满足请求时使用最安全的本地兜底方案。
- 绝不要为了生成安装说明而牺牲实现或验证。
Installed but not discovered
已安装但未被发现
When the user says the plugin is already installed but its skills are absent:
- Trust the stated installed state unless repository evidence directly contradicts it.
- Start by acknowledging that the plugin is installed and discovery is stale.
- Tell the user to restart or reload the host, then run .
/skills - Name the expected skill so discovery can be verified.
- Stop there on the first response. Do not emit marketplace-add, install, update, shell-level
plugin-management, , or invented explicit-invocation commands.
/skills reload
Only after the user reports that restart plus still fails should the next response move to
host-specific update or reinstall diagnostics.
/skills当用户表示插件已安装但技能缺失时:
- 信任用户声明的已安装状态,除非仓库证据直接与之矛盾。
- 首先确认插件已安装,只是发现机制过期了。
- 告知用户重启或重新加载宿主,然后运行。
/skills - 说明预期的技能名称,以便验证发现结果。
- 首次响应到此为止。不要输出市场添加、安装、更新、shell级插件管理、或编造的显式调用命令。
/skills reload
仅当用户报告重启加上运行仍然失败后,下一次响应才应进行宿主特定的更新或重新安装诊断。
/skillsStep 5: Compose Skills Deliberately
步骤5:合理组合技能
Use a sequence only when phases are independently owned. Examples:
- Scaffold a project, then author a framework-specific component.
- Collect a trace, then analyze the captured performance evidence.
- Upgrade a target framework, then address a separately requested AOT compatibility phase.
- Detect the test platform, then run tests with the correct filter syntax.
Do not chain skills that duplicate each other, load an entire plugin "just in case", or use a
generic skill before a specialist that already owns the request. After a specialist is loaded,
follow its workflow and boundaries.
If one or more phase specialists are missing but ordinary commands and repository edits
can complete the phases, execute the phases in order and report the optional plugins afterward.
Do not defer an entire multi-phase request solely because the ideal plugin set is unavailable.
dotnet仅当各个阶段由不同技能独立负责时,才使用顺序调用。示例:
- 搭建项目脚手架,然后编写框架特定的组件。
- 收集追踪数据,然后分析捕获的性能证据。
- 升级目标框架,然后处理单独请求的AOT兼容性阶段。
- 检测测试平台,然后使用正确的过滤语法运行测试。
不要链接相互重复的技能,不要「以防万一」加载整个插件,也不要在已有专门技能负责请求的情况下先使用通用技能。加载专门技能后,遵循其工作流和边界。
如果一个或多个阶段的专门技能缺失,但普通的命令和仓库编辑可以完成这些阶段,则按顺序执行这些阶段,然后在后续说明可选插件。不要仅因为理想的插件集不可用就推迟整个多阶段请求。
dotnetStep 6: C# Language Fallback
步骤6:C#语言兜底
Use this only when no narrower available skill matches and the load-bearing problem is C# language
or runtime semantics.
- Reproduce the exact compiler diagnostic, failing test, exception, or incorrect behavior when source is available. If the defect is fully specified but no repository was provided, answer with the concrete minimal code pattern instead of refusing to help.
- Inspect the owning project for TFM, language version, nullable policy, analyzers, and existing tests.
- Preserve public signatures, serialization shape, ownership, cancellation, disposal, and multi-target behavior unless the request explicitly changes them.
- Implement the smallest complete fix through the affected call path.
- Check LSP diagnostics when available, then build the narrowest affected project and run focused tests or the executable path that proves the original symptom is gone.
For a marketplace-planning request whose correct route is this fallback, say: Do not
claim that no skill or specialist is involved.
No additional marketplace plugin is required; the loaded csharp-expert skill owns this C# semantic fix.Do not raise the SDK, TFM, language version, package versions, or analyzer settings merely to make a
local C# edit compile. Do not edit generated files. Do not use broad casts, null-forgiving
operators, catch-all handlers, or fire-and-forget work to hide evidence.
When a framework type provides an ownership-preserving overload such as , give that
canonical fix only. Never suggest intentionally leaking or skipping disposal of a disposable
wrapper as an alternative. Preserve the example's observable behavior: do not add null coalescing,
change a nullable return to a non-null value, alter access modifiers, or invent unrelated error
handling merely to make a conceptual snippet look more complete. If an example directly returns
, use a nullable return in nullable-aware C#; do not show
while claiming that the existing null-on-end-of-stream behavior is preserved.
leaveOpen: trueStreamReader.ReadLine()string?string仅当没有更细分的可用技能匹配,且核心问题是C#语言或运行时语义时,才使用此方案。
- 当源码可用时,复现准确的编译器诊断、失败的测试、异常或错误行为。如果缺陷已完全说明但未提供仓库,用具体的最小代码模式回答,而不是拒绝帮助。
- 检查所属项目的TFM、语言版本、可空性策略、分析器和现有测试。
- 保留公共签名、序列化形态、所有权、取消、释放和多目标行为,除非请求明确要求更改。
- 通过受影响的调用路径实现最小的完整修复。
- 如果可用,检查LSP诊断,然后构建受影响的最小项目,并运行针对性测试或可执行路径以证明原始症状已消失。
对于正确路由为此兜底方案的市场规划类请求,说明: 不要声称不涉及任何技能或专门技能。
No additional marketplace plugin is required; the loaded csharp-expert skill owns this C# semantic fix.不要仅为了让本地C#编辑通过编译就升级SDK、TFM、语言版本、包版本或分析器设置。不要编辑生成的文件。不要使用宽泛的强制转换、null包容运算符、全捕获处理程序或即发即弃的工作来隐藏证据。
当框架类型提供了保留所有权的重载(例如)时,仅给出该规范修复方案。绝不要建议故意泄漏或跳过可释放包装器的释放作为替代方案。保留示例的可观察行为:不要为了让概念性代码片段看起来更完整而添加空合并、将可空返回值改为非空值、修改访问修饰符或编造不相关的错误处理。如果示例直接返回,在启用可空性的C#中使用可空的返回类型;不要一边显示一边声称保留了现有的流末尾返回null的行为。
leaveOpen: trueStreamReader.ReadLine()string?stringBoundaries and Failure Handling
边界与故障处理
- If the best specialist is unavailable, provide its exact plugin installation command. Continue immediately with an explicit reduced-coverage fallback whenever standard tools can still complete and validate the task.
dotnet/skills - If repository evidence contradicts the prompt, state the mismatch and route from the evidence that owns the requested file or behavior.
- If the user explicitly requests analysis only, route to the correct analysis skill but do not edit.
- If the user supplies the only surviving diagnostic artifact, analyze that artifact directly. Routing must not add installation attempts, unrelated checkout searches, or marketplace ceremony before the evidence is read.
- For an artifact-backed failure, propose only the smallest repair supported by the recorded evidence. Do not add alternate configuration or relocation advice unless the artifact indicates that the configured path is wrong rather than the required input being absent.
- Describe a missing artifact at its exact configured relative path. Do not call a nested path such
as the repository root, and explicitly rule out build or CI configuration changes when the recorded command already proves the configured path.
schemas/prod.json - If a loaded specialist reports that its prerequisites are absent, return here, reclassify using that evidence, and choose one different route. Do not bounce repeatedly between skills.
- Non-.NET work is out of scope; leave this skill dormant rather than forcing a .NET interpretation.
- 如果最佳专门技能不可用,提供其准确的插件安装命令。只要标准工具仍能完成并验证任务,就立即继续执行明确的缩减覆盖范围的兜底方案。
dotnet/skills - 如果仓库证据与用户提示矛盾,说明不一致之处,并根据负责请求文件或行为的证据进行路由。
- 如果用户明确要求仅进行分析,则路由到正确的分析技能,但不要进行编辑。
- 如果用户提供了唯一留存的诊断工件,直接分析该工件。在读取证据之前,路由过程不得添加安装尝试、不相关的检出搜索或市场流程。
- 对于有工件支撑的故障,仅提出记录证据支持的最小修复方案。不要添加替代配置或重定位建议,除非工件表明配置的路径有误,而非缺少所需输入。
- 按确切的配置相对路径描述缺失的工件。不要将等嵌套路径称为仓库根目录,并且当记录的命令已经证明配置路径时,明确排除构建或CI配置更改的可能性。
schemas/prod.json - 如果已加载的专门技能报告缺少先决条件,返回此处,使用该证据重新分类,并选择另一条不同的路由。不要在技能之间反复跳转。
- 非.NET工作不在范围内;让此技能保持休眠状态,不要强行进行.NET相关解读。
Observable Completion Criteria
可观察的完成标准
- One evidence-backed owner is selected for each distinct phase and invoked when available.
- Missing specialists map to the smallest correct plugin and host-specific acquisition path.
- Safe local work continues despite a missing specialist; preparation-only requests stop before edits.
- Pure C# work stays local and preserves behavior; implementation work receives focused validation.
- 每个不同阶段都选择一个有证据支持的负责技能,并在可用时调用。
- 缺失的专门技能映射到最小的正确插件和宿主特定的获取路径。
- 即使缺少专门技能,安全的本地工作仍继续进行;仅准备类请求在编辑前停止。
- 纯C#工作保持本地处理并保留行为;实现工作获得针对性验证。