Template Discovery
This skill helps an agent find, inspect, and select the right dotnet new template for a given task using dotnet new CLI commands for search, listing, and parameter inspection.
When to Use
- User asks "What templates are available for X?"
- User describes a project in natural language ("I need a web API with authentication")
- User wants to compare templates or understand parameters before creating a project
- User needs to know what a template produces (files, structure) before committing
When Not to Use
- User wants to create a project — route to
template-instantiation skill
- User wants to author or validate a custom template — route to
template-authoring skill
- User wants a detailed side-by-side comparison of templates — route to
template-comparison skill
- User wants smart cross-parameter defaults during creation — route to
template-smart-defaults skill
- User is troubleshooting build issues — route to
dotnet-msbuild plugin
Answer first, confirm second — required, in this order. The Step 1 intent → template
and keyword → parameter mappings are a complete answer on their own. Your first action is
to write a concrete template + parameter recommendation (with a ready-to-run dotnet new
command) from the mapping, before you run any dotnet new command. Only then use the CLI
to confirm exact names/choices and update the answer. Never make a dotnet new call your
final action — the engine's global mutex can make it fail with an empty "persistence"/"mutex"
result under load, leaving the user nothing. Always close with the written recommendation, and
never end a turn on a "let me confirm from the CLI…" teaser.
Inputs
| Input |
Required |
Description |
| User intent or keywords |
Yes |
Natural-language description or keywords (e.g., "web API", "console app", "MAUI") |
| Language preference |
No |
C#, F#, or VB — defaults to C# |
| Framework preference |
No |
Target framework (e.g., net10.0, net9.0) |
Workflow
Do Step 1 and write the recommendation to the user before running Step 2–4 commands.
Steps 2–4 only confirm the answer; a dotnet new failure must never leave the turn empty.
Step 1: Resolve intent to template candidates
Map the user's natural-language description to template short names and parameters using these mappings.
Intent → template short name(s):
| Intent / phrase |
Template short name(s) |
| web api, web service, rest api, restful, api, minimal api |
webapi |
| web app, web application |
webapp, blazorserver |
| mvc |
mvc |
| razor, razor pages |
webapp |
| blazor, blazor web app |
blazor |
| blazor server |
blazorserver |
| blazor wasm, blazor webassembly |
blazorwasm |
| grpc |
grpc |
| signalr |
webapi, webapp |
| console, console app, command line, cli |
console |
| worker, background service, daemon, windows service |
worker |
| class library, library, lib, nuget package |
classlib |
| maui, mobile, cross-platform app, ios, android |
maui |
| desktop |
maui, wpf, winforms |
| wpf |
wpf |
| winforms, windows forms |
winforms |
| winui, winui3 |
winui3 |
| test, unit test |
xunit, nunit, mstest |
| xunit / nunit / mstest |
xunit / nunit / mstest |
| solution |
sln |
| aspire, .net aspire |
aspire-starter, aspire |
| azure functions, function app, serverless |
func |
| orleans |
orleans |
| razor component, web component |
razorcomponent |
| razor class library |
razorclasslib |
| gitignore / editorconfig / nuget config / global json |
gitignore / editorconfig / nugetconfig / globaljson |
Keyword → parameter:
| Keyword / phrase |
Parameter |
Value |
| authentication, auth, individual auth, individual accounts |
--auth |
Individual |
| windows auth |
--auth |
Windows |
| azure ad, entra id |
--auth |
SingleOrg |
| no auth, no authentication |
--auth |
None |
| controllers, with controllers |
--use-controllers |
(flag) |
| minimal api |
(default) |
— |
| aot, native aot |
--aot |
(flag) |
| docker, container |
the template's Docker/container option |
varies by template — confirm with --help (not all templates expose one) |
| net8 / .net 8 / dotnet 8 |
--framework |
net8.0 |
| net9 / .net 9 / dotnet 9 |
--framework |
net9.0 |
| net10 / .net 10 / dotnet 10 |
--framework |
net10.0 |
These are starting guesses. Always confirm the real parameter names/choices with dotnet new <template> --help, because parameter names vary by template (e.g., --auth vs --Authentication).
Some mapped short names are not present in a default SDK install — templates like maui, winui3, aspire-starter/aspire, func, and orleans typically require a workload (dotnet workload install <id>) and/or an additional template package (dotnet new install <package>). If a mapped short name does not appear in dotnet new list, fall back to dotnet new list/dotnet new search to find the right template and the package/workload that provides it before recommending it.
Resilience — always answer, even if the CLI fails. The intent mapping above is a usable answer on its own. Run dotnet new commands sequentially, one at a time — the template engine uses a global mutex, so firing several dotnet new <template> --help/--dry-run calls concurrently can produce a transient "mutex"/"persistence" error and empty output. If a command fails, retry it once; if it still fails, fall back to this intent/parameter mapping and give the user a concrete recommendation, noting that the exact parameter names/choices could not be CLI-confirmed. Never end the turn with no answer because a CLI call errored.
Step 2: Search for templates
Use dotnet new search to find templates by keyword across both locally installed templates and NuGet.org:
dotnet new search blazor
Use dotnet new list to show only installed templates, with optional filters:
dotnet new list --language C# --type project
dotnet new list web
Step 3: Inspect template details
Use dotnet new <template> --help to get full parameter details for a specific template — parameter names, types, defaults, and allowed values:
dotnet new webapi --help
Step 4: Preview output
Use dotnet new <template> --dry-run to show what files and directories a template would create without writing anything to disk:
dotnet new webapi --name MyApi --auth Individual --dry-run
If the dry-run fails (transient "mutex"/"persistence" error), retry once; if it still fails, give a representative structure (template family and typical file kinds) and note it isn't CLI-confirmed. Do not invent specific values, choices, or file paths. When the dry-run succeeds, present the actual file list from its output faithfully — don't summarize, regroup, or invent files — and add a one-line purpose for the key entry points (e.g. Program.cs, App.razor).
Step 5: Present findings
Lead with the answer as a ready-to-run command, then justify it. Required shape:
Use <template> — one-line why.
dotnet new <template> --name <Name> [--key params]
Then add supporting detail:
- Key parameters and recommended values (with the choices, e.g.
--auth: None | Individual | SingleOrg | Windows)
- What to expect (files created, project structure)
- Any prerequisites — name the exact package to install (
dotnet new install <id>), or say "no install needed — ships with the SDK" for a built-in template
An answer without a concrete, copy-pasteable command is what makes this skill tie with a plain reply — always give the command to run next.
Validation
Common Pitfalls
| Pitfall |
Solution |
| Not searching NuGet for templates |
If dotnet new list shows no matches, use dotnet new search <keyword> to find installable templates on NuGet.org. |
| Not checking template constraints |
Some templates require specific SDKs or workloads. Use dotnet new <template> --help to surface constraints before recommending. |
| Recommending a template without previewing output |
Always use dotnet new <template> --dry-run to confirm the template produces what the user expects. |
A dotnet new call fails with a "mutex"/"persistence" error and you return nothing |
These are transient (often from concurrent invocations). Run dotnet new calls sequentially, retry once, then fall back to the Step 1 intent mapping and still give the user a concrete answer. |
More Info
1---2name: template-discovery3description: >4 Helps find, inspect, and compare (at a high level) .NET project templates.5 Resolves natural-language project descriptions to ranked template matches6 with pre-filled parameters.7 USE FOR: finding the right dotnet new template for a task, inspecting a template's8 parameters and constraints, understanding what a template9 produces before creating a project, resolving intent like "web API with auth" to10 concrete template + parameters.11 DO NOT USE FOR: actually creating projects (use template-instantiation), authoring12 custom templates (use template-authoring), producing a detailed side-by-side comparison13 (use template-comparison), choosing cross-parameter defaults during creation14 (use template-smart-defaults), MSBuild or build issues (use dotnet-msbuild plugin),15 NuGet package management unrelated to template packages.16license: MIT17metadata:18 source: https://skillmd.com/skills/stanfish06/template-discovery19---2021# Template Discovery2223This skill helps an agent find, inspect, and select the right `dotnet new` template for a given task using `dotnet new` CLI commands for search, listing, and parameter inspection.2425## When to Use2627- User asks "What templates are available for X?"28- User describes a project in natural language ("I need a web API with authentication")29- User wants to compare templates or understand parameters before creating a project30- User needs to know what a template produces (files, structure) before committing3132## When Not to Use3334- User wants to create a project — route to `template-instantiation` skill35- User wants to author or validate a custom template — route to `template-authoring` skill36- User wants a detailed side-by-side comparison of templates — route to `template-comparison` skill37- User wants smart cross-parameter defaults during creation — route to `template-smart-defaults` skill38- User is troubleshooting build issues — route to `dotnet-msbuild` plugin3940> **Answer first, confirm second — required, in this order.** The Step 1 intent → template41> and keyword → parameter mappings are a complete answer on their own. **Your first action is42> to write** a concrete template + parameter recommendation (with a ready-to-run `dotnet new`43> command) from the mapping, **before you run any `dotnet new` command**. Only then use the CLI44> to *confirm* exact names/choices and update the answer. **Never make a `dotnet new` call your45> final action** — the engine's global mutex can make it fail with an empty "persistence"/"mutex"46> result under load, leaving the user nothing. Always close with the written recommendation, and47> never end a turn on a "let me confirm from the CLI…" teaser.4849## Inputs5051| Input | Required | Description |52|-------|----------|-------------|53| User intent or keywords | Yes | Natural-language description or keywords (e.g., "web API", "console app", "MAUI") |54| Language preference | No | C#, F#, or VB — defaults to C# |55| Framework preference | No | Target framework (e.g., net10.0, net9.0) |5657## Workflow5859> **Do Step 1 and write the recommendation to the user before running Step 2–4 commands.**60> Steps 2–4 only *confirm* the answer; a `dotnet new` failure must never leave the turn empty.6162### Step 1: Resolve intent to template candidates6364Map the user's natural-language description to template short names and parameters using these mappings.6566**Intent → template short name(s):**6768| Intent / phrase | Template short name(s) |69|---|---|70| web api, web service, rest api, restful, api, minimal api | `webapi` |71| web app, web application | `webapp`, `blazorserver` |72| mvc | `mvc` |73| razor, razor pages | `webapp` |74| blazor, blazor web app | `blazor` |75| blazor server | `blazorserver` |76| blazor wasm, blazor webassembly | `blazorwasm` |77| grpc | `grpc` |78| signalr | `webapi`, `webapp` |79| console, console app, command line, cli | `console` |80| worker, background service, daemon, windows service | `worker` |81| class library, library, lib, nuget package | `classlib` |82| maui, mobile, cross-platform app, ios, android | `maui` |83| desktop | `maui`, `wpf`, `winforms` |84| wpf | `wpf` |85| winforms, windows forms | `winforms` |86| winui, winui3 | `winui3` |87| test, unit test | `xunit`, `nunit`, `mstest` |88| xunit / nunit / mstest | `xunit` / `nunit` / `mstest` |89| solution | `sln` |90| aspire, .net aspire | `aspire-starter`, `aspire` |91| azure functions, function app, serverless | `func` |92| orleans | `orleans` |93| razor component, web component | `razorcomponent` |94| razor class library | `razorclasslib` |95| gitignore / editorconfig / nuget config / global json | `gitignore` / `editorconfig` / `nugetconfig` / `globaljson` |9697**Keyword → parameter:**9899| Keyword / phrase | Parameter | Value |100|---|---|---|101| authentication, auth, individual auth, individual accounts | `--auth` | `Individual` |102| windows auth | `--auth` | `Windows` |103| azure ad, entra id | `--auth` | `SingleOrg` |104| no auth, no authentication | `--auth` | `None` |105| controllers, with controllers | `--use-controllers` | (flag) |106| minimal api | (default) | — |107| aot, native aot | `--aot` | (flag) |108| docker, container | the template's Docker/container option | varies by template — confirm with `--help` (not all templates expose one) |109| net8 / .net 8 / dotnet 8 | `--framework` | `net8.0` |110| net9 / .net 9 / dotnet 9 | `--framework` | `net9.0` |111| net10 / .net 10 / dotnet 10 | `--framework` | `net10.0` |112113These are starting guesses. Always confirm the real parameter names/choices with `dotnet new <template> --help`, because parameter names vary by template (e.g., `--auth` vs `--Authentication`).114115Some mapped short names are not present in a default SDK install — templates like `maui`, `winui3`, `aspire-starter`/`aspire`, `func`, and `orleans` typically require a workload (`dotnet workload install <id>`) and/or an additional template package (`dotnet new install <package>`). If a mapped short name does not appear in `dotnet new list`, fall back to `dotnet new list`/`dotnet new search` to find the right template and the package/workload that provides it before recommending it.116117> **Resilience — always answer, even if the CLI fails.** The intent mapping above is a usable answer on its own. Run `dotnet new` commands **sequentially, one at a time** — the template engine uses a global mutex, so firing several `dotnet new <template> --help`/`--dry-run` calls concurrently can produce a transient "mutex"/"persistence" error and empty output. If a command fails, retry it once; if it still fails, **fall back to this intent/parameter mapping and give the user a concrete recommendation**, noting that the exact parameter names/choices could not be CLI-confirmed. Never end the turn with no answer because a CLI call errored.118119### Step 2: Search for templates120121Use `dotnet new search` to find templates by keyword across both locally installed templates and NuGet.org:122123```bash124dotnet new search blazor125```126127Use `dotnet new list` to show only installed templates, with optional filters:128129```bash130dotnet new list --language C# --type project131dotnet new list web132```133134### Step 3: Inspect template details135136Use `dotnet new <template> --help` to get full parameter details for a specific template — parameter names, types, defaults, and allowed values:137138```bash139dotnet new webapi --help140```141142### Step 4: Preview output143144Use `dotnet new <template> --dry-run` to show what files and directories a template would create without writing anything to disk:145146```bash147dotnet new webapi --name MyApi --auth Individual --dry-run148```149150If the dry-run fails (transient "mutex"/"persistence" error), retry once; if it still fails, give a **representative** structure (template *family* and typical file kinds) and note it isn't CLI-confirmed. Do not invent specific values, choices, or file paths. When the dry-run **succeeds**, present the actual file list from its output faithfully — don't summarize, regroup, or invent files — and add a one-line purpose for the key entry points (e.g. `Program.cs`, `App.razor`).151152### Step 5: Present findings153154**Lead with the answer as a ready-to-run command**, then justify it. Required shape:155156> **Use `<template>`** — one-line why.157> ```bash158> dotnet new <template> --name <Name> [--key params]159> ```160161Then add supporting detail:162- Key parameters and recommended values (with the choices, e.g. `--auth`: None | Individual | SingleOrg | Windows)163- What to expect (files created, project structure)164- Any prerequisites — name the **exact package to install** (`dotnet new install <id>`), or say **"no install needed — ships with the SDK"** for a built-in template165166An answer without a concrete, copy-pasteable command is what makes this skill tie with a plain reply — always give the command to run next.167168## Validation169170- [ ] At least one template match was found for the user's intent171- [ ] Template parameters are explained with types and defaults172- [ ] User understands what the template produces before proceeding to creation173174## Common Pitfalls175176| Pitfall | Solution |177|---------|----------|178| Not searching NuGet for templates | If `dotnet new list` shows no matches, use `dotnet new search <keyword>` to find installable templates on NuGet.org. |179| Not checking template constraints | Some templates require specific SDKs or workloads. Use `dotnet new <template> --help` to surface constraints before recommending. |180| Recommending a template without previewing output | Always use `dotnet new <template> --dry-run` to confirm the template produces what the user expects. |181| A `dotnet new` call fails with a "mutex"/"persistence" error and you return nothing | These are transient (often from concurrent invocations). Run `dotnet new` calls sequentially, retry once, then fall back to the Step 1 intent mapping and still give the user a concrete answer. |182183## More Info184185- [dotnet new templates](https://learn.microsoft.com/dotnet/core/tools/dotnet-new-sdk-templates) — built-in template reference186- [Template Engine Wiki](https://github.com/dotnet/templating/wiki) — template engine internals