template-smart-defaults

Applies cross-parameter default rules when creating .NET projects with dotnet new.

5.3k|403|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/dotnet/skills --skill template-smart-defaults
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: template-smart-defaults
Source: https://github.com/dotnet/skills/tree/main/plugins/dotnet-template-engine/skills/template-smart-defaults
Command: npx skills add https://github.com/dotnet/skills --skill template-smart-defaults

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When creating .NET projects with dotnet new, related template parameters often interact in non-obvious ways — native AOT needs a compatible target framework, authentication requires HTTPS, and controllers conflict with minimal APIs. This Skill fills unset parameters with consistent defaults while never overriding values the user explicitly chose.

Core Features & Use Cases

  • Cross-parameter default rules: Pairs --aot with the latest AOT-capable framework, keeps HTTPS when --auth is set, and prevents contradictory controller/minimal-API flag combinations.
  • Transparent decision log: Emits a "Defaults applied" table marking each value as Source = user or Source = rule, plus the exact single dotnet new command containing only flags actually passed.
  • Safe advice-only mode: Appends --dry-run to displayed commands when the user asks for guidance without creating files, and verifies flag names against dotnet new <template> --help.
  • Use Case: A user asks to create an AOT-enabled web API with individual authentication but no framework specified. The Skill selects the latest AOT-compatible TFM, keeps HTTPS, preserves the explicit --auth Individual, and outputs the exact command with a full audit log.

Quick Start

Ask the agent to create a native AOT web API project with individual authentication and let it fill in the remaining dotnet new parameters with sensible defaults.

Frequently Asked Questions about template-smart-defaults

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose default parameters for dotnet new templates?

Apply cross-parameter rules only to unset options: pair --aot with the latest AOT-capable framework, keep HTTPS when --auth is set, and never combine controllers with minimal APIs. Always confirm exact flag names with dotnet new <template> --help.

What target framework should I use with dotnet new native AOT?

Select the latest AOT-compatible framework listed in the template's --framework choices, since native AOT requires a recent AOT-capable TFM. A framework already pinned by the workspace or global.json counts as set and should be kept unless incompatible.

Does dotnet new have a --publish-aot flag?

No, there is no --publish-aot template flag. Publish-time native AOT is enabled with the MSBuild property PublishAot=true via dotnet publish or the .csproj file, while --aot exists only on templates whose --help exposes it.

Can I use controllers and minimal APIs together in dotnet new?

No, controllers and minimal APIs are mutually exclusive program models. When --use-controllers is set, do not pass a minimal-API flag, and verify the exact controller option name against the template's --help output.

How do I show a dotnet new command without creating files?

Append --dry-run to the displayed command so it is safe to execute without writing files. This honors advice-only requests where the user explicitly asks not to create anything.