What problem does it solve? Go developers building CLIs with spf13/cobra frequently misuse its API: using Run instead of RunE, writing manual len(args) checks, printing to os.Stdout, or losing parent hooks when a child defines PersistentPreRunE. This Skill encodes the correct patterns so generated and reviewed cobra code follows the library's intended design. ## Core Features & Use Cases - Command tree construction: root command setup, AddCommand/AddGroup ordering, SilenceUsage/SilenceErrors, and the full PersistentPreRunE → PreRunE → RunE → PostRunE → PersistentPostRunE hook chain with inheritance rules. - Args and flags: built-in validators (NoArgs, ExactArgs, MatchAll), persistent vs local flags, StringArray vs StringSlice, MarkFlagsMutuallyExclusive/RequiredTogether/OneRequired, and Changed() for explicit-value detection. - Completions, docs, and testing: ValidArgsFunction, RegisterFlagCompletionFunc, ShellCompDirective, man/markdown doc generation, cobra-cli scaffolding, and test isolation with SetArgs/SetOut/SetErr. - Use Case: Ask the agent to add a 'delete' subcommand requiring exactly one validated resource argument with dynamic shell completion, and it produces idiomatic cobra code with ExactArgs, ValidArgsFunction, and RunE error propagation. ## Quick Start Ask the agent to create or review a cobra-based Go CLI command, for example to add a subcommand with validated arguments, flag constraints, and shell completion.