go-cli-command-design

Installation
SKILL.md

Go CLI Command Design

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.

Core Workflow

  1. State the command purpose, invocation syntax, callers, and compatibility promises.
  2. Assign each input to a flag, operand, stdin, environment, or config source.
  3. Define precedence, validation, conflicts, defaults, and blocking behavior.
  4. Reserve stdout for results and requested help; use stderr for diagnostics, invalid-usage help, and progress.
  5. Return errors from command logic and map exit codes at the process boundary.
  6. Inject streams, configuration, and effects behind a small testable runner.
  7. Verify help, invalid usage, operational failures, and supported target behavior.
  8. Verify noninteractive, color-disabled, canceled, and short-reading pipe behavior.

Read Next

Installs
1
Repository
lvtd-llc/skills
GitHub Stars
1
First Seen
Aug 30, 2026
go-cli-command-design — lvtd-llc/skills