add-cli-commandlisted
Install: claude install-skill tmj-90/gaffer
# Add a CLI command
A CLI is an API whose consumers are humans at a terminal and scripts in a pipeline.
Scripts depend on the exit code, the stdout format and the flag names; humans depend on
the help text and error messages. Follow the tool's existing conventions first and the
Command Line Interface Guidelines (clig.dev) where the tool is silent.
## Steps
1. **Read a sibling command.** Find the entry point and command registry (Commander,
yargs, Click, Typer, Cobra, clap, picocli, System.CommandLine) and copy an existing
command's parsing, validation, output and exit handling. Call `search_lore` for the
CLI's JSON envelope, error format and exit-code table.
2. **Design the surface and write `--help` first.** Match the tool's naming (`ticket
create`, not `createTicket`). Positional arguments only for the one thing the command
acts on; everything else is a long flag, with a short alias only where siblings use
one. Reuse standard names: `-h/--help`, `--version`, `--json`, `-q/--quiet`,
`-f/--force`, `-n/--dry-run`, `--no-input`, `--no-color`. Help leads with a usage
line and one or two examples. If the help is hard to write, the surface is wrong.
3. **Validate before doing any work.** Parse and validate every argument, reject
unknown flags, and fail with a one-line message naming the bad input and the fix.
Exit codes: `0` success, non-zero on any failure, and the tool's usage-error code
(commonly `2`) for bad arguments. Never exit 0 after pri