template-authoring
Guides creation and validation of custom dotnet new templates from existing projects. Generates a .template.config/template.json that preserves the source project's conventions. USE FOR: creating a reusable dotnet new template from an existing project, bootstrapping .template.config/template.json with correct identity, shortName, parameters, and post-actions, adding parameters or conditional content to a template you are authoring, validating the template.json you are authoring before publishing, packaging templates as NuGet packages for distribution. DO NOT USE FOR: validating an existing tem
npx skills add dotnet/skills --skill template-authoring --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Template Authoring 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. ## When to Use - User wants to create a reusable template from an existing .csproj - User wants to validate a template.json they are authoring before publishing - User is setting up `.template.config/template.json` from scratch - User wants to package a template for NuGet distribution ## When Not to Use - User wants to find or use existing templates — route to `template-discovery` or `template-instantiation` - User has MSBuild issues unrelated to template authoring — route to `dotnet-msbuild` plugin ## Inputs | 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 | ## Workflow ### Step 1: Bootstrap from existing project Anal
- When to Use
- When Not to Use
- Inputs
- Workflow
- Step 1: Bootstrap from existing project
- Step 2: Validate template.json
- Step 3: Refine the template
- Step 4: Test the template locally
- Validation
- Common Pitfalls
- More Info
dotnet 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
What does the template-authoring skill do?
Guides creation and validation of custom dotnet new templates from existing projects. Generates a .template.config/template.json that preserves the source project's conventions. USE FOR: creating a reusable dotnet new template from an existing project, bootstrapping .template.config/template.json with correct identity, shortName, parameters, and post-actions, adding parameters or conditional content to a template you are authoring, validating the template.json you are authoring before publishing, packaging templates as NuGet packages for distribution. DO NOT USE FOR: validating an existing tem
How do I install it?
Run `npx skills add dotnet/skills --skill template-authoring --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
