template-validation
Fungsinya
Skill ini memeriksa file template proyek .NET kustom terhadap kesalahan yang membuat template tidak berfungsi, seperti field yang hilang atau nama pendek yang bertabrakan. Skill ini untuk penulis template yang ingin menangkap masalah sebelum mempublikasikannya.
Kapan dipakai
- โSaat Anda sudah menulis file template.json dan ingin memeriksanya sebelum publikasi.
- โSaat template tidak muncul di dotnet new list setelah dipasang.
- โSaat Anda meninjau definisi parameter template sebelum membagikannya di NuGet.
Link skill
https://github.com/dotnet/skills/blob/main/plugins/dotnet-template-engine/skills/template-validation/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
โSaya menulis template.json untuk tim saya. Periksa kesalahannya sebelum saya mempublikasikannya ke NuGet.โ
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent mengurai file lebih dulu dan berhenti jika sintaksnya rusak, lalu memeriksa field, parameter, nama pendek, dan batasan terhadap aturan validasinya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Template Validation
This skill helps validate custom dotnet new templates for correctness before publishing. It encodes the validation rules that catch common authoring mistakes โ issues that cause templates to silently fail, produce broken projects, or not appear in dotnet new list.
When to Use
- User asks to check or validate a template.json file
- User reports "my template doesn't show up after installing"
- User wants to review a template before packaging and publishing to NuGet
- User encounters unexpected behavior from a custom template
When Not to Use
- User wants to find or use existing templates โ route to
template-discovery - User wants to create a project โ route to
template-instantiation - User wants to create a template from an existing project โ route to
template-authoring
Inputs
| Input | Required | Description |
|---|---|---|
| template.json path | Yes | Path to the template.json file or the template directory containing .template.config/template.json |
Validation Rules
When reviewing a template.json, check ALL of the following categories systematically. Report every finding as an error, warning, or suggestion.
Parse gate โ stop on syntax errors. Parse JSON before applying any semantic rule. If parsing fails, report the parser's line and column, show only the smallest concrete syntax correction, and stop. Do not invent required-field, symbol, post-action, or discoverability findings from a document that did not parse. Re-parse after the correction before making any semantic claim.
The malformed-JSON final response has exactly two parts: the one-line parse verdict and a corrected snippet showing the exact edit. Do not append semantic recommendations, optional metadata, or a full replacement manifest.
1. Required Fields
| Field | Severity | Rule |
|---|---|---|
identity |
ERROR | Must be present and non-empty |
name |
ERROR | Must be present and non-empty |
shortName |
ERROR | Must be present and non-empty |
sourceName |
WARNING | Without it, --name won't customize the generated project name |
author |
WARNING | Improves template discoverability |
description |
SUGGESTION | Helps users understand what the template creates |
classifications |
SUGGESTION | Improves search and categorization (e.g., ["Web", "API"]) |
defaultName |
SUGGESTION | Provides a fallback project name when --name is not specified |
2. Identity Format
- ERROR if identity contains spaces โ use dots or dashes (e.g.,
MyCompany.WebApi.CSharp) - WARNING if identity has no namespace separator (
.or-) โ use reverse-DNS format
3. ShortName Conflicts
A shortName that matches a dotnet new subcommand conflicts, because dotnet new <name> is then parsed as that subcommand instead of instantiating the template. Read the reserved set for the installed SDK from the Commands: section of dotnet new --help โ that is the authoritative source and avoids this rule going stale.
As of current SDKs the subcommands include (illustrative only โ version-dependent, do not hardcode this list; the live dotnet new --help output is canonical): install, uninstall, update, list, search, details, create. Note that top-level dotnet verbs like build, run, test, and publish do NOT conflict โ dotnet new test does not collide with dotnet test.
- ERROR if shortName matches any subcommand reported by
dotnet new --help(case-insensitive) - WARNING if shortName is only 1 character โ too short for discoverability
- Note: shortName can be a string or an array of strings; check all values
4. Symbol Validation
For each symbol in the symbols object:
- ERROR if a symbol is missing the
typefield - For
type: "parameter":- WARNING if no
datatypespecified (defaults tostring) - SUGGESTION if no
description(improves--helpoutput) - If
datatype: "choice":- ERROR if no
choicesdefined - ERROR if
choicesis empty - ERROR if
defaultValueis not in the choices list - WARNING if optional (not
isRequired) and nodefaultValueโ users get unexpected behavior
- ERROR if no
- If
datatype: "bool":- ERROR if
defaultValueis not a valid boolean
- ERROR if
- If
datatype: "int":- ERROR if
defaultValueis not a valid integer
- ERROR if
- Valid datatypes:
string,bool,choice,int,float,hex,text - ERROR if datatype is not in the valid list
- WARNING if no
- For
Pertanyaan umum
Apa yang dilaporkan agent?
Setiap temuan ditandai sebagai error, peringatan, atau saran, sehingga Anda tahu apa yang harus diperbaiki lebih dulu.
Apa yang terjadi jika JSON rusak?
Agent melaporkan baris dan kolom masalahnya, lalu menunjukkan perbaikan terkecil sebelum memeriksa hal lain.
Apakah skill ini membuat template?
Tidak. Skill ini memvalidasi file template yang sudah ada, dan pembuatan template dicakup oleh skill terpisah.
Detail
Deskripsi asli dari pembuat
Validates custom dotnet new templates for correctness before publishing. Catches missing fields, parameter bugs, shortName conflicts, constraint issues, and common authoring mistakes that cause templates to fail silently. USE FOR: checking template.json files for errors before publishing or testing, diagnosing why a template doesn't appear after installation, reviewing template parameter definitions for type mismatches and missing defaults, finding shortName conflicts with dotnet CLI commands, validating post-action and constraint configuration. DO NOT USE FOR: finding or using existing templa
repo: dotnet/skills
Popularitas
- Bintang GitHub
- 5.8k
- Peringkat
- #14616
- 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
openclaw-update
394kMembantu agent Anda memperbarui OpenClaw Gateway yang sudah ada, dengan memilih metode pembaruan yang sesuai cara pemasangannya dan menjaga sesi Anda tetap berjalan.
diagnose-gateway
394kMembantu agent Anda mencari tahu mengapa OpenClaw Gateway gagal dengan memeriksa pengaturan, channel, dan port tanpa mengubah apa pun.
crabbox-apps
394kMembantu agent Anda membuka dan menjalankan aplikasi di mesin cloud sementara, lalu menampilkan tampilannya di panel samping chat Anda.