Guides creation and validation of custom dotnet new templates. Generates templates from existing projects and validates template.json for authoring issues. USE FOR: creating a reusable dotnet new template from an existing project, validating template.json files for schema compliance and parameter issues, bootstrapping .template.config/template.json with correct identity, shortName, parameters, and post-actions, packaging templates as NuGet packages for distribution. DO NOT USE FOR: finding or using existing templates (use template-discovery and template-instantiation), MSBuild project file issues unrelated to template authoring, NuGet package publishing (only template packaging structure).
How this skill is triggered — by the user, by Claude, or both
Slash command
/dotnet-template-engine:template-authoringThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill helps an agent create and validate custom `dotnet new` templates. It guides bootstrapping templates from existing projects and validates `template.json` files for authoring issues before publishing.
This skill helps an agent create and validate custom dotnet new templates. It guides bootstrapping templates from existing projects and validates template.json files for authoring issues before publishing.
.template.config/template.json from scratchtemplate-discovery or template-instantiationdotnet-msbuild plugin| Input | Required | Description |
|---|---|---|
| Source project path | For creation | Path to the .csproj to use as template source |
| template.json path | For validation | Path to an existing template.json to validate |
| Template name | For creation | Human-readable name for the template |
| Short name | Recommended | Short name for dotnet new <shortname> usage |
Analyze the source .csproj and create a .template.config/template.json:
.template.config directory next to the projecttemplate.json with identity (reverse-DNS), name, shortName, sourceName (project name for replacement), classifications, and tagsMinimal example:
{
"$schema": "http://json.schemastore.org/template",
"author": "MyOrg",
"classifications": ["Library"],
"identity": "MyOrg.Templates.MyLib",
"name": "My Library Template",
"shortName": "mylib",
"sourceName": "MyLib",
"tags": { "language": "C#", "type": "project" }
}
Read and review the template.json for common authoring issues:
Validation checks to perform:
identity, name, and shortName are presentMyOrg.Templates.WebApi)string, bool, choice, int, float), choices have defaults, descriptions are presentbuild, run, test, publish). Check with dotnet new list to see if the name is already takenBased on validation results and user requirements:
#if preprocessor directives for optional featuresdotnet new install ./path/to/template/root
dotnet new mylib --name TestProject --dry-run
dotnet new mylib --name TestProject --output ./test-output
dotnet build ./test-output/TestProject
template.json passes manual validation with zero errorsdotnet build| Pitfall | Solution |
|---|---|
| Identity format issues | Use reverse-DNS format (e.g., MyOrg.Templates.WebApi). Avoid spaces or special characters. |
| ShortName conflicts with CLI commands | Avoid names like build, run, test, publish. Check by running dotnet new list to see if the name is already taken. |
| Missing parameter descriptions | Every parameter should have a description and displayName for discoverability. |
| Not testing all parameter combinations | Use dotnet new <template> --dry-run with different parameter values to verify conditional content works correctly. |
| Hardcoded versions in template | Use sourceName replacement for project names and consider parameterizing framework versions. |
| Not setting classifications | Add appropriate classifications (e.g., ["Web", "API"]) for template discovery. |
npx claudepluginhub weiflycc-cmd/skills --plugin dotnet-template-engineProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.