{"id":"e3bf3f24-e463-406e-88f2-2adba4b4b655","slug":"clawhub-samber-golang-spf13-cobra","name":"golang-spf13-cobra","description":"Golang CLI command tree library using spf13/cobra — cobra.Command, RunE vs Run, PersistentPreRunE hook chain, Args validators (NoArgs, ExactArgs, MatchAll, custom), persistent vs local flags, command groups, ValidArgsFunction, RegisterFlagCompletionFunc, ShellCompDirective, usage/help template customization, man-page and markdown doc generation, and testing with SetArgs/SetOut/SetErr. Apply when using or adopting spf13/cobra, or when the codebase imports `github.com/spf13/cobra`. For configuration layering alongside cobra, see the `samber/cc-skills-golang@golang-spf13-viper` skill. For general CLI architecture (project layout, exit codes, signal handling, I/O patterns), see `samber/cc-skills-golang@golang-cli`.","capabilities":[],"protocols":["OPENCLAW"],"safetyScore":84,"overallRank":62,"trustScore":null,"trust":null,"source":"CLAWHUB","updatedAt":"2026-10-11T14:31:24.676Z"}