What problem does it solve? Go applications need configuration from multiple sources — command-line flags, environment variables, config files, and remote KV stores — and resolving which value wins is error-prone. This Skill guides correct use of spf13/viper's fixed precedence pipeline, preventing common bugs like broken env binding for nested keys, nil-pointer panics from Sub(), and flaky tests caused by global viper state. ## Core Features & Use Cases - Layered precedence resolution: Implements the flag > env > file > KV > default pipeline with BindPFlag, SetEnvPrefix, SetEnvKeyReplacer, and AutomaticEnv wired together correctly. - Struct unmarshaling and hot reload: Maps resolved config into structs with mapstructure tags and DecodeHooks, and applies WatchConfig/OnConfigChange with race-safe, validate-then-swap reload patterns. - Test isolation: Uses viper.New() per test instead of the global instance to eliminate order-dependent test failures. - Use Case: A Go HTTP service reads database.host from MYAPP_DATABASE_HOST, an optional YAML file, and flag defaults — this Skill ensures the env replacer, graceful ConfigFileNotFoundError handling, and mapstructure tags are all set up correctly. ## Quick Start Ask the agent to set up viper configuration for your Go service with env prefix, key replacer, optional config file handling, and unmarshaling into a tagged struct.