Agent Skillsdotnet/skills › template-comparison

template-comparison

GitHub

对比多个 dotnet new 模板的参数、特性及框架支持,生成侧边栏比较表并给出选型建议,辅助用户在创建项目前做出决策。

plugins/dotnet-template-engine/skills/template-comparison/SKILL.md dotnet/skills

Trigger Scenarios

用户需在相似模板间做选择 询问特定场景下应使用哪个模板

Install

npx skills add dotnet/skills --skill template-comparison -g -y
More Options

Non-standard path

npx skills add https://github.com/dotnet/skills/tree/main/plugins/dotnet-template-engine/skills/template-comparison -g -y

Use without installing

npx skills use dotnet/skills@template-comparison

指定 Agent (Claude Code)

npx skills add dotnet/skills --skill template-comparison -a claude-code -g -y

安装 repo 全部 skill

npx skills add dotnet/skills --all -g -y

预览 repo 内 skill

npx skills add dotnet/skills --list

SKILL.md

Frontmatter
{
    "name": "template-comparison",
    "license": "MIT",
    "description": "Compares two or more dotnet new templates side by side to help users choose between them based on parameters, feature support, frameworks, and classifications. USE FOR: deciding between similar templates (webapi vs webapp, blazor vs blazorwasm, console vs worker), producing a side-by-side comparison of parameters and feature support, understanding how templates differ before creating a project. DO NOT USE FOR: creating a project from a template (use template-instantiation), authoring or validating custom templates (use template-authoring and template-validation), general single-template discovery (use template-discovery).\n"
}

Template Comparison

This skill helps an agent compare 2+ dotnet new templates side by side so the user can pick the right one. It inspects each template's parameters and feature support and renders a comparison table.

When to Use

  • User is deciding between similar templates (e.g., webapi vs webapp, blazor vs blazorwasm)
  • User asks "which template should I use for X?"
  • User wants to understand how two or more templates differ before creating a project

When Not to Use

  • User wants to create a project — route to template-instantiation
  • User wants to author or validate a custom template — route to template-authoring or template-validation
  • User just needs to find or inspect a single template — route to template-discovery

Inputs

Input Required Description
Template short names Yes Two or more template short names to compare (e.g., webapi, webapp)
Comparison focus No Optional aspect to emphasize (auth, AOT, frameworks, interactivity)

Workflow

Step 1: Inspect each template

Run dotnet new <template> --help for each template being compared to collect its parameters (names, types, defaults, choices) and supported frameworks:

dotnet new webapi --help
dotnet new webapp --help

If a template is not installed, find and install it first (dotnet new search <keyword>, then dotnet new install <package>).

Run --help calls sequentially. The template engine uses a global mutex, so running several dotnet new <template> --help commands concurrently can fail with a transient "mutex"/"persistence" error and empty output. Inspect templates one at a time; if a call fails, retry it once before moving on, and still produce the comparison from whatever parameter knowledge you have rather than ending with no answer.

Step 2: Build the comparison table

Produce a side-by-side table covering:

  • Parameters — name, type, default, choices
  • Feature support — auth, AOT, Docker, controllers, interactivity
  • Available frameworks — e.g., net8.0, net9.0, net10.0
  • Classifications — categories the template advertises (Web, API, Blazor, etc.)

Example shape:

Aspect webapi webapp
Auth (--auth) None, Individual, SingleOrg, Windows None, Individual, SingleOrg, ...
AOT (--aot flag) present if dotnet new webapi --help lists --aot present if dotnet new webapp --help lists --aot
Controllers (--use-controllers) Yes n/a
Interactivity n/a n/a
Frameworks net8.0 / net9.0 / net10.0 net8.0 / net9.0 / net10.0
Classifications Web, WebAPI Web, Razor Pages

Step 3: Recommend

End with a decisive Recommendation line — never leave the user with just a table. Format:

Recommendation: <template> — one sentence tying the choice to the user's stated scenario. (Pick the other if <condition>.)

Then link to template-instantiation to create it. A comparison that ends without naming a winner (or a clear "it depends on X") is incomplete — that indecision is what makes this skill tie with a plain answer.

Decision shortcuts for common pairs

Use these as the opinionated default when the user hasn't given a countervailing constraint. Still inspect with --help to confirm parameters, but lead with the verdict:

Pair Default pick Because
webapi vs webapp webapi for a JSON/REST backend; webapp for server-rendered HTML/Razor Pages webapi ships controllers/minimal APIs + OpenAPI, no UI
blazor vs blazorwasm blazorwasm when offline / no server is required; blazor (Web App) for flexible server + client interactivity Standalone WASM runs fully client-side, works offline
worker vs console worker for long-lived/queue/background processing Generic Host: DI, logging, config, graceful shutdown, IHostedService lifecycle
mvc vs webapp webapp (Razor Pages) for page-focused apps; mvc for controller/view separation at scale Razor Pages is lighter for CRUD-style pages

Validation

  • Every template requested was inspected via dotnet new <template> --help
  • The comparison covers parameters, feature support, frameworks, and classifications
  • Differences relevant to the user's scenario are called out explicitly
  • A recommendation (or clear trade-off) is provided

Common Pitfalls

Pitfall Solution
Comparing uninstalled templates from memory Install and inspect each template so the comparison reflects the real parameters and choices.
Assuming feature parity Parameter names and feature support vary by template — confirm each with --help.
Comparing fundamentally different template types Only compare templates that solve overlapping problems; note when they target different scenarios.

More Info

Version History

  • 5354047 Current 2026-07-23 12:09

    根据跨家族评估结果增强技能:要求输出明确的推荐结论,添加针对标准模板对的决策捷径,移除不准确的AOT声明,并优化路由逻辑以避免与其他技能冲突。

  • ce75c35 2026-07-06 00:32

Same Skill Collection

.agents/skills/create-custom-agent/SKILL.md
.agents/skills/create-skill-test/SKILL.md
.agents/skills/create-skill/SKILL.md
.agents/skills/improve-skill-quality/SKILL.md
.github/skills/agentic-workflows/SKILL.md
eng/skill-validator/tests/fixtures/sample-skill/SKILL.md
plugins/dotnet-advanced/skills/csharp-scripts/SKILL.md
plugins/dotnet-advanced/skills/nuget-trusted-publishing/SKILL.md
plugins/dotnet-aspnetcore/skills/configuring-opentelemetry-dotnet/SKILL.md
plugins/dotnet-aspnetcore/skills/dotnet-webapi/SKILL.md
plugins/dotnet-aspnetcore/skills/minimal-api-file-upload/SKILL.md
plugins/dotnet-blazor/skills/create-blazor-project/SKILL.md
plugins/dotnet-blazor/skills/fetch-and-send-data/SKILL.md
plugins/dotnet-blazor/skills/support-prerendering/SKILL.md
plugins/dotnet-blazor/skills/use-js-interop/SKILL.md
plugins/dotnet-data/skills/optimizing-ef-core-queries/SKILL.md
plugins/dotnet-diag/skills/analyzing-dotnet-performance/SKILL.md
plugins/dotnet-diag/skills/clr-activation-debugging/SKILL.md
plugins/dotnet-diag/skills/dotnet-trace-collect/SKILL.md
plugins/dotnet-diag/skills/dump-collect/SKILL.md
plugins/dotnet-experimental/skills/exp-mock-usage-analysis/SKILL.md
plugins/dotnet-experimental/skills/exp-simd-vectorization/SKILL.md
plugins/dotnet-msbuild/skills/binlog-failure-analysis/SKILL.md
plugins/dotnet-msbuild/skills/copy-to-output-directory/SKILL.md
plugins/dotnet-msbuild/skills/msbuild-server/SKILL.md
plugins/dotnet-msbuild/skills/resolve-project-references/SKILL.md
plugins/dotnet-test-migration/skills/migrate-xunit-to-mstest/SKILL.md
plugins/dotnet-test-migration/skills/migrate-xunit-to-xunit-v3/SKILL.md
plugins/dotnet-test/skills/code-testing-extensions/SKILL.md
plugins/dotnet-test/skills/filter-syntax/SKILL.md
plugins/dotnet-test/skills/find-untested-sources/SKILL.md
plugins/dotnet-test/skills/platform-detection/SKILL.md
plugins/dotnet-upgrade/skills/dotnet-aot-compat/SKILL.md
.agents/skills/authoring-github-workflows/SKILL.md
plugins/dotnet-advanced/skills/dotnet-pinvoke/SKILL.md
plugins/dotnet-ai/skills/mcp-csharp-create/SKILL.md
plugins/dotnet-ai/skills/mcp-csharp-debug/SKILL.md
plugins/dotnet-ai/skills/mcp-csharp-test/SKILL.md
plugins/dotnet-ai/skills/technology-selection/SKILL.md
plugins/dotnet-aspnetcore/skills/convert-blazor-server-to-webapp/SKILL.md
plugins/dotnet-blazor/skills/author-component/SKILL.md
plugins/dotnet-blazor/skills/collect-user-input/SKILL.md
plugins/dotnet-blazor/skills/configure-auth/SKILL.md
plugins/dotnet-blazor/skills/coordinate-components/SKILL.md
plugins/dotnet-blazor/skills/plan-ui-change/SKILL.md
plugins/dotnet-data/skills/create-datadriven-aspnetcore/SKILL.md
plugins/dotnet-diag/skills/android-tombstone-symbolication/SKILL.md
plugins/dotnet-diag/skills/apple-crash-symbolication/SKILL.md
plugins/dotnet-diag/skills/microbenchmarking/SKILL.md
plugins/dotnet-experimental/skills/exp-test-maintainability/SKILL.md

Metadata

Files
0
Version
2124a6e
Hash
738d91af
Indexed
2026-07-06 00:32

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-05 20:26
浙ICP备14020137号-1 $Гость$