template-discovery
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-instantiationskill - User wants to author or validate a custom template — route to
template-authoringskill - User is troubleshooting build issues — route to
dotnet-msbuildplugin
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
Step 1: Resolve intent to template candidates
Map the user's natural-language description to template short names using these common keyword mappings:
| User Intent | Template | Suggested Parameters |
|---|---|---|
| web API, REST API | webapi |
--auth Individual --use-controllers if auth requested |
| web app, website | webapp |
|
| Blazor, interactive web | blazor |
|
| console app, CLI tool | console |
|
| class library, shared code | classlib |
|
| worker service, background job | worker |
|
| gRPC service | grpc |
|
| MAUI app, mobile app | maui |
|
| test project, unit tests | xunit, mstest, or nunit |
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
Step 5: Present findings
Summarize the best template match with:
- Template name and short description
- Key parameters and recommended values
- What the user should expect (files created, project structure)
- Any constraints or prerequisites
Validation
- At least one template match was found for the user's intent
- Template parameters are explained with types and defaults
- User understands what the template produces before proceeding to creation
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. |
More Info
- dotnet new templates — built-in template reference
- Template Engine Wiki — template engine internals
More from managedcode/dotnet-skills
dotnet
Primary router skill for broad .NET work. Classify the repo by app model and cross-cutting concern first, then switch to the narrowest matching .NET skill instead of staying at a generic layer.
18dotnet-aspnet-core
Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging, and deployment patterns on current .NET.
13dotnet-entity-framework-core
Design, tune, or review EF Core data access with proper modeling, migrations, query translation, performance, and lifetime management for modern .NET applications.
12dotnet-code-review
Review .NET changes for bugs, regressions, architectural drift, missing tests, incorrect async or disposal behavior, and platform-specific pitfalls before you approve or merge them.
11dotnet-architecture
Design or review .NET solution architecture across modular monoliths, clean architecture, vertical slices, microservices, DDD, CQRS, and cloud-native boundaries without over-engineering.
11dotnet-signalr
Implement or review SignalR hubs, streaming, reconnection, transport, and real-time delivery patterns in ASP.NET Core applications.
10