Creates custom dotnet new templates from .csproj projects and validates template.json for schema, identity, parameters, and post-actions. Packages for NuGet distribution.
npx claudepluginhub dotnet/skills --plugin dotnet-template-engineThis skill uses the workspace's default tool permissions.
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.
Enforces C++ Core Guidelines for writing, reviewing, and refactoring modern C++ code (C++17+), promoting RAII, immutability, type safety, and idiomatic practices.
Provides patterns for shared UI in Compose Multiplatform across Android, iOS, Desktop, and Web: state management with ViewModels/StateFlow, navigation, theming, and performance.
Implements Playwright E2E testing patterns: Page Object Model, test organization, configuration, reporters, artifacts, and CI/CD integration for stable suites.
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. |