Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generate Cobra/Viper-based Go CLI applications with persistent flags, subcommands, and configuration management. Creates production-ready Go CLI with modern patterns.
.claude/skills/a5c-ai-cobra-scaffolder/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 2% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 44% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 55% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 610% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 194% | 0% |
Generate a complete Cobra CLI application with Viper configuration, proper Go module structure, and best practices.
Invoke this skill when you need to:
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | projectName | string | Yes | Name of the CLI project (kebab-case) | | modulePath | string | Yes | Go module path (e.g., github.com/user/project) | | description | string | Yes | Short description of the CLI | | commands | array | No | List of commands to scaffold | | useViper | boolean | No | Integrate Viper config (default: true) | | useCobra | boolean | No | Use cobra-cli generator patterns (default: true) |
json{ "commands": [ { "name": "serve", "description": "Start the server", "persistentFlags": [ { "name": "config", "shorthand": "c", "type": "string", "usage": "config file path" } ], "flags": [ { "name": "port", "shorthand": "p", "type": "int", "default": 8080, "usage": "port to listen on" } ], "subcommands": ["start", "stop", "status"] } ] }
<projectName>/
├── go.mod
├── go.sum
├── main.go
├── README.md
├── .goreleaser.yaml
├── cmd/
│ ├── root.go # Root command with Viper
│ ├── serve.go # Serve command
│ ├── version.go # Version command
│ └── completion.go # Completion command
├── internal/
│ ├── config/
│ │ └── config.go # Configuration structures
│ ├── server/
│ │ └── server.go # Server implementation
│ └── logger/
│ └── logger.go # Logging setup
├── pkg/
│ └── utils/
│ └── helpers.go # Public utilities
└── tests/
└── cmd/
└── root_test.gogopackage cmd import ( "fmt" "os" "github.com/spf13/cobra" "github.com/spf13/viper" ) var cfgFile string var rootCmd = &cobra.Command{ Use: "<projectName>", Short: "<description>", Long: `<long description>`, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { return initConfig() }, } func Execute() { if err := rootCmd.Execute(); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } } func init() { rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.<projectName>.yaml)") rootCmd.PersistentFlags().BoolP("verbose", "v", false, "verbose output") viper.BindPFlag("verbose", rootCmd.PersistentFlags().Lookup("verbose")) } func initConfig() error { if cfgFile != "" { viper.SetConfigFile(cfgFile) } else { home, err := os.UserHomeDir() cobra.CheckErr(err) viper.AddConfigPath(home) viper.SetConfigType("yaml") viper.SetConfigName(".<projectName>") } viper.AutomaticEnv() viper.SetEnvPrefix("<PROJECT_NAME>") if err := viper.ReadInConfig(); err == nil { fmt.Fprintln(os.Stderr, "Using config file:", viper.ConfigFileUsed()) } return nil }
gopackage cmd import ( "fmt" "github.com/spf13/cobra" "github.com/spf13/viper" ) var serveCmd = &cobra.Command{ Use: "serve", Short: "Start the server", Long: `Start the server with the specified configuration.`, RunE: func(cmd *cobra.Command, args []string) error { port := viper.GetInt("port") host := viper.GetString("host") fmt.Printf("Starting server on %s:%d\n", host, port) return nil }, } func init() { rootCmd.AddCommand(serveCmd) serveCmd.Flags().IntP("port", "p", 8080, "port to listen on") serveCmd.Flags().String("host", "localhost", "host to bind to") viper.BindPFlag("port", serveCmd.Flags().Lookup("port")) viper.BindPFlag("host", serveCmd.Flags().Lookup("host")) }
gomodule github.com/user/<projectName> go 1.21 require ( github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.0 )
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 30,885 | 18,619 | -40% | 1 | 1 | 0% | 6,234 | 6,352 | +2% | 0 | 0 | — |
case-02 | fail→pass | 17,382 | 17,332 | -0% | 1 | 1 | 0% | 4,043 | 5,814 | +44% | 0 | 0 | — |
case-03 | fail→pass | 18,044 | 20,766 | +15% | 1 | 1 | 0% | 4,417 | 6,868 | +55% | 0 | 0 | — |
case-04 | fail→fail | 17,300 | 30,848 | +78% | 1 | 1 | 0% | 3,987 | 7,361 | +85% | 0 | 0 | — |
case-05 | fail→fail | 22,104 | 23,987 | +9% | 1 | 1 | 0% | 5,017 | 5,983 | +19% | 0 | 0 | — |
case-06 | fail→fail | 10,878 | 10,761 | -1% | 1 | 1 | 0% | 2,491 | 3,977 | +60% | 0 | 0 | — |
case-07 | fail→fail | 9,681 | 11,638 | +20% | 1 | 1 | 0% | 2,036 | 4,216 | +107% | 0 | 0 | — |
case-08 | fail→fail | 11,920 | 12,610 | +6% | 1 | 1 | 0% | 2,430 | 4,231 | +74% | 0 | 0 | — |
case-09 | fail→fail | 6,428 | 6,071 | -6% | 1 | 1 | 0% | 1,389 | 2,850 | +105% | 0 | 0 | — |
case-10 | fail→fail | 7,554 | 8,567 | +13% | 1 | 1 | 0% | 1,447 | 3,112 | +115% | 0 | 0 | — |
case-11 | fail→fail | 12,605 | 7,989 | -37% | 1 | 1 | 0% | 2,559 | 3,248 | +27% | 0 | 0 | — |
case-12 | fail→pass | 1,733 | 3,959 | +128% | 1 | 1 | 0% | 327 | 2,322 | +610% | 0 | 0 | — |
case-13 | fail→fail | 12,025 | 3,856 | -68% | 1 | 1 | 0% | 2,482 | 2,334 | -6% | 0 | 0 | — |
case-14 | fail→fail | 12,419 | 5,428 | -56% | 1 | 1 | 0% | 2,153 | 2,427 | +13% | 0 | 0 | — |
case-15 | fail→pass | 4,569 | 4,446 | -3% | 1 | 1 | 0% | 819 | 2,405 | +194% | 0 | 0 | — |
case-16 | fail→fail | 6,519 | 7,353 | +13% | 1 | 1 | 0% | 1,307 | 3,131 | +140% | 0 | 0 | — |
case-17 | fail→fail | 7,079 | 12,806 | +81% | 1 | 1 | 0% | 1,622 | 4,492 | +177% | 0 | 0 | — |
case-18 | fail→fail | 6,381 | 4,020 | -37% | 1 | 1 | 0% | 1,240 | 2,390 | +93% | 0 | 0 | — |
case-19 | fail→fail | 10,118 | 7,391 | -27% | 1 | 1 | 0% | 2,077 | 2,837 | +37% | 0 | 0 | — |
case-20 | fail→fail | 4,470 | 3,601 | -19% | 1 | 1 | 0% | 861 | 2,319 | +169% | 0 | 0 | — |
case-21 | fail→fail | 8,965 | 5,176 | -42% | 1 | 1 | 0% | 1,705 | 2,367 | +39% | 0 | 0 | — |
case-22 | fail→fail | 11,458 | 8,133 | -29% | 1 | 1 | 0% | 2,320 | 3,333 | +44% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +23 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.