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
Evidence contract: a side-by-side table is useful only when every option claim is
grounded in the currently installed templates. Run each --help command sequentially,
capture the same requested dimensions for each template, and label an unavailable option
as Not exposed rather than guessing or borrowing a flag from another template.
Decision contract: optimize the comparison for the user's stated decision, not table
size. Cover every requested dimension, omit unrelated option rows, give a scenario-specific
reason, and include one safe --dry-run command for the recommended starting point when it
would make the recommendation actionable.
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, search for its provider and report the missing prerequisite.
Install it only when the user asked you to modify the environment or approved the install.
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.)
Use one row per requested decision dimension and cite the observed option name in the cell.
Do not fill a requested row with general framework knowledge when it is specifically about
what the template generates or exposes.
When the user asks about generated dependencies without allowing project creation,
inspect the installed template package's source .csproj files. --help and --dry-run
do not reveal package references. Do not create temporary projects merely to inspect them,
and do not guess current package IDs or test-platform defaults.
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 only for the recommendation, not as evidence of current parameter support. Still
inspect with --help before filling the comparison table:
| 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 |
These constraints override the shorthand above:
- Choose
mvc when the user explicitly anticipates a large application or shared
controller logic, even if its first pages are CRUD-focused.
- Choose
blazor with Server interactivity over webapp when rich interactive forms
are central but useful HTML must arrive on the first response. Explain that the initial
render is server-produced and that interactive components use the Blazor form/component
model rather than Razor Pages PageModel.
- For offline support, choose
blazorwasm and explain the PWA/service-worker requirement,
cached-after-first-load behavior, and lack of a required live server for execution.
- For a durable queue processor, choose
worker and tie the decision to Generic Host
lifecycle, dependency injection, configuration, logging, graceful shutdown, and a real
durable queue rather than an in-memory loop.
Validation
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
1---2name: template-comparison3description: 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).4license: MIT5---6
7# Template Comparison
8
9This skill helps an agent compare 2+ `dotnet new` templates side by side so the user can
10pick the right one. It inspects each template's parameters and feature support and renders
11a comparison table.
12
13## When to Use
14
15- User is deciding between similar templates (e.g., `webapi` vs `webapp`, `blazor` vs `blazorwasm`)
16- User asks "which template should I use for X?"
17- User wants to understand how two or more templates differ before creating a project
18
19## When Not to Use
20
21- User wants to create a project — route to `template-instantiation`
22- User wants to author or validate a custom template — route to `template-authoring` or `template-validation`
23- User just needs to find or inspect a single template — route to `template-discovery`
24
25## Inputs
26
27| Input | Required | Description |
28|-------|----------|-------------|
29| Template short names | Yes | Two or more template short names to compare (e.g., `webapi`, `webapp`) |
30| Comparison focus | No | Optional aspect to emphasize (auth, AOT, frameworks, interactivity) |
31
32## Workflow
33
34**Evidence contract:** a side-by-side table is useful only when every option claim is
35grounded in the currently installed templates. Run each `--help` command sequentially,
36capture the same requested dimensions for each template, and label an unavailable option
37as `Not exposed` rather than guessing or borrowing a flag from another template.
38
39**Decision contract:** optimize the comparison for the user's stated decision, not table
40size. Cover every requested dimension, omit unrelated option rows, give a scenario-specific
41reason, and include one safe `--dry-run` command for the recommended starting point when it
42would make the recommendation actionable.
43
44### Step 1: Inspect each template
45
46Run `dotnet new <template> --help` for each template being compared to collect its
47parameters (names, types, defaults, choices) and supported frameworks:
48
49```bash
50dotnet new webapi --help
51dotnet new webapp --help
52```
53
54If a template is not installed, search for its provider and report the missing prerequisite.
55Install it only when the user asked you to modify the environment or approved the install.
56
57> **Run `--help` calls sequentially.** The template engine uses a global mutex, so running
58> several `dotnet new <template> --help` commands concurrently can fail with a transient
59> "mutex"/"persistence" error and empty output. Inspect templates one at a time; if a call
60> fails, retry it once before moving on, and still produce the comparison from whatever
61> parameter knowledge you have rather than ending with no answer.
62
63### Step 2: Build the comparison table
64
65Produce a side-by-side table covering:
66
67- **Parameters** — name, type, default, choices
68- **Feature support** — auth, AOT, Docker, controllers, interactivity
69- **Available frameworks** — e.g., net8.0, net9.0, net10.0
70- **Classifications** — categories the template advertises (Web, API, Blazor, etc.)
71
72Use one row per requested decision dimension and cite the observed option name in the cell.
73Do not fill a requested row with general framework knowledge when it is specifically about
74what the template generates or exposes.
75
76When the user asks about **generated dependencies** without allowing project creation,
77inspect the installed template package's source `.csproj` files. `--help` and `--dry-run`
78do not reveal package references. Do not create temporary projects merely to inspect them,
79and do not guess current package IDs or test-platform defaults.
80
81Example shape:
82
83| Aspect | `webapi` | `webapp` |
84|--------|----------|----------|
85| Auth (`--auth`) | None, Individual, SingleOrg, Windows | None, Individual, SingleOrg, ... |
86| AOT (`--aot` flag) | present if `dotnet new webapi --help` lists `--aot` | present if `dotnet new webapp --help` lists `--aot` |
87| Controllers (`--use-controllers`) | Yes | n/a |
88| Interactivity | n/a | n/a |
89| Frameworks | net8.0 / net9.0 / net10.0 | net8.0 / net9.0 / net10.0 |
90| Classifications | Web, WebAPI | Web, Razor Pages |
91
92### Step 3: Recommend
93
94End with a decisive **Recommendation** line — never leave the user with just a table. Format:
95
96> **Recommendation: `<template>`** — one sentence tying the choice to the user's stated scenario. (Pick the other if `<condition>`.)
97
98Then 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.
99
100### Decision shortcuts for common pairs
101
102Use these only for the recommendation, not as evidence of current parameter support. Still
103inspect with `--help` before filling the comparison table:
104
105| Pair | Default pick | Because |
106|------|-------------|---------|
107| `webapi` vs `webapp` | **`webapi`** for a JSON/REST backend; `webapp` for server-rendered HTML/Razor Pages | webapi ships controllers/minimal APIs + OpenAPI, no UI |
108| `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 |
109| `worker` vs `console` | **`worker`** for long-lived/queue/background processing | Generic Host: DI, logging, config, graceful shutdown, `IHostedService` lifecycle |
110| `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 |
111
112These constraints override the shorthand above:
113
114- Choose **`mvc`** when the user explicitly anticipates a large application or shared
115 controller logic, even if its first pages are CRUD-focused.
116- Choose **`blazor` with Server interactivity** over `webapp` when rich interactive forms
117 are central but useful HTML must arrive on the first response. Explain that the initial
118 render is server-produced and that interactive components use the Blazor form/component
119 model rather than Razor Pages `PageModel`.
120- For **offline support**, choose `blazorwasm` and explain the PWA/service-worker requirement,
121 cached-after-first-load behavior, and lack of a required live server for execution.
122- For a **durable queue processor**, choose `worker` and tie the decision to Generic Host
123 lifecycle, dependency injection, configuration, logging, graceful shutdown, and a real
124 durable queue rather than an in-memory loop.
125
126## Validation
127
128- [ ] Every template requested was inspected via `dotnet new <template> --help`
129- [ ] The comparison covers parameters, feature support, frameworks, and classifications
130- [ ] Differences relevant to the user's scenario are called out explicitly
131- [ ] A recommendation (or clear trade-off) is provided
132- [ ] Unsupported or absent options are labeled instead of guessed
133- [ ] The final recommendation is a single decisive `Recommendation:` line
134
135## Common Pitfalls
136
137| Pitfall | Solution |
138|---------|----------|
139| Comparing uninstalled templates from memory | Install and inspect each template so the comparison reflects the real parameters and choices. |
140| Assuming feature parity | Parameter names and feature support vary by template — confirm each with `--help`. |
141| Comparing fundamentally different template types | Only compare templates that solve overlapping problems; note when they target different scenarios. |
142
143## More Info
144
145- [dotnet new templates](https://learn.microsoft.com/dotnet/core/tools/dotnet-new-sdk-templates) — built-in template reference
146- [dotnet new](https://learn.microsoft.com/dotnet/core/tools/dotnet-new) — CLI reference