What problem does it solve? Go CLI tools often suffer from inconsistent flag handling, broken configuration layering, wrong exit codes, and stdout/stderr misuse that breaks shell pipelines. This Skill encodes the conventions used by kubectl, docker, and gh so your CLI behaves correctly under automation and scripting. ## Core Features & Use Cases - Command Structure & Flags: Sets up Cobra root commands with SilenceUsage/SilenceErrors, persistent vs local flags, required flags, mutual exclusion, and argument validators. - Configuration Layering: Wires Viper so values resolve correctly across flags, environment variables, config files, and defaults, with env prefixes and graceful missing-config handling. - Production Behaviors: Covers ldflags version injection, Unix exit codes, signal.NotifyContext graceful shutdown, shell completions, machine-readable output formats, and programmatic CLI testing. - Use Case: When adding a 'serve' subcommand to an existing Go CLI, the Skill reads the current command tree, binds the --port flag to Viper, writes logs to stderr, and adds table-driven tests that capture output via buffers. ## Quick Start Ask the agent to scaffold a new Go CLI with Cobra and Viper including a root command, a serve subcommand, and a version command.