Loading...
Loading...
Applies cross-parameter default rules when creating .NET projects with dotnet new, filling gaps consistently without overriding values the user set explicitly. USE FOR: choosing which target framework to pair with native AOT, deciding whether to keep HTTPS when authentication is enabled, recognizing that controllers and minimal-API flags are mutually exclusive, filling unset related parameters during project creation, explaining why a default was applied and ensuring an explicit user value is never overridden. DO NOT USE FOR: creating the project itself (use template-instantiation), finding or comparing templates (use template-discovery and template-comparison), authoring or validating custom templates (use template-authoring and template-validation).
npx skill4agent add dotnet/skills template-smart-defaultsdotnet newtemplate-instantiationtemplate-discoverytemplate-comparisontemplate-authoringtemplate-validation| Input | Required | Description |
|---|---|---|
| Template short name | Yes | The template the project will be created from (e.g., |
| Parameters already chosen | Yes | The parameter values the user has explicitly set |
| Available choices | Recommended | Parameter names/choices from |
dotnet new <template> --help--helpSource = userSource = rule| Parameter | Value | Source | Why |
|---|---|---|---|
| | rule | Native AOT (from |
| | user | Explicitly requested — left unchanged |
Source = userSource = ruledotnet new--no-httpsAOT at create time vs publish time.is a--aotflag only on the templates that expose it — always confirm withdotnet newrather than assuming a given template does or doesn't offer it. There is nodotnet new <template> --helptemplate flag — publish-time native AOT is enabled with the MSBuild property--publish-aot(viaPublishAot=trueor in thedotnet publish), not through.csproj. Apply the framework rule only when the template actually offersdotnet new.--aot
| Rule | Default applied | Rationale |
|---|---|---|
| Set | Native AOT requires a recent, AOT-capable target framework; using the latest avoids build failures. (A framework already pinned by the workspace or |
| Do NOT pass | Authentication flows (cookies, tokens, redirects) require HTTPS; disabling it breaks auth. |
| Do NOT also pass a minimal-API flag | Controllers and minimal APIs are mutually exclusive program models; passing both is contradictory. |
| User set a value explicitly | Leave it unchanged | Smart defaults only fill gaps; explicit user intent always wins. |
dotnet newdotnet new <template> --help| Pitfall | Solution |
|---|---|
| Treating heuristics as enforcement | These are guidance rules, not validation. Always confirm against |
| Overriding an explicit user value | Apply a rule only when the target parameter is unset. |
| Assuming a flag name | The exact flag differs per template — always verify with |
| Picking a framework the template doesn't support | Use the latest framework that appears in the template's |