What problem does it solve? Go services often misbehave because configuration values come from multiple sources — flags, environment variables, config files, and defaults — and viper's precedence rules, env key mapping, and unmarshaling behavior are easy to get wrong. This Skill provides the correct patterns for wiring viper so nested keys resolve, optional config files don't crash services, and tests stay isolated. ## Core Features & Use Cases - Layered precedence and env binding: Wire SetEnvPrefix, SetEnvKeyReplacer, and AutomaticEnv together so nested keys like database.host resolve to MYAPP_DATABASE_HOST, and bind cobra flags via BindPFlag before Execute(). - Struct unmarshaling and hot reload: Use mapstructure tags, UnmarshalKey, DecodeHooks for time.Duration, and race-safe WatchConfig patterns with validate-then-swap reloads. - Test isolation: Create viper.New() instances per test instead of the global instance to eliminate order-dependent flaky tests. - Use Case: A Go HTTP service reads a YAML config file, overrides values with environment variables, and hot-reloads on change — this Skill shows the exact setup including graceful ConfigFileNotFoundError handling. ## Quick Start Ask the agent to set up viper configuration for your Go service with env var binding, an optional YAML config file, and struct unmarshaling.