template-smart-defaults
Fungsinya
Skill ini mengisi opsi terkait saat membuat proyek .NET dari template, sehingga pilihannya saling cocok. Skill ini untuk orang yang membiarkan beberapa opsi kosong dan menginginkan nilai yang masuk akal dan konsisten untuk sisanya.
Kapan dipakai
- βSaat Anda membuat proyek .NET dan membiarkan opsi terkait belum diatur, misalnya HTTPS saat autentikasi aktif.
- βSaat Anda memilih opsi, misalnya native AOT, yang menyarankan framework atau pengaturan yang cocok.
- βSaat dua opsi template bertentangan, misalnya controllers dan minimal API, dan hanya satu yang bisa dipilih.
Link skill
https://github.com/dotnet/skills/blob/main/plugins/dotnet-template-engine/skills/template-smart-defaults/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBuat web API .NET baru dengan login dan native AOT. Isi pengaturan lain agar semuanya bekerja bersama.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent hanya menerapkan aturan default pada opsi yang belum Anda atur, dan mempertahankan setiap nilai yang Anda pilih secara eksplisit.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Template Smart Defaults
This skill helps an agent fill in cross-parameter defaults when creating a dotnet new
project. The rules below are guidance heuristics that keep related parameters consistent β
they only fill gaps and never override a value the user set explicitly.
When to Use
- The user asks to create a project but leaves related parameters unspecified
- A parameter the user chose implies a sensible value for another parameter
- You need to explain why a particular default was selected
When Not to Use
- User wants to actually create the project β route to
template-instantiation - User wants to find or compare templates β route to
template-discoveryortemplate-comparison - User wants to author or validate a custom template β route to
template-authoringortemplate-validation
Inputs
| Input | Required | Description |
|---|---|---|
| Template short name | Yes | The template the project will be created from (e.g., webapi) |
| Parameters already chosen | Yes | The parameter values the user has explicitly set |
| Available choices | Recommended | Parameter names/choices from dotnet new <template> --help |
Workflow
- Gather the parameters the user has explicitly set.
- Apply each rule below only where the corresponding parameter is unset β never override a value the user set explicitly.
- Confirm the chosen parameter names and choices against
dotnet new <template> --helpwhenever the user asks for an exact command. This inspection does not create files and is worthwhile even for advice-only requests. Skip it only for a conceptual explanation that does not claim exact option names. - Emit the two required outputs (see below) β this is what makes the skill decisive rather than inert.
For advice-only prompts that say "don't create files", make the displayed command safe to run
by appending --dry-run. If a scenario needs a named example and the user omitted the name,
choose a short descriptive sample name and mark it Source = rule. Do not add a name when the
user asked for a command containing only explicitly requested choices or when the template can
demonstrate those choices safely without one.
Required output
Always produce both, in this order:
A. A "Defaults applied" log β one row per parameter, covering both the explicit values you preserved (Source = user) and the gaps you filled by rule (Source = rule), so the user can see and override every choice:
| Parameter | Value | Source | Why |
|---|---|---|---|
--framework |
net10.0 |
rule | Native AOT (from --aot) needs the latest AOT-capable TFM |
--auth |
Individual |
user | Explicitly requested β left unchanged |
--name |
AotWorker |
rule | Added a descriptive sample name for this named example |
Use Source = user for explicit values (never overridden) and Source = rule for gap-fills.
B. The exact single dotnet new command line you would run β include only the flags you are actually passing. Do not list flags you decided not to pass (e.g. don't mention --no-https when you are keeping HTTPS; don't mention a minimal-API flag when using controllers). Silence on an omitted flag is the correct, decisive signal.
Always emit a flag the user explicitly requested when the observed template help exposes it,
even when its value matches the template default; this keeps intent visible and reproducible
(for example, --auth None). Omit only inferred defaults that you are not actually
passing. Boolean switches such as --no-https are passed without true.
AOT at create time vs publish time.
--aotis adotnet newflag only on the templates that expose it β always confirm withdotnet new <template> --helprather than assuming a given template does or doesn't offer it. There is no--publish-aottemplate flag β publish-time native AOT is enabled with the MSBuild propertyPublishAot=true(viadotnet publishor in the.csproj), not throughdotnet new. Apply the framework rule only when the template actually offers--aot.
Rules
| Rule | Default applied | Rationale |
|---|---|---|
--aot is set (on any template whose --help exposes it) and --framework is unset |
Set --framework to the latest AOT-compatible framework the template offers |
Native AOT requires a recent, AOT-capable target framework; using the latest avoids build failures. (A framework |
Pertanyaan umum
Apakah skill ini akan menimpa pilihan saya?
Tidak. Aturan hanya mengisi celah, dan nilai yang Anda atur secara eksplisit tetap dipertahankan.
Apakah skill ini bisa menjelaskan pilihannya?
Ya. Skill bisa menjelaskan mengapa default dipilih untuk setiap opsi terkait.
Apakah skill ini membuat proyek?
Tidak. Pembuatan proyek dicakup oleh skill instansiasi template.
Detail
Deskripsi asli dari pembuat
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
repo: dotnet/skills
Popularitas
- Bintang GitHub
- 5.8k
- Peringkat
- #14615
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
create-custom-agent
5.8kMembantu agent Anda membuat file agen kustom VS Code dengan alatnya sendiri, instruksi, dan serah terima ke agent lain.
create-skill
5.8kMembantu agent Anda membuat skill agent baru dengan nama yang valid, deskripsi pemicu yang jelas, dan file SKILL.md yang mengikuti standar.
csharp-scripts
5.8kMembantu agent Anda menjalankan program C# kecil sebagai satu file dengan alat baris perintah .NET, tanpa membuat proyek lengkap.
dotnet-pinvoke
5.8kMembantu agent Anda memanggil pustaka native C atau C++ dari .NET dengan benar, mencakup tanda tangan, penanganan string, memori, dan safe handle.
Skill serupa
diffs
394kMemungkinkan agent Anda menghasilkan diff perubahan yang nyata dan dapat dibagikan sebagai tautan viewer atau file gambar, bukan ringkasan yang ditulis manual.
coding-agent
394kMembantu agent Anda menyerahkan pekerjaan pemrograman besar ke Codex, Claude Code, atau OpenCode di latar belakang, lalu memeriksa kemajuannya.
gh-issues
394kMembantu agent Anda menemukan issue GitHub, memilih yang dikerjakan, dan membuka pull request perbaikan, termasuk tindak lanjut komentar tinjauan.