This file provides guidance to Claude Code when working with code in this repository.
This repository contains dotnet new project templates packaged as a NuGet
package (Hexagrams.Templates). Templates are installed via
dotnet new install Hexagrams.Templates and used with commands like
dotnet new hexagrams-editorconfig.
This project uses NUKE for builds. The build project is
in the build/ directory.
# Using NUKE global tool (recommended for tab completion)
nuke # Run default build
nuke test # Run unit tests
nuke compile # Build the solution
nuke format # Format code
nuke verify-format # Verify code formatting
nuke pack # Pack the template packagesrc/Hexagrams.Templates.csproj- The NuGet package project. This is aPackageType=Templateproject that packages everything undersrc/Templates/but does not compile template code.src/Templates/- Contains the actual templates. Each subdirectory is a template with a.template.config/template.jsonmanifest.
| Short Name | Description |
|---|---|
hexagrams-editorconfig |
.editorconfig with C# code style preferences |
hexagrams-gitattributes |
.gitattributes for .NET repositories |
hexagrams-gitversion |
GitVersion configuration for release flow |
hexagrams-test |
xUnit test project with FluentAssertions |
Template projects appear twice in the solution: once as items within
Hexagrams.Templates (for packaging) and once as direct project references (for
IDE development/building). This is intentional per the README.
The build inherits from Hexagrams.Nuke.Components providing these interfaces:
IClean,IRestore,IFormat,ICompile,IPack,IPushIHasGitRepository,IHasVersioning(uses GitVersion for semantic versioning)
The Install target is custom - it packs the templates and reinstalls them
locally for testing.
- Create a new directory under
src/Templates/ - Add a
.template.config/template.jsonmanifest defining the template metadata - The template will be automatically included in the package (no csproj changes needed)
See Microsoft's template docs for template.json schema.