← ClaudeAtlas

add-cli-commandlisted

Use when a ticket adds or changes a command-line interface — a new subcommand, flag, or output format for the repo's CLI tool — and it must follow the CLI's existing conventions for arguments, exit codes, JSON output, help text, and tests. Invoke for "add a `foo bar` command", "add a --json flag", "the CLI should print X", or any change under a cli/ or bin/ entry point.
tmj-90/gaffer · ★ 1 · AI & Automation · score 70
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