xiaohongshu
xiaohongshu
golang-viper
Go Viper configuration library (github.com/spf13/viper). Use when working with config file reading (SetConfigName, AddConfigPath, ReadInConfig), setting defaults, environment variable binding (SetEnvPrefix, AutomaticEnv, BindEnv), unmarshaling to structs (Unmarshal, UnmarshalKey, mapstructure tag...
Full skill instructions
Viper is Go's most popular configuration library. It handles config files, environment variables, defaults, and remote config stores with a unified API.
viper.Set() - explicit runtime overridesviper.SetDefault() - defaults// Basic setup
viper.SetConfigName("config") // filename without extension
viper.SetConfigType("yaml") // explicit format
viper.AddConfigPath(".") // search current dir
viper.AddConfigPath("$HOME/.myapp") // search home dir
// Set defaults before reading
viper.SetDefault("server.port", 8080)
// Read config
if err := viper.ReadInConfig(); err != nil {
if _, ok := err.(viper.ConfigFileNotFoundError); ok {
// Config file not found; use defaults
} else {
return fmt.Errorf("config error: %w", err)
}
}
// Get values
host := viper.GetString("server.host")
port := viper.GetInt("server.port")
debug := viper.GetBool("debug")
// Unmarshal to struct
var config Config
viper.Unmarshal(&config)
viper.UnmarshalKey("server", &config.Server)
server.PORT and server.port are the sameAPP_PORT differs from app_portserver.host maps to YAML server: { host: ... }Detailed documentation for each feature area:
references/core-config.md - Config files, paths, defaults, reading, multiple configsreferences/environment-vars.md - Env binding, prefixes, key replacers, AutomaticEnvreferences/unmarshaling.md - Structs, mapstructure tags, type getters, custom typesreferences/advanced-features.md - Watching changes, remote config, writing configs// Main config
viper.SetConfigName("config")
viper.ReadInConfig()
// Separate secrets file
secretsViper := viper.New()
secretsViper.SetConfigName("secrets")
secretsViper.AddConfigPath(".")
secretsViper.ReadInConfig()
viper.SetEnvPrefix("MYAPP") // MYAPP_SERVER_PORT
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
viper.AutomaticEnv()
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience