From golang-boost
Builds multi-command CLIs in Go using boost's cobra factory, wiring config/version/logging defaults via NewCommand. Triggers on cobra imports or subcommand wiring questions.
How this skill is triggered — by the user, by Claude, or both
Slash command
/golang-boost:boost-factory-cobraThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**REQUIRED BACKGROUND:** `boost-start`. For event-driven function CLI shape (`fn.Run` uses cobra internally) → `boost-bootstrap-function`.
REQUIRED BACKGROUND: boost-start. For event-driven function CLI shape (fn.Run uses cobra internally) → boost-bootstrap-function.
import cobrafact "github.com/xgodev/boost/factory/contrib/spf13/cobra/v1"
import co "github.com/spf13/cobra"
root := &co.Command{Use: "myapp"}
sync := &co.Command{Use: "sync", RunE: runSync}
backfill := &co.Command{Use: "backfill", RunE: runBackfill}
cmd := cobrafact.NewCommand(root, sync, backfill)
cmd.Execute()
NewCommand(root, subcommands...) wires boost-aware defaults (config flag, version flag, structured logging) onto the root before attaching subcommands.
Use cobra when the binary genuinely has multiple modes (sync, backfill, migrate, dev tools). For single-purpose binaries (a function or an HTTP API), skip cobra — boost.Start() + a plain main is simpler.
| Red flag | Fix |
|---|---|
| Hand-rolling cobra with no boost integration | cobrafact.NewCommand(root, ...) |
Defining subcommands inside init() of multiple files | Compose them in main, not via package-init side effects |
Reading flags via os.Args directly | Use cobra's cmd.Flags() |
npx claudepluginhub xgodev/boost --plugin golang-boostGuides building and extending CLI command trees in Go using spf13/cobra — covering command setup, hooks, flags, args validation, shell completions, and testing.
Bootstraps uber/fx app containers with boost-aware defaults: structured logger integration, lifecycle hooks, and signal handling for Go services.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.