/template-validation
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
$ npx -y skills add managedcode/dotnet-skills --skill template-validation --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/template-validation
Context preview
The summary Claude sees to decide when to auto-load this skill.
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
SKILL.md
template-validation.SKILL.mdname: 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
| 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.
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 `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`
**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)
7. Constraint Validation
For each constraint:
- ERROR if missing `type` field
- WARNING if missing `args` — most constraint types require arguments
8. Tags Validation
- SUGGESTION if no `language` tag — adding `tags.language` (e.g., `"C#"`) improves filtering in `dotnet new list --language`
- SUGGESTION if no `typ
Read more
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
| 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.
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 `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`
**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)
7. Constraint Validation
For each constraint:
- ERROR if missing `type` field
- WARNING if missing `args` — most constraint types require arguments
8. Tags Validation
- SUGGESTION if no `language` tag — adding `tags.language` (e.g., `"C#"`) improves filtering in `dotnet new list --language`
- SUGGESTION if no `typ
Stop explaining .NET to your AI. Start building. We've all been there: asking Claude to use Entity Framework, only to get EF6 patterns in a .NET 8 project. Explaining to Copilot that Blazor Server and Blazor WebAssembly aren't the same thing.
Repo: managedcode/dotnet-skills
Other skills on dotnet-skills.
- /aspnet-core
Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging, and deployment patterns on current .NET. USE FOR: working on ASP.NET Core apps, services, or middleware; changing auth, routing, configuration,
Open skill - /aspire
Build, upgrade, and operate Aspire 13.4.x C# or TypeScript application hosts with the current CLI, AppHost, ServiceDefaults, integrations, dashboard, testing, MCP, and deployment patterns for distributed apps. USE FOR: Aspire.AppHost.Sdk, Aspire.Hosting.*,
Open skill - /azure-functions
Build, review, or migrate Azure Functions in .NET with correct execution model, isolated worker setup, bindings, DI, and Durable Functions patterns. USE FOR: working on Azure Functions in .NET; migrating from the in-process model to the isolated worker model; adding Durable
Open skill - /blazor
Build and review Blazor applications across server, WebAssembly, web app, and hybrid scenarios with correct component design, state flow, rendering, and hosting choices. USE FOR: building interactive web UIs with C# instead of JavaScript; choosing between Server, WebAssembly, or
Open skill - /entity-framework6
Maintain or migrate EF6-based applications with realistic guidance on what to keep, what to modernize, and when EF Core is or is not the right next step. USE FOR: EF6 codebases; runtime versus ORM migration decisions; EDMX, code-first, ObjectContext, and legacy data-access
Open skill - /entity-framework-core
Design, tune, or review EF Core data access with proper modeling, migrations, query translation, performance, and lifetime management for modern .NET applications. USE FOR: DbContext, migrations, model configuration, EF queries, tracking, loading, performance, transactions, and
Open skill

