optimize-cli-for-agents
Installation
SKILL.md
optimize-cli-for-agents
Make CLIs reliable for agent use. The priorities are stable machine output, semantic exit codes, non-interactive operation, explicit recovery paths, and help text that an agent can treat as an API contract. For workflows that improve outputs over multiple passes, design the CLI as an iterative feedback loop instead of a one-shot command.
When To Use
Use this skill when:
- an agent keeps failing to parse a CLI result
- stdout mixes JSON with progress text
- every failure exits
1with no structured error body - a command hangs waiting for interactive confirmation
- a workflow involves generated artifacts that must be validated, corrected, and resubmitted
- you are designing a fresh CLI and want agent-first constraints from day one
- you need to decide whether a workflow should stay CLI-first, move to MCP, or split into a hybrid
If the user is choosing between CLI, MCP, skills, or a hybrid, read references/mcp-vs-cli-decision.md before recommending an interface.