
Description
golang-spf13-cobra is an agent skill for building command-line tools in Go with the spf13/cobra library. Cobra provides the command and subcommand tree, flag parsing through pflag, argument validation, shell completion generation and documentation generation, so the skill focuses on the user-facing surface of a CLI. It guides the agent through three modes. Build mode sets up a new CLI, including the command tree, hook wiring and flag sections, in order. Extend mode adds subcommands, flags or completions to an existing CLI, and the agent first reads the current command tree so new parts match the existing structure. Review mode audits a CLI against a list of common mistakes, checking such things as the use of RunE rather than Run, output written with OutOrStdout, the order of the PersistentPreRunE hook chain and the validation of arguments with validators such as NoArgs, ExactArgs and MatchAll. The skill notes that Cobra does not handle configuration layering, which is the job of viper. It is part of the samber cc-skills-golang collection, which is added to a compatible agent with the skills command. Official documentation for Cobra is linked from the skill for anything it does not cover.…
Highlights
- Builds Cobra command trees and subcommands
- Build, extend and review modes
- Checks RunE use, hook order and argument validators
- Shell completion and flag guidance
Ratings & Reviews
No ratings yet
Be the first to rate golang-spf13-cobra.
People also visit

apple-reminders
List, add, edit, complete, or delete Apple Reminders and reminder lists
golang-spf13-cobra FAQ
What does golang-spf13-cobra do?
It helps an agent build, extend and review Go command-line tools that use the spf13/cobra library.
What does review mode check?
A list of common mistakes, including whether RunE is used, whether output goes to OutOrStdout, the PersistentPreRunE hook chain order, and argument validation.
Does Cobra handle configuration files?
No. The skill notes that configuration layering is the job of viper, which is covered by a separate skill.
How do I install it?
Run: npx skills add https://github.com/samber/cc-skills-golang --skill golang-spf13-cobra
What security audits has it passed?
Gen Agent Trust Hub, Socket and Snyk all passed.
What are the best golang-spf13-cobra alternatives?
Popular alternatives to golang-spf13-cobra include golang-cli, openhue and 1password. See all golang-spf13-cobra alternatives