Kongroo.Templates
0.7.1
dotnet new install Kongroo.Templates@0.7.1
Kongroo.Templates
Opinionated dotnet new starter templates for my personal .NET projects — a solution
scaffolder plus standalone project "adders", with my conventions baked in so a new repo is
build-, test-, format-, and publish-ready from the first commit.
Installation
dotnet new install Kongroo.Templates
Update to the latest version with dotnet new install Kongroo.Templates::<version>, and remove
it with dotnet new uninstall Kongroo.Templates.
Templates
| Template | Short name | Scaffolds |
|---|---|---|
| Solution | kongroo-sln |
An empty repo: .slnx, build conventions, formatting + git hooks, GitHub Actions. No projects. |
| NuGet package | kongroo-nuget |
A publishable package repo (solution + library + tests + CI/OIDC publish) |
| Web API | kongroo-api |
An ASP.NET Core minimal API (Serilog, OpenTelemetry, Scalar, health checks, problem details, Dockerfile) |
| Worker service | kongroo-worker |
A Generic Host BackgroundService (Serilog, OpenTelemetry, Dockerfile) |
| CLI app | kongroo-cli |
A Spectre.Console CommandApp wired onto Microsoft.Extensions.DependencyInjection |
| Console app | kongroo-console |
A console app with Spectre.Console rendering and its analyzer |
| Class library | kongroo-lib |
A class library; --packable makes it publishable |
| Unit tests | kongroo-test |
An xUnit v3 project on Microsoft Testing Platform (Bogus, NSubstitute, Shouldly) |
| Integration tests | kongroo-itest |
An xUnit v3 project with WebApplicationFactory + Testcontainers |
Getting started
Scaffold an empty repo, then add the projects you want:
dotnet new kongroo-sln -n Kongroo.Billing
cd Kongroo.Billing
dotnet new kongroo-api -n Kongroo.Billing.Api -o src/Kongroo.Billing.Api
dotnet new kongroo-test -n Kongroo.Billing.UnitTests -o test/Kongroo.Billing.UnitTests
dotnet sln add src/Kongroo.Billing.Api/Kongroo.Billing.Api.csproj
dotnet sln add test/Kongroo.Billing.UnitTests/Kongroo.Billing.UnitTests.csproj
Scaffold a package repo, which comes with its first library already wired up:
dotnet new kongroo-nuget -n Kongroo.Acme
cd Kongroo.Acme
dotnet new kongroo-lib --packable -n Kongroo.Acme.Json -o src/Kongroo.Acme.Json
dotnet sln add src/Kongroo.Acme.Json/Kongroo.Acme.Json.csproj
Options
| Template | Option | Effect |
|---|---|---|
kongroo-api, kongroo-worker |
--observability |
OpenTelemetry tracing + metrics (default on) |
kongroo-lib |
--packable |
Packaging metadata, MinVer, SourceLink, public-API analyzers (default off) |
What's baked in
- Target:
net10.0, nullable + implicit usings, warnings-as-errors, latest .NET analyzers. - Solution & packages:
.slnxformat and Central Package Management — oneDirectory.Packages.propsholding every version an adder can reference, so adding a project never means hunting for versions first. Publishing is opt-in:IsPackableisfalserepo-wide, so a private library cannot reach nuget.org by accident. - Formatting & hooks: CSharpier (C#), Prettier (JSON/YAML/Markdown), commitlint (Conventional Commits) — orchestrated by pre-commit, with a repo-root tool manifest.
- Testing: xUnit v3 on Microsoft Testing Platform, with Bogus, NSubstitute, and Shouldly;
integration tests use
WebApplicationFactoryand Testcontainers. - Web API: Serilog (with enrichers), OpenTelemetry tracing + metrics, the Scalar API reference,
health checks (
/health,/alive), problem-details error handling, and minimal-API validation. - Worker service: Serilog (with enrichers), OpenTelemetry tracing + metrics.
- CLI app: Spectre.Console commands wired onto Microsoft.Extensions.DependencyInjection.
- Containers: the Web API and worker ship a multi-stage Dockerfile that restores in its own
cacheable layer, so editing source does not re-restore. The build context is the repo root, which
is where the
.dockerignorelives. - CI/CD: GitHub Actions for build/test, plus keyless publishing to nuget.org via trusted publishing (OIDC).
Requirements
- .NET 10 SDK or later.
- For the generated repo's git hooks (optional but recommended): pnpm (Prettier + commitlint) and pre-commit.
Publishing generated packages
Generated repos publish their packable projects to nuget.org keylessly via OIDC. See PUBLISHING.md for the one-time nuget.org + GitHub setup, then tag a release:
git tag v0.1.0 && git push origin v0.1.0
Build & contribute
This repo dogfoods the same conventions it ships. From the repo root:
dotnet tool restore # CSharpier
pnpm install # Prettier + commitlint
pwsh test/sync-check.ps1 # verify kongroo-nuget and kongroo-sln stay synchronized, release.yml consistency, action versions
pwsh test/smoke-test.ps1 # pack → install → scaffold every template → build → test
dotnet csharpier check . # formatting (also enforced in CI)
pnpm exec prettier --check .
License
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
See the GitHub Releases for changes.