Install any skill in seconds. Free to start, no credit card required.
Get Started Free →hashgraph-online/go-cobra-applications
Build, refactor, test, and review Cobra-based Go applications with intentional command trees, fresh constructors, suggestions, typed boundaries, scoped flags, local or remote configuration, explicit precedence, safe live reload, context propagation, stable streams, shell completion, and generated documentation.
Passed 22 of 22 test cases with the skill, and 21 of 22 without it.
1 fixed21 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
I need to write a Go CLI application using Cobra for managing database migrations. Please write the scaffolding code for the root and subcommands (up, down, status), demonstrating how CLI arguments, flags, and environment variables should be resolved into a typed configuration struct for execution.
| Checked | Without skill | With skill |
|---|---|---|
| The root command and subcommands are created using constructor functions instead of package-level variables. | Missed | Passed |
| The subcommands and flags are registered inside constructor functions rather than in init() functions. | Missed | Passed |
| The flags, environment variables, and config file values are parsed into a single validated Go configuration struct. | Missed | Passed |
The instructions your model reads when the skill loads.
Keep Cobra and Viper at the application edge. Construct a fresh command tree per execution and translate CLI state into typed application calls.
| Task | Load |
|---|---|
| Build or restructure a Cobra application | guidelines.md, workflows/build-cobra-command-tree.md |
| Apply command-tree, flag, config, and testing rules | references/cobra-applications/rules.md |
| Use constructors and focused implementation examples | references/cobra-applications/examples.md |
| Inject services or resolve configuration | references/cobra-applications/patterns.md |
| Review a Cobra/Viper application | references/cobra-applications/checklist.md |
| Understand architecture, completion, and docs | references/cobra-applications/knowledge.md |
init-driven application wiring.Guidance is transformed and paraphrased from Ricardo Gerardi, Powerful Command-Line Applications in Go (Pragmatic Bookshelf, 2021),
test cases passed, vs 21 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.