Sign inGet started
–

Guides building Go CLI command trees with spf13/cobra, covering RunE hooks, args validators, flags, shell completions, doc generation, and testing.

Lift · GLM-5.3-flash—not yet benchmarked
91
Trustsecurity · quality · license · upkeep
Scan Saferisk 0/100
LicenseMITserved via MCP

What it does

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`.

#cli#cobra#command-line#completions#go#testing

Quality judgment

completeness
9.0/10
clarity
9.0/10
trigger quality
9.0/10
examples
7.5/10
structure
9.0/10
overall
9.0/10

Comprehensive, well-scoped coverage of cobra with clear mode-based workflows, a strong mistakes table, and precise triggers including import-path matching. Inline examples are brief but effective, with depth delegated to well-organized reference files; cross-references to sibling skills are excellent.

allowed-tools

Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch mcp__context7__resolve-library-id mcp__context7__query-docs Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__*

Files (8)

evals/evals.json · 19.1 KBLICENSE · 1.0 KBreferences/commands-and-args.md · 5.5 KBreferences/completions.md · 4.4 KBreferences/flags.md · 4.3 KBreferences/generators.md · 2.5 KBreferences/testing.md · 4.3 KBSKILL.md · 10.2 KB