Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Design and review predictable Go command-line interfaces with canonical names and flags; explicit inputs and precedence; human, plain, and structured output; safe prompting; stdout and stderr contracts; help; errors; exit codes; cancellation; dependency injection; and platform behavior. Use when creating a Go CLI, changing its public command contract, making command code testable, or reviewing compatibility for people, scripts, AI agents, and CI.
.claude/skills/hashgraph-online-go-cli-command-design/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 23% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 31% | 0% |
| case-08 | ✓→✗ | ▼ Worse | 40% | 0% |
| case-02 | ✓→✓ | = Same ✓ | -7% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 14% | 0% |
Design the command as a public interface before treating it as an implementation. Keep results pipeable, failures diagnosable, and process-global state at the edge.
invalid-usage help, and progress.
| Task | Load | |---|---| | Design or change a complete command contract | guidelines.md, workflows/design-command-interface.md | | Implement flags, streams, environment, or errors | references/command-interface/rules.md, references/command-interface/examples.md | | Understand the design rationale | references/command-interface/knowledge.md | | Review an existing command | references/command-interface/checklist.md |
flag.FlagSet over package-global flags in reusable code.os.Exit below the outer process boundary.Guidance is transformed and paraphrased from Ricardo Gerardi, Powerful Command-Line Applications in Go (Pragmatic Bookshelf, 2021), especially Chapters 1-2. Examples are original adaptations.
Modern interaction, cancellation, and output-mode guidance also incorporates transformed material from Marian Montagnino, Building Modern CLI Applications in Go (Packt, 2023), especially Chapters 1, 5, 8, and 10.
Book: https://pragprog.com/titles/rggo/powerful-command-line-applications-in-go/
Modern API details should be verified against https://pkg.go.dev/flag and the current Go documentation before implementation.
Parser grammar and validation guidance also incorporates transformed material from Inanc Gumus, Go by Example: Programmer's Guide to Idiomatic and Testable Programs (Manning, 2025), Chapter 4.
Other measured skills in the registry, with their headline benchmark lift.