Template Discovery
When to Use
Invoke this skill when:
- User wants to create a new .NET project, library, test, or solution
- User asks "what templates are available for X?"
- User needs to find the right template for a specific scenario (e.g., "MAUI app", "Blazor WASM", "worker service")
- User wants to compare template options before choosing
Step 0: Try Intent Resolution First
For natural-language requests like "I need a web API with auth and controllers", start with template_from_intent:
template_from_intent with description: "web API with auth and controllers"
→ Returns: { template: "webapi", confidence: 0.85, params: { auth: "Individual", UseControllers: "true" } }
This uses 70+ keyword mappings to resolve intent offline (no LLM round-trip). If confidence is high (>0.7), proceed directly to template-instantiation. If low or ambiguous, fall through to Step 1.
Step 1: Search for Templates
Use template_search to find templates matching the user's intent. The tool searches both local installed templates and NuGet.org, returning ranked results.
template_search with query: "blazor"
template_search with query: "worker service"
template_search with query: "class library"
Results include: template name, short name, language, type, author, NuGet package (if remote), and relevance ranking.
Search Tips
- Use descriptive terms: "web api", "console app", "test project"
- Search by technology: "maui", "blazor", "grpc", "minimal api"
- Search by project type: "classlib", "webapp", "worker"
Step 2: List Installed Templates
Use template_list to see what's already available locally:
template_list # All installed
template_list with language: "C#" # C# only
template_list with type: "project" # Projects only
template_list with classification: "Web" # Web templates
Step 3: Inspect Template Details
Before instantiation, always inspect the template to understand its parameters:
template_inspect with identity: "Microsoft.DotNet.Web.ProjectTemplates.9.0.blazorserver"
Returns:
- Parameters: name, type, default value, choices (for choice params), description
- Constraints: OS, SDK version, workload requirements
- Post-actions: what happens after creation (restore, open file, run script)
- Framework versions: supported TFMs
Parameter Types
| Type |
Examples |
Notes |
choice |
--framework net8.0|net9.0|net10.0 |
Must be one of the listed values |
bool |
--use-program-main true|false |
Toggle features on/off |
string |
--namespace MyApp |
Free-form text |
integer |
--port 5000 |
Numeric values |
Step 4: Preview with Dry Run
Use template_dry_run to see exactly what files would be created:
template_dry_run with:
shortName: "webapi"
name: "MyApi"
output: "./src/MyApi"
parameters: { "framework": "net10.0", "use-controllers": "true" }
Returns file list, directory structure, and any warnings — without writing anything to disk.
Smart Behaviors
The template-engine-mcp server includes smart behaviors:
- Auto-resolve: If a template isn't installed, the server searches NuGet, installs the package, and proceeds
- Parameter validation: Invalid choice values or types are caught with "did you mean...?" suggestions
- Constraint checking: OS, SDK version, and workload constraints are verified before creation
- Smart defaults: Parameter relationships are suggested (e.g.,
EnableAot=true → suggest net9.0+)
Common Template Quick-Reference
| Scenario |
Short Name |
Key Parameters |
| Console app |
console |
--framework, --use-program-main |
| Class library |
classlib |
--framework |
| Web API |
webapi |
--framework, --use-controllers, --auth |
| Blazor Server |
blazorserver |
--framework, --auth |
| Worker Service |
worker |
--framework |
| xUnit tests |
xunit |
--framework |
| MSTest tests |
mstest |
--framework |
| NUnit tests |
nunit |
--framework |
| MAUI app |
maui |
--framework |
| gRPC service |
grpc |
--framework |
1---2name: template-discovery3description: Skill for finding, inspecting, and selecting the right .NET template for a task. Use when a user asks to create a new project, library, test project, or solution, and the right template needs to be identified. Covers searching NuGet.org and local caches, inspecting template parameters and constraints, and comparing template alternatives. DO NOT use for MSBuild build issues, NuGet restore problems, or non-template .NET tasks.4---56# Template Discovery78## When to Use910Invoke this skill when:11- User wants to create a new .NET project, library, test, or solution12- User asks "what templates are available for X?"13- User needs to find the right template for a specific scenario (e.g., "MAUI app", "Blazor WASM", "worker service")14- User wants to compare template options before choosing1516## Step 0: Try Intent Resolution First1718For natural-language requests like *"I need a web API with auth and controllers"*, start with `template_from_intent`:1920```21template_from_intent with description: "web API with auth and controllers"22→ Returns: { template: "webapi", confidence: 0.85, params: { auth: "Individual", UseControllers: "true" } }23```2425This uses 70+ keyword mappings to resolve intent offline (no LLM round-trip). If confidence is high (>0.7), proceed directly to `template-instantiation`. If low or ambiguous, fall through to Step 1.2627## Step 1: Search for Templates2829Use `template_search` to find templates matching the user's intent. The tool searches both local installed templates and NuGet.org, returning ranked results.3031```32template_search with query: "blazor"33template_search with query: "worker service"34template_search with query: "class library"35```3637Results include: template name, short name, language, type, author, NuGet package (if remote), and relevance ranking.3839### Search Tips40- Use descriptive terms: "web api", "console app", "test project"41- Search by technology: "maui", "blazor", "grpc", "minimal api"42- Search by project type: "classlib", "webapp", "worker"4344## Step 2: List Installed Templates4546Use `template_list` to see what's already available locally:4748```49template_list # All installed50template_list with language: "C#" # C# only51template_list with type: "project" # Projects only52template_list with classification: "Web" # Web templates53```5455## Step 3: Inspect Template Details5657Before instantiation, always inspect the template to understand its parameters:5859```60template_inspect with identity: "Microsoft.DotNet.Web.ProjectTemplates.9.0.blazorserver"61```6263Returns:64- **Parameters**: name, type, default value, choices (for choice params), description65- **Constraints**: OS, SDK version, workload requirements66- **Post-actions**: what happens after creation (restore, open file, run script)67- **Framework versions**: supported TFMs6869### Parameter Types70| Type | Examples | Notes |71|------|----------|-------|72| `choice` | `--framework net8.0\|net9.0\|net10.0` | Must be one of the listed values |73| `bool` | `--use-program-main true\|false` | Toggle features on/off |74| `string` | `--namespace MyApp` | Free-form text |75| `integer` | `--port 5000` | Numeric values |7677## Step 4: Preview with Dry Run7879Use `template_dry_run` to see exactly what files would be created:8081```82template_dry_run with:83 shortName: "webapi"84 name: "MyApi"85 output: "./src/MyApi"86 parameters: { "framework": "net10.0", "use-controllers": "true" }87```8889Returns file list, directory structure, and any warnings — without writing anything to disk.9091## Smart Behaviors9293The template-engine-mcp server includes smart behaviors:94- **Auto-resolve**: If a template isn't installed, the server searches NuGet, installs the package, and proceeds95- **Parameter validation**: Invalid choice values or types are caught with "did you mean...?" suggestions96- **Constraint checking**: OS, SDK version, and workload constraints are verified before creation97- **Smart defaults**: Parameter relationships are suggested (e.g., `EnableAot=true` → suggest `net9.0+`)9899## Common Template Quick-Reference100101| Scenario | Short Name | Key Parameters |102|----------|-----------|----------------|103| Console app | `console` | `--framework`, `--use-program-main` |104| Class library | `classlib` | `--framework` |105| Web API | `webapi` | `--framework`, `--use-controllers`, `--auth` |106| Blazor Server | `blazorserver` | `--framework`, `--auth` |107| Worker Service | `worker` | `--framework` |108| xUnit tests | `xunit` | `--framework` |109| MSTest tests | `mstest` | `--framework` |110| NUnit tests | `nunit` | `--framework` |111| MAUI app | `maui` | `--framework` |112| gRPC service | `grpc` | `--framework` |