मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग5.8k · #14615

template-smart-defaults

यह क्या करती है

यह स्किल template से .NET project बनाते समय संबंधित विकल्पों को भरती है, ताकि चुनाव आपस में मेल खाएँ। यह उन लोगों के लिए है जो कुछ विकल्प खाली छोड़ते हैं और बाकी के लिए समझदार, सुसंगत मान चाहते हैं।

कब इस्तेमाल करें

  • ✓जब आप .NET project बनाएँ और संबंधित विकल्प खाली छोड़ें, जैसे authentication चालू होने पर HTTPS।
  • ✓जब आप कोई ऐसा विकल्प चुनें, जैसे native AOT, जो मेल खाता framework या सेटिंग सुझाए।
  • ✓जब दो template विकल्प टकराएँ, जैसे controllers और minimal API, और एक ही चुना जा सके।

Skill का लिंक

https://github.com/dotnet/skills/blob/main/plugins/dotnet-template-engine/skills/template-smart-defaults/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/dotnet/skills/blob/main/plugins/dotnet-template-engine/skills/template-smart-defaults/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“login और native AOT के साथ नया .NET web API बनाइए। बाकी सेटिंग्स ऐसी भरिए कि वे एक साथ काम करें।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट अपने डिफ़ॉल्ट नियम सिर्फ़ उन विकल्पों पर लगाता है जो आपने सेट नहीं किए, और आपके स्पष्ट रूप से चुने हर मान को बनाए रखता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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-discovery or template-comparison
  • User wants to author or validate a custom template — route to template-authoring or template-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

  1. Gather the parameters the user has explicitly set.
  2. Apply each rule below only where the corresponding parameter is unset — never override a value the user set explicitly.
  3. Confirm the chosen parameter names and choices against dotnet new <template> --help whenever 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.
  4. 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. --aot is a dotnet new flag only on the templates that expose it — always confirm with dotnet new <template> --help rather than assuming a given template does or doesn't offer it. There is no --publish-aot template flag — publish-time native AOT is enabled with the MSBuild property PublishAot=true (via dotnet publish or in the .csproj), not through dotnet 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
अक्सर पूछे जाने वाले सवाल

क्या यह मेरी पसंद बदल देगी?

नहीं। नियम सिर्फ़ खाली जगहें भरते हैं, और आपका सेट किया हुआ हर मान वैसा ही रहता है।

क्या यह अपने चुनाव समझा सकती है?

हाँ। यह बता सकती है कि हर संबंधित विकल्प के लिए डिफ़ॉल्ट क्यों चुना गया।

क्या यह project बनाती है?

नहीं। project बनाना template instantiation स्किल कवर करती है।

जानकारी

लेखक का मूल विवरण

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

लोकप्रियता

GitHub स्टार
5.8k
रैंकिंग में स्थान
#14615
लाइसेंस
MIT
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills