Patterns for building production-quality CLI tools with predictable behavior, parseable output, and agentic workflows. Triggers: cli tool, command line tool, build cli, cli patterns, agentic cli, cli design, typer cli, click cli.
87
Quality
86%
Does it follow best practices?
Impact
94%
1.64xAverage score across 3 eval scenarios
Passed
No known issues
Stream separation and JSON output schema
stdout data only
100%
100%
Rich stderr
0%
100%
JSON list schema
40%
100%
JSON single-item schema
62%
100%
JSON error schema
0%
100%
Error on stderr too
0%
100%
NOT_FOUND exit code
0%
100%
VALIDATION exit code
0%
25%
Exit code constants
0%
100%
_error helper
0%
100%
Fail fast on missing args
100%
100%
No decoration on stdout
100%
100%
Without context: $0.3613 · 1m 13s · 21 turns · 76 in / 4,754 out tokens
With context: $0.9398 · 2m 33s · 38 turns · 290 in / 9,637 out tokens
Command architecture, naming conventions, help system
Typer used
0%
100%
Tool name convention
87%
100%
Resource plural noun
100%
100%
Action verb lowercase
100%
100%
Long flag kebab-case
100%
100%
Short flag single letter
100%
100%
--version flag
60%
100%
Help has examples
100%
100%
jq pipe example
50%
100%
Command hierarchy
100%
100%
Boolean flag no value
87%
100%
Consistent --json flag
20%
100%
Without context: $0.3445 · 1m 15s · 25 turns · 29 in / 4,509 out tokens
With context: $0.9977 · 3m 6s · 39 turns · 44 in / 11,920 out tokens
Data conventions and semantic exit codes
ISO 8601 date output
100%
100%
Flexible date input
100%
100%
Money as decimal
100%
100%
Currency field included
100%
100%
No money formatting
100%
100%
IDs as strings
100%
100%
Enum UPPER_SNAKE_CASE output
0%
0%
Enum case-insensitive input
100%
100%
NOT_FOUND exit 3
0%
100%
VALIDATION exit 4
0%
100%
Correct error code string
0%
100%
Without context: $0.5375 · 1m 54s · 29 turns · 38 in / 7,402 out tokens
With context: $0.8512 · 2m 34s · 35 turns · 38 in / 9,886 out tokens
5342bca
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.