Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Design, implement, stabilize, and review Go CLI tests across fresh command trees, pure logic, table-driven cases, streams, typed configuration, files, environment, function-backed HTTP fakes, repositories, subprocesses, capability profiles, race checks, and artifact behavior. Use when adding command tests, diagnosing flaky Go tests, choosing test boundaries, or verifying human-, agent-, and CI-facing CLI contracts.
.claude/skills/hashgraph-online-go-cli-testing/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -6% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 3% | 0% |
| case-07 | ✓→✓ | = Same ✓ | -14% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 16% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 29% | 0% |
Test observable behavior at the narrowest boundary that proves it. Isolate every mutable resource and reserve executable tests for process-level semantics.
| Task | Load | |---|---| | Build or overhaul a CLI test suite | guidelines.md, workflows/test-cli-command.md | | Stabilize a flaky asynchronous test | workflows/stabilize-flaky-test.md | | Write focused command tests | references/cli-testing/rules.md, references/cli-testing/examples.md | | Add subprocess, HTTP, repository, or integration tests | references/cli-testing/patterns.md | | Review coverage, isolation, or flakiness | references/cli-testing/checklist.md | | Choose the right test boundary | references/cli-testing/knowledge.md | | Benchmark or profile performance | Use go-performance-testing |
testing/synctest only when the minimum Go version supports it and thebehavior fits an isolated bubble.
Execute errors and stream output.Guidance is transformed and paraphrased from testing material throughout Ricardo Gerardi, Powerful Command-Line Applications in Go (Pragmatic Bookshelf, 2021), especially Chapters 1-7 and 11. Examples are original.
Book: https://pragprog.com/titles/rggo/powerful-command-line-applications-in-go/
Modern test APIs should be verified against https://pkg.go.dev/testing and the current Go documentation before implementation.
Fresh command-tree, HTTP fake, configuration, and build-profile guidance also incorporates transformed material from Marian Montagnino, Building Modern CLI Applications in Go (Packt, 2023), especially Chapters 4, 6, and 11.
Subtest, coverage, parser, concurrency, HTTP server, and SQL adapter guidance also incorporates transformed material from Inanc Gumus, Go by Example: Programmer's Guide to Idiomatic and Testable Programs (Manning, 2025), Chapters 2-10.
Test categorization, race/shuffle execution, deterministic time, iotest, and benchmark-correctness guidance also incorporates transformed material from Teiva Harsanyi, 100 Go Mistakes and How to Avoid Them (Manning, 2022), Chapter 11.
Other measured skills in the registry, with their headline benchmark lift.