| name | cli-agent-friendly-audit |
| description | Audit a CLI tool against the agent-friendliness checklist from Zbigniew Sobiecki's "Building Agent-Friendly CLIs". Use when the user says "quality-cli-agent-friendly-audit", "cli-agent-friendly-audit", "audit this cli", "is my cli agent-friendly", or asks to check a CLI for agent ergonomics. |
quality-cli-agent-friendly-audit
Walk through a checklist of properties that make a CLI smooth for AI agents to use. Based on Zbigniew Sobiecki's "Building Agent-Friendly CLIs" (https://zbigniew.me/writing/building-agent-friendly-clis/).
How to run
- Ask the user which CLI to audit (binary name, repo path, or command to invoke). If they've already named one, skip the question.
- Probe the CLI where possible — run
<cli> --help, <cli> <subcommand> --help, try --json, try a deliberately wrong flag, try a typo, inspect exit codes with echo $?. Don't run anything destructive.
- Walk the checklist below in order. For each item, record one of: Pass, Fail, Partial, N/A, Unknown (couldn't verify without source/more probing). Include a one-line note with the evidence or the specific fix.
- At the end, print a short summary: top 3 fixes ranked by impact on agent token/latency cost.
Keep the audit terse. One line per item is usually enough. Don't lecture — the user knows what good looks like.
The checklist
Discovery
Command shape
Auth (if remote)
Structured output
Pagination
Stream hygiene
Terminal control
Mutations return enough
Identifiers
Large inputs
Exit codes
Errors
Interactive prompts
Agent skill / docs
Output format
Render the audit as a markdown table with three columns: Item, Status, Note. Group by section. At the end add:
## Top fixes (ranked by agent-impact)
1. ...
2. ...
3. ...
Bias the ranking toward fixes that compound across thousands of invocations — stream hygiene, JSON purity, exit code taxonomy, and mutations returning enough info usually beat cosmetic polish.