What problem does it solve? Building a Go CLI with cobra involves many subtle decisions — RunE vs Run, hook inheritance, flag scoping, arg validation, and testable output — and getting them wrong leads to untestable commands, broken error handling, and confusing help output. ## Core Features & Use Cases - Command tree construction: Step-by-step guidance for designing the root command, registering groups before subcommands, wiring RunE hooks, and declaring Args validators. - Flags, completions, and docs: Covers persistent vs local flags, required/mutually-exclusive constraints, dynamic shell completions via ValidArgsFunction, and man/markdown doc generation. - Testing and review workflows: Patterns for testing commands with SetArgs/SetOut/SetErr on fresh trees, plus a review checklist for hook ordering and output plumbing. - Use Case: You are adding a serve subcommand to an existing Go CLI. Use this Skill to place it in the right group, scope its flags locally, add flag completion, and write table-driven tests against a freshly built command tree. ## Quick Start Ask the AI to add a new subcommand with flags and tests to your cobra-based Go CLI following this skill.