dotnet-cli-architecture

Installation
SKILL.md

dotnet-cli-architecture

Layered CLI application architecture for .NET: command/handler/service separation following clig.dev principles, configuration precedence (appsettings → environment variables → CLI arguments), structured logging in CLI context, exit code conventions, stdin/stdout/stderr patterns, and testing CLI applications via in-process invocation with output capture.

Version assumptions: .NET 8.0+ baseline. Patterns apply to CLI tools built with System.CommandLine 2.0 and generic host.

Scope

  • Layered command/handler/service architecture for CLI apps
  • clig.dev principles for .NET (stdout/stderr, exit codes, NO_COLOR)
  • Configuration precedence (appsettings, env vars, CLI args)
  • Structured logging in CLI context
  • Stdin/stdout/stderr patterns and machine-readable output
  • Testing CLI applications via in-process invocation

Out of scope

  • System.CommandLine API details (RootCommand, Option, SetAction) -- see [skill:dotnet-system-commandline]
  • Native AOT compilation and publish pipeline -- see [skill:dotnet-native-aot]
Related skills

More from novotnyllc/dotnet-artisan

Installs
3
GitHub Stars
208
First Seen
Feb 24, 2026