cli-review-runner
Original:🇺🇸 English
Translated
5 scripts
Use this skill whenever reviewing, auditing, or grading a command-line tool for agent-friendliness - it runs a black-box test suite against a target CLI and reports per-rule pass/fail from the cli-for-agents 45-rule catalog. Trigger even if the user doesn't explicitly say "agent-friendly" - apply whenever they ask "is mycli good for agents?", "review this CLI", "grade my cli against the rules", "check if this tool is safe to automate", or "audit command-line design". Companion to the cli-for-agents distillation skill.
19installs
Sourcepproenca/dot-skills
Added on
NPX Install
npx skill4agent add pproenca/dot-skills cli-review-runnerTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →cli-review-runner
Automates the 10-item agent-friendliness audit from cli-for-agents. Runs black-box probes against a target CLI and emits a structured report mapping each finding to a rule ID (e.g., , , ). Default mode is read-only - probes never run destructive verbs with real arguments.
help-examples-in-helperr-non-zero-exit-codessafe-dry-run-flagWhen to Apply
- User asks to review or audit a CLI for agent-friendliness, automation readiness, or CI use
- User has just finished building a CLI and wants a pre-ship sanity check
- User is grading their own or a third-party CLI against the cli-for-agents catalog
- User is asking why a CLI is hanging an agent, blowing up context, or failing to compose in a pipeline
- PR review for a CLI change - quickly regress-test the , errors, and dry-run flags
--help
How to Use
The skill is orchestrated by . Point it at the target CLI (absolute path or PATH-resolvable name) and pick an output format.
scripts/review.shbash
# Default: text table on stdout, exit 0 if all passed, 1 if any failed
bash scripts/review.sh --target /usr/local/bin/mycli
# Machine-readable output
bash scripts/review.sh --target gh --format json
bash scripts/review.sh --target kubectl --format ndjson
# Supply subcommand list when auto-discovery misses them
bash scripts/review.sh --target gh --subcommands pr,issue,repo
# Preview what would run without touching the target CLI
bash scripts/review.sh --target mycli --dry-run
# Include risky probes on destructive verbs (off by default)
bash scripts/review.sh --target mycli --include-destructiveSee for the full flag list.
bash scripts/review.sh --helpWorkflow Overview
--target <cli>
│
▼
[1] Validate target fail fast if path missing or not executable
│
▼
[2] Load rule catalog references/rule-catalog.tsv (45 rules)
│
▼
[3] Discover subcommands parse top-level --help (gh/kubectl/commander shapes)
│
▼
[4] Run probes P1..P10 each probe emits NDJSON findings to a temp file
│
▼
[5] Render report scripts/render.sh -> text | json | ndjsonRead references/workflow.md when you need the full probe-by-probe breakdown, failure modes, and how to extend the catalog.
Probe Coverage
| Probe | Rules tested | Coverage |
|---|---|---|
| P1 Non-interactive | | Run under |
| P2 Layered help | | Top-level line count; per-subcommand |
| P3 Help examples | | Grep each subcommand help for |
| P4 Actionable errors | | Invoke with bogus flag; grep stderr for fix + example; check for raw stack traces |
| P5 stderr channeling | | Error text must land on fd 2 |
| P6 Exit codes | | Usage error and runtime error must produce distinct non-zero codes |
| P7 stdin composition | | Grep help for |
| P8 Structured output | | |
| P9 Destructive safety | | Inspect destructive verbs' |
| P10 Command structure | | Uniform shape, |
Coverage: 30 of the 45 rules in cli-for-agents are black-box testable. The remaining 15 (idempotency, state reconciliation, NDJSON streaming, bounded output, crash-only recovery, env-var fallback, secret-stdin, confirm-by-typing-name) require either real invocation or source-code inspection - the report lists them as "manual review required".
Configuration
config.jsonjson
{
"timeout_seconds": 5,
"safe_verbs": ["list", "get", "show", "status", "describe", "help", "version", "config", "ls", "inspect"],
"destructive_verbs": ["delete", "drop", "destroy", "remove", "reset", "purge", "rm", "del"]
}Safety Model
All probes are read-only by default:
- Safe verbs (list, get, show, ...) may be invoked with bogus flags to test error handling
- Destructive verbs (delete, drop, ...) are ONLY inspected via - never executed with arguments
--help - Every probe runs with a 5-second wall-clock timeout under
</dev/null - The target CLI is sandboxed to its own process; no shell metacharacters in arguments
When is passed, probes may invoke destructive verbs with bogus flags too. This exposes the rare case where a CLI does something destructive before validating flags. Only enable this against CLIs you trust, or in a disposable test environment.
--include-destructiveSelf-test
Before shipping changes to probes, run the self-test - it generates a mock CLI that deliberately violates specific rules and asserts the probes detect them:
bash
bash scripts/selftest.shExpected output: . Any failure points at a regression in .
Results: 8 passed, 0 failedscripts/lib/probes.shFiles
| File | Purpose |
|---|---|
| scripts/review.sh | Main entry point - orchestrates probes, renders the report |
| scripts/render.sh | Output formatter: text / json / ndjson |
| scripts/selftest.sh | Sanity check against a deliberately-buggy mock CLI |
| scripts/lib/common.sh | Shared helpers: timeout, verb classifier, JSON escape, catalog loader |
| scripts/lib/probes.sh | Probe functions |
| references/rule-catalog.tsv | 45 rules from cli-for-agents, mapped to probes |
| references/workflow.md | Detailed probe-by-probe methodology, failure modes, extension guide |
| gotchas.md | Known edge cases discovered during use |
| config.json | Verb classifier lists and default timeout |
Related Skills
- cli-for-agents - the 45-rule design catalog this skill audits against. Read rule files there when the report flags an issue and you need the full explanation.