Official agent skill

Template Validation

by dotnet in dotnet/skills

Validates custom dotnet new templates for correctness before publishing.

OfficialMITAuto-check passed

Install Template Validation

skills CLI
$ npx skills add dotnet/skills --skill template-validation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install dotnet/skills template-validation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/dotnet/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/dotnet-template-engine/skills/template-validation .claude/skills/template-validation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
template-validation
GitHub stars
5.6k
Used in
1 other repo
Token cost
~2.9k tokens
SKILL.md length
1,357 words
Files
1
Skills in repo
91
Repo updated
First seen
Licence
MIT

At a glance

Validates custom dotnet new templates for correctness before publishing.

  • Works in 11 steps: Required Fields → Identity Format → ShortName Conflicts → …
  • : checking template.json files for errors before publishing
  • SKILL.md covers When to Use, When Not to Use, Inputs and Validation Rules, plus 3 more sections
  • Calls dotnet

What it does

Template Validation is an agent skill from dotnet/skills, published by the product's own GitHub organization. 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…

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with .NET. The repository describes itself as: Repository for skills to assist AI coding agents with .NET and C. The licence is MIT.

When your agent uses it

  • : checking template.json files for errors before publishing
  • Diagnosing why a template doesnt appear after installation
  • Reviewing template parameter definitions for type mismatches and missing defaults
  • Finding shortName conflicts with dotnet CLI commands

Example prompts

  • “Use the template-validation skill to validate custom dotnet new templates for correctness before publishing”
  • “/template-validation”

Workflow steps

11 steps, taken from the step headings in SKILL.md.

  1. Required Fields
  2. Identity Format
  3. ShortName Conflicts
  4. Symbol Validation
  5. Sources Validation
  6. Post-Action Validation
  7. Constraint Validation
  8. Tags Validation
  9. Locate the template.json
  10. Parse and validate
  11. Report results

What it can do on your machine

Read from SKILL.md and the folder at commit 8d670fa. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dotnet

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Template Validation loads about 2.9k tokens when it runs. Until then it costs about 195 tokens; SKILL.md has 1,357 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~195
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from dotnet/skills at commit 8d670fa, republished under its MIT licence (© dotnet). 1,357 words, ~2,927 tokens.

Download SKILL.mdSave it as .claude/skills/template-validation/SKILL.md (or your agent's skills folder).
name
template-validation
description
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 templates (use template-discovery), creating projects from templates (use template-instantiation), creating templates from existing projects (use template-authoring).
license
MIT

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

InputRequiredDescription
template.json pathYesPath 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
FieldSeverityRule
identityERRORMust be present and non-empty
nameERRORMust be present and non-empty
shortNameERRORMust be present and non-empty
sourceNameWARNINGWithout it, --name won't customize the generated project name
authorWARNINGImproves template discoverability
descriptionSUGGESTIONHelps users understand what the template creates
classificationsSUGGESTIONImproves search and categorization (e.g., ["Web", "API"])
defaultNameSUGGESTIONProvides 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 type field
  • For type: "parameter":
    • WARNING if no datatype specified (defaults to string)
    • SUGGESTION if no description (improves --help output)
    • If datatype: "choice":
      • ERROR if no choices defined
      • ERROR if choices is empty
      • ERROR if defaultValue is not in the choices list
      • WARNING if optional (not isRequired) and no defaultValue — users get unexpected behavior
    • If datatype: "bool":
      • ERROR if defaultValue is not a valid boolean
    • If datatype: "int":
      • ERROR if defaultValue is not a valid integer
    • Valid datatypes: string, bool, choice, int, float, hex, text
    • ERROR if datatype is not in the valid list
  • For type: "computed":
    • ERROR if missing value expression
  • For type: "generated":
    • ERROR if missing generator field
    • Valid generators: casing, coalesce, constant, port, guid, now, random, regex, regexMatch, switch, join

Custom parameter help is template-specific: it appears under dotnet new <shortName> --help, not the global dotnet new --help. Correct that premise when necessary, then explain which invalid symbol definitions prevent the parameters from appearing reliably.

A valid choice parameter uses a non-empty choices object, for example:

json
"Color": {
  "type": "parameter",
  "datatype": "choice",
  "defaultValue": "Blue",
  "choices": {
    "Blue": { "displayName": "Blue" },
    "Green": { "displayName": "Green" }
  }
}

Parameter prefix collisions: WARNING if any parameter name is a prefix of another parameter name (e.g., Auth and AuthMode) — this creates ambiguous parsing in expression contexts.

5. Sources Validation

For source modifier conditions:

  • WARNING if a condition string doesn't contain parentheses around symbol names — expected format is (symbolName), not bare symbolName
6. Post-Action Validation

For each post-action:

  • ERROR if missing actionId
  • WARNING if missing description — this text is shown to users when the action requires manual steps
  • SUGGESTION if missing manualInstructions — these are shown when the action can't run automatically (e.g., in an IDE)
Show full SKILL.md (588 more words)Show less
7. Constraint Validation

For each constraint:

  • ERROR if missing type field
  • WARNING if missing args — most constraint types require arguments
  • For type: "host", missing args is an ERROR. args is a required array; each entry needs hostname. Supported built-in identifiers include dotnetcli, vs, vs-mac, ide, and dotnetcli-preview. An optional version uses NuGet version/range syntax such as [10.0.100,). The engine matches argument keys case-insensitively, so the documented hostName spelling is also valid. Reject unrelated fields such as pattern and value.
  • For type: "sdk-version", args is a version string or array using the same syntax.
8. Tags Validation
  • SUGGESTION if no language tag — adding tags.language (e.g., "C#") improves filtering in dotnet new list --language
  • SUGGESTION if no type tag — adding tags.type (e.g., "project" or "item") improves categorization

Workflow

Step 1: Locate the template.json

The file can be at:

  • Direct path: path/to/template.json
  • In a template directory: path/to/.template.config/template.json
  • In a .template.config directory: path/.template.config/template.json
Step 2: Parse and validate

Read the JSON. If it's malformed, report the JSON parse error with line and column. If an absolute-path read fails, retry the user-supplied relative path from the working directory before concluding the file is unavailable.

Only after parsing succeeds, run all 8 validation categories above. Collect errors, warnings, and suggestions separately. Verify schema-sensitive claims against the installed SDK or the current template-engine schema; do not infer a runtime failure from a field name alone.

Step 3: Report results

Lead with a one-line verdict, then a single findings table. This decisive shape is required — do not scatter findings across prose paragraphs.

Verdict header (pick one):

  • ❌ Not ready — N error(s), M warning(s) — has errors
  • ⚠️ Publishable but N warning(s) — no errors, has warnings
  • ✅ Ready to publish — 0 errors, 0 warnings — no errors or warnings (optional suggestions may still apply)

Then one table, ordered errors → warnings → suggestions:

SeverityLocation (JSON path or line:col)IssueFix
ERRORshortName"list" conflicts with a dotnet new subcommandRename to a distinctive value, e.g. "my-list"
ERRORsymbols.maxRetries.defaultValue"abc" is not a valid intSet a numeric default, e.g. "3"
WARNINGsourceNameMissing replacement tokenSet it to the source project name

Every ERROR and WARNING MUST include a concrete fix — the corrected value, JSON snippet, or a specific edit instruction (e.g. "remove the trailing comma"), not just a restatement of the problem. A finding without an actionable fix is incomplete. This is the single biggest thing that separates a useful validation from a generic lint.

Close with the total: "N error(s), M warning(s), K suggestion(s)."

For malformed JSON the output is intentionally smaller and has exactly two parts:

❌ Not ready — JSON parse error at line N, column M: <message>.

json
<smallest corrected fragment showing the exact edit>

Do not append a findings table or semantic totals until the corrected file parses.

Common Pitfalls

PitfallImpact
ShortName = "list" or "search"Template can never be created — conflicts with a dotnet new subcommand
Missing sourceName--name MyProject doesn't rename anything in the generated files
Choice parameter without defaultValueConfusing user experience on optional choice params
Invalid datatype valueTemplate engine ignores the symbol, causing silent failures
Computed symbol without valueTemplate engine throws at instantiation time
Parameter prefix collision (Auth vs AuthMode)Ambiguous expression evaluation
Source condition without parenthesesCondition may not evaluate correctly
Continuing semantic validation after JSON parsing failedFindings are speculative. Report the exact parse fix and stop.
Host constraint uses scalar args, the invalid dotnet-cli host ID, or unrelated fieldsUse args: [{ "hostname": "dotnetcli", "version": "[10.0.100,)" }]; hostName is also accepted case-insensitively.

More Info

© dotnet, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/dotnet-template-engine/skills/template-validation of dotnet/skills.

Open the folder on GitHubat commit 8d670fa

Used in 1 other repository

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in dotnet/skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Template Validation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Template Validation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Template Validation this skilldotnet/skills5.6k1 repos~2.9kAutomated safety check: PassMIT
Minimax DOCXpoco-ai/poco-claw1.4k7 repos~3.9kAutomated safety check: PassMIT
Microsoft Skill CreatorMicrosoftDocs/mcp1.9k3 repos~2.1kAutomated safety check: PassCC-BY-4.0
Speckit ConstitutionWeihanLi/WeihanLi.Common24211 repos~2.1kAutomated safety check: PassApache-2.0
Copilot Session Failure Analysisdotnet/maui23k—~3.4kAutomated safety check: PassMIT
Microsoft Code ReferenceMicrosoftDocs/mcp1.9k4 repos~1.1kAutomated safety check: PassCC-BY-4.0

Similar skills

  • Minimax DOCX

    poco-ai/poco-claw

    Professional DOCX document creation, editing, and formatting using OpenXML SDK (.NET).

    1.4k GitHub starsUsed in 7 repos~3.9k tokens
    Documents & OfficeAuto-check passed
  • Microsoft Skill Creator

    MicrosoftDocs/mcp

    Official

    Create agent skills for Microsoft technologies using official documentation.

    1.9k GitHub starsUsed in 3 repos~2.1k tokens
    Agent WorkflowsAuto-check passed
  • Speckit Constitution

    WeihanLi/WeihanLi.Common

    Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.

    242 GitHub starsUsed in 11 repos~2.1k tokens
    DevelopmentAuto-check passed
  • Mines local Copilot CLI session logs for dotnet/maui to rank costly or failing runs, tag recurring failure modes, propose repo edits and emit guard evals.

    23k GitHub stars~3.4k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Microsoft Code Reference

    MicrosoftDocs/mcp

    Official

    Find working code samples, verify API signatures, and fix Microsoft SDK errors using official docs.

    1.9k GitHub starsUsed in 4 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Official

    Audits and updates os-packages.json files listing the Linux packages each .NET release needs per distro, then regenerates the Markdown from the JSON.

    22k GitHub stars~2.3k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from dotnet/skills

All 91 skills in this repo
  • Official

    Resolves .NET runtime frames in Apple .ips crash logs to function names, source files and line numbers using dSYM symbols, atos and the Microsoft symbol server.

    5.6k GitHub starsUsed in 1 repo~2.4k tokens
    Auto-check passed
  • Official

    Resolves native crash frames from .NET Android tombstones to function names, source files and line numbers using BuildIds, Microsoft's symbol server and llvm-symbolizer.

    5.6k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Official

    Scans C# and .NET code for about 50 performance anti-patterns and reports prioritized findings with concrete fixes, at a scan depth you choose.

    5.6k GitHub starsUsed in 3 repos~3.1k tokens
    Auto-check passed
  • Official

    Statically pairs source files with test files to list code that no test references, using Roslyn for C# or tree-sitter for many languages, with no build.

    5.6k GitHub starsUsed in 1 repo~3.3k tokens
    Auto-check passed
  • Microbenchmarking

    dotnet/skills

    Official

    Activate this skill when BenchmarkDotNet (BDN) is involved in the task — creating, running, configuring, or reviewing BDN benchmarks.

    5.6k GitHub starsUsed in 3 repos~3.3k tokens
    Auto-check passed
  • Official

    Makes .NET projects compatible with Native AOT and trimming by resolving IL trim and AOT analyzer warnings through annotations rather than suppressions.

    5.6k GitHub starsUsed in 2 repos~4.2k tokens
    Auto-check passed

Works with

Questions about Template Validation

What does Template Validation do?

Validates custom dotnet new templates for correctness before publishing. Template Validation is an agent skill from dotnet/skills, published by the product's own GitHub organization. Validates custom dotnet new templates for correctness before publishing.

When should I use Template Validation?

Template Validation fits situations like: : checking template.json files for errors before publishing; diagnosing why a template doesnt appear after installation; reviewing template parameter definitions for type mismatches and missing defaults; finding shortName conflicts with dotnet CLI commands.

How do I install Template Validation in Claude Code?

Run `npx skills add dotnet/skills --skill template-validation -a claude-code`. Or copy the skill folder (plugins/dotnet-template-engine/skills/template-validation in dotnet/skills) into .claude/skills/template-validation in your project. Claude Code loads it when a task matches its description.

How do I install Template Validation in Codex?

Run `npx skills add dotnet/skills --skill template-validation -a codex`. Or copy the skill folder (plugins/dotnet-template-engine/skills/template-validation in dotnet/skills) into .agents/skills/template-validation in your project. Codex loads it when a task matches its description.

Can I use Template Validation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dotnet/skills --skill template-validation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/template-validation, .gemini/skills/template-validation, .github/skills/template-validation and .opencode/skills/template-validation in your project.

What does Template Validation need to run?

Going by SKILL.md and its folder, Template Validation needs the command-line tools its instructions call (dotnet).

Does Template Validation access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Template Validation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Template Validation use?

Template Validation is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Template Validation use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Template Validation?

Skills that share tags, products or a category with Template Validation: Minimax DOCX (poco-ai/poco-claw, 1.4k stars), Microsoft Skill Creator (MicrosoftDocs/mcp, 1.9k stars), Speckit Constitution (WeihanLi/WeihanLi.Common, 242 stars) and Copilot Session Failure Analysis (dotnet/maui, 23k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Template Validation?

dotnet (a GitHub organization, an official publisher) maintains it in dotnet/skills, which has 5,568 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on October 7, 2026.

Source: dotnet/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.