/nlsmdn:review-cli [--staged | --unpushed | --changed | --all | --multi]from nlsmdn
Language-agnostic review of a command-line tool's interface and behaviour — exit codes and signals, broken-pipe handling, stdout/stderr discipline, TTY detection and destructive-action gating, dry-run integrity, partial failure and idempotency, config precedence, flag and help design, and error messages that name the next action. Starts by RUNNING the binary, because most of this is invisible in the source. Applies equally to Python, Rust, Go, Node and shell-invoked tools. Auto-invoked by `code-review` on projects that ship a console entry point. Triggers "review cli", "cli review", "command line interface review", "review the CLI UX".
Ships in nlsmdn. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Review of the interface a command-line tool presents, not the language it is written in. The checks below are the same for a Python CLI and a Rust one; only the fixes differ, and §8 carries those.
Complements review-<language> skills (which review the code) and review-interfaces (which
reviews function and module signatures, not the CLI surface). Don't repeat either.
Use only these finding priorities, in descending order:
Grade the demonstrated consequence, realistic reachability, and available recovery against project priorities. A category, missing convention, hypothetical future problem, or confidence that a claim is true does not set its priority. Do not assign automatic severity floors or ceilings. Keep unverified claims in validation gaps, outside the graded finding count; distinguish suggestions from defects. For plans, trace the consequence if implemented and state the assumptions.
Use the short labels Must Fix, Should Fix, and Nice to Have in summaries and ledgers.
Keep effort, verification status, user-facing change size, and tool/vendor diagnostic ratings
separate. When called by code-review, return its requested evidence and impact fields; the parent
owns scoring and final triage. Otherwise apply this rubric directly. Omit empty priority sections.
There is essentially no tooling for this layer. That is not an assumption — a search across four phrasings for a CLI-design linter turned up clig.dev itself, generic static-analysis round-ups, and no tool. ShellCheck analyses shell scripts, i.e. programs written in bash; it says nothing about the interface a compiled or Python program presents. Neither ruff nor clippy ships a CLI-conventions rule set.
Two narrow exceptions worth knowing:
clippy::print_stdout and
clippy::print_stderr are restriction lints — off by default, but a crate can turn them on and
#[allow] the handful of genuine output sites. When reviewing a Rust CLI, recommend enabling
the lint rather than listing instances one by one.clap::Command::debug_assert() catches duplicate short flags and conflicting requirements —
definition consistency, not design.So this skill carries more weight than a language review does, and its findings must be earned by evidence, since nothing else will catch a mistake here and nothing else will catch a false positive either.
A CLI's design is decided once; its behaviour regresses continuously. So the default review
looks only at what the diff introduces — a new subcommand, a new output path, a new destructive
operation, a new prompt. One-time properties (does --version exist, does --help carry
descriptions, are config roots XDG-correct) belong to the project-level set in §P, which runs
at --all and nowhere else. Re-checking those on every diff is noise, and it buries the findings
that matter.
Most CLI behaviour is invisible in the source, so run the thing rather than reading it — but scope the probing to the change:
head and check stderr
is empty. If it adds a destructive operation, run it with < /dev/null. If it adds --json
output, pipe it through jq.--all only: the full probe table in §P.The pipe probe needs output larger than the pipe buffer (~64 KB) or it silently passes. Use the largest output the changed command can produce.
A probe you could not run (no build, no fixture data) is reported as not run, never as passing.
/review-cli # Review context-related code
/review-cli --staged # Review staged changes
/review-cli --unpushed # Review files changed across all unpushed commits
/review-cli --changed # Review unstaged changes
/review-cli --all # Full CLI surface audit (the natural scope for this skill)
/review-cli --multi # Also get external advisor opinions
| Flag | Scope | Method |
|---|---|---|
| (none) | Context-related code | Files from the current conversation context, plus the CLI entry point and argument definitions regardless of scope — a diff to one subcommand is reviewed against the whole interface it joins. |
--staged | Staged changes | git diff --cached --name-only |
--unpushed | Files changed across unpushed commits | git diff --name-only $(git rev-list HEAD --not --remotes | tail -1)^..HEAD |
--changed | Unstaged changes | git diff --name-only |
--all | Whole CLI surface + §P project-level checks | Entry point, argument definitions, every subcommand handler, output and prompt helpers |
--multi | Add external opinions | Combines with any scope above; invokes second-opinion --quick |
Only --all runs §P. At every other scope the review covers §1–§8 against what the diff
introduces, and a §P finding is out of scope even if you notice it — note it in one line at the end
if it is severe, but never as a review finding.
Determine scope and locate the entry point and argument definitions.
Run the Step 0 probes. Record results.
Read AGENTS.md / CLAUDE.md / README — the README matters unusually much here, because a
gap between what it documents and what --help says is itself a finding (§6).
Review against §1–§7. Load references/conventions.md for the normative sources and the
contested list; load references/language-notes.md when writing a fix.
Parallelize if the CLI has many subcommands: one sub-agent per category, merge and dedupe.
External opinions (if --multi): invoke second-opinion --quick with this prompt:
Read-only review of a command-line tool's interface, not its implementation language. No
linter covers this layer, so nothing is out of scope for being mechanical. Focus on: does a
destructive command have a gate, and is whatever justifies skipping it available on every code
path that reaches it? Does the tool refuse rather than assume when stdin is not a terminal?
Does it ever report an action that did not happen? Do exit codes distinguish failure classes
without colliding? Is primary output on stdout and every diagnostic on stderr? Does a dry-run
flag reach the lowest write primitive or just the command handler? If it dies halfway, what is
left behind and is a re-run safe? Do errors say what to do next? 300 words or less.
Wait for all external results before proceeding.
Classify severity and report, grouped by severity.
head keeps
writing after the reader exits. If SIGPIPE is ignored (which both Python and Rust do by default),
the write fails and surfaces as a traceback or panic on stderr plus a wrong exit code. Check
every CLI for this; the fix is language-specific (§8). The symptom differs: Python prints a
BrokenPipeError traceback and exits 1; Rust prints a panic and exits 101, which is
indistinguishable from a genuine bug — a Rust CLI reporting 101 in a bug report should make you
suspect this first.sysexits.h — see the contested list.doctor command, say). Check that the
compensating channel exists before calling it a bug — and check it exists before calling it fine.--help to stderr is wrong, and so is one that prints a usage error to stdout. This
one has a definite answer; see the contested list for why the folklore says otherwise.--json/--plain has implicitly made its pretty output an API. Check that machine output
carries a schema version the consumer can branch on, and that nothing else is interleaved on
stdout when it is active.NO_COLOR is set and non-empty regardless of its value.
Check stdout and stderr independently: piping stdout does not mean stderr colour is unwanted.
If the tool emits no colour at all, this whole item is moot — don't invent it.--yes/--force → proceed; interactive terminal → prompt; otherwise →
refuse with a message naming the flag that would have worked. Checking that both stdin and
stderr are terminals is stricter than the common stdin-only check and is right.input()/read crashes under < /dev/null and in CI. Check every prompt, not the
first one; these are usually copy-pasted, and the guard is usually on some of the copies.--confirm=<name> so it stays scriptable, is the design that satisfies both.if not dry_run: at each call site is a promise a future caller will forget.
In a typed language, ask for the stronger form: pass an effect enum or a writer into the
backend so a path that writes without consulting it fails to compile.fsynced before the rename decides whether a power cut yields a truncated file.
Check especially where the tool rewrites files it does not own.--help still works on a machine with a broken
config file. Easy to get backwards, trivial to check.Per-change: a new setting must join the existing precedence chain, not start a second one. If the diff reads an environment variable or a config key directly instead of going through the project's one resolution function, that is the finding — a second copy of the order is how precedence drifts. Whether the order itself is right, and whether config lands in the correct XDG root, is §P.
Also per-change: a new secret read from a flag (it leaks into ps and shell history) or from an
environment variable. A --password-file or stdin is the shape.
Per-change, all of these are about the new surface agreeing with the surface it joins:
--json on three subcommands and not the
fourth. A consistency promise already made is a defect to break; one never made is a scope
decision.nope — configured project(s): demo"
is a finding-free error. A bare string with no remedy is the defect. The fuller shape worth
aiming at: what failed, why, and how to fix it, plus a code or URL when there is one.--all onlyThese are decided once and almost never regress. Run them on a full audit; never report them on a diff review, where they are noise that buries the real findings.
The full probe table:
| Probe | Expected |
|---|---|
cmd --help; echo $? | Help on stdout, exit 0. GNU: "output brief documentation for how to invoke the program, on standard output, then exit successfully." |
cmd --bogus >/dev/null; echo $? | Usage error on stderr, non-zero (2 by convention) |
cmd --version; echo $? | Prints a version, exit 0 — a version subcommand alone fails every script and packaging tool that probes for the flag |
cmd <long output> | head -1 | No traceback, no panic, empty stderr |
cmd | cat -v | grep -c $'\e\[' | 0 — colour off when not a TTY |
NO_COLOR=1 cmd | cat -v | grep -c $'\e\[' | 0 |
cmd --json | jq . | Valid JSON, nothing else on stdout |
cmd -- -weirdname | -- terminates option parsing (POSIX Guideline 10) |
echo x | cmd - | - means stdin (POSIX Guideline 13) |
| Ctrl-C during a long run | Exits promptly; a second Ctrl-C escapes cleanup |
Plus, read once:
--help carry what the README carries? A CLI whose subcommands have no descriptions
while the README documents all of them has put its documentation where the user isn't.main covers every write site (§8).which/debug command that reports the resolution?$XDG_STATE_HOME holds data that persists between restarts but is "not important or
portable enough to the user that it should be stored in $XDG_DATA_HOME" — history, logs,
last-used selections. Credentials and user-authored content are data. The test: would the user
want this back on a new machine?--dry-run where the destructive surface warrants one?The checks above are identical everywhere. These fixes are not — load
references/language-notes.md before writing one. The three that most often change the finding
itself:
| Concern | Python | Rust |
|---|---|---|
| Broken pipe | Catch BrokenPipeError, dup2 stdout to devnull, exit 1. The Python docs explicitly advise against signal.signal(SIGPIPE, SIG_DFL) | No stable language-level fix. #[unix_sigpipe] no longer exists as a feature name; -Zon-broken-pipe is nightly-only. Either libc::signal(SIGPIPE, SIG_DFL) in an unsafe block first thing in main, or match ErrorKind::BrokenPipe on a locked buffered writer |
| Exit mechanism | sys.exit(n); a signal-killed child's negative status must be normalized before it becomes the exit code | Three mechanisms with different semantics. Returning Result from main prints the Debug form and exits 1 — a real UX defect. process::exit skips destructors, weakening any lock guard or temp-file cleanup. ExitCode is the right default |
| Error chaining | raise X from e; the interpreter prints the chain | Nothing prints the source chain automatically, so one-level Display drops it. Stringifying an I/O error also discards the path and ErrorKind — a much more expensive mistake than in Python |
The reference also covers stream discipline (Rust can turn this into a compile gate; Python can't), dry-run enforcement, atomic writes, env precedence, and file locking.
--version, thin --help, XDG placement and
precedence structure are project properties; they have not changed because this diff didn't touch
them, and reporting them every time trains the reader to skim.--json on a tool with no machine consumers, or NO_COLOR handling on a tool that
emits no colour. Both are real rules with a precondition; check the precondition.--long has no POSIX basis at all; 7 forbids optional
option-arguments; 9 requires options before operands. Git, docker and cargo all violate these
deliberately. Guidelines 4, 10 and 13 are the durable ones.sysexits.h — deprecated by the BSD that originated it, documented neutrally
by Linux, still recommended by the Rust CLI Book. No consensus; don't manufacture one.## CLI Review: {scope}
### Baseline
{Probes you ran and what happened, including any you could not run and why. Language and argument
library. **At `--all` only:** the §P results. On a diff review, omit this block unless a probe you
ran actually failed.}
### Critical Issues (Must Fix)
- {file}:{line} — {category}: {description}
**Probe:** {the command and its actual output, where a probe found it}
**Impact:** {what breaks, for whom}
**Fix:** {concrete change — with code, in this project's language}
### Improvements (Should Fix)
- {file}:{line} — {category}: {description}
**Fix:** {solution}
### Suggestions (Nice to Have)
- {file}:{line} — {category}: {description} — {suggested change}
If --multi was used, append one subsection per advisor that responded (titled with the advisor's
name as reported by second-opinion), then a Cross-Model Agreement subsection.
A gate that only covers half the paths:
/review-cli --all
rm has no confirmation, no --yes and no --force. The justification is an undo command — but
undo is only wired for one of two storage backends, and on the other it returns "this backend
does not support undo". Reports Must Fix: on that backend rm is unprompted and unrecoverable.
The finding needs reading the gate, the thing that justifies its absence, and every construction
path of that thing — three places, none of which look wrong alone.
Broken pipe, found by probe not by reading:
/review-cli
cmd ls | head -3 prints three rows and then panics — failed printing to stdout: Broken pipe,
exit 101. Nothing in the source mentions SIGPIPE, and nothing looks wrong: it is a plain print in
a loop. Reports Should Fix with the one-line fix for the language, and notes that exit 101 will be
misread as a genuine bug in any report.
Success message for a no-op:
/review-cli --changed
uninstall --consumer <typo> removes nothing, then reports "removed consumer (last
consumer; hooks and active binary removed)" and exits 0 — having actually torn down the shared
hooks, because zero registered consumers remain. The idempotent remove is correct; the message is
the defect. Reports Must Fix: a misspelled argument performs a full teardown and reports success.
Solution: Review §2–§7 from the source and say in the Baseline that probes were not run. Do not infer probe results from reading — the whole point of Step 0 is that these behaviours don't appear in the source. Ask the user for a build command or a fixture project rather than guessing.
Solution: The output fit in the pipe buffer (~64 KB), so the writer never saw the closed pipe. Re-run against the largest output the tool can produce, or a project with real data in it. A tool can be exposed by construction and shielded only by volume — that is still a finding, because the volume is the user's data, not a property of the tool.
Solution: Check whether the tool's own conventions imply it. A CLI that offers --json on
three subcommands and not the fourth has made a consistency promise; one that offers it nowhere
has made a scope decision. Same for --dry-run, short flags, and confirmation prompts. Report the
first as a defect and the second as a suggestion, if at all.
--help is a finding in its own right.<signal.h>; the GNU Coding Standards on --help and --version; the XDG Base Directory
Specification; no-color.org; the GNU Bash manual on exit status; the Python signal docs' note
on SIGPIPE; the Rust CLI Book and the -Zon-broken-pipe documentation; 12 Factor CLI Apps; git's
--porcelain stability wording. Quoted lines and the contested list are in
references/conventions.md.What SKILL.md sets; muted values are Claude Code's defaults
highnpx claudepluginhub nielsmadan/skills --plugin nlsmdn65 skills in this plugin
/blind-spotsSurface consequential decisions a plan, design, or research brief left silently assumed, by interviewing the user in dependency order. Use when the user says "blind spots", "grill me", "stress-test this plan", "poke holes in this", "what am I missing", "interrogate this design", "what haven't I decided", or needs a loose idea or research brief clarified before work begins. Do NOT use for a clear factual lookup, to explain a previous reply in more detail (use `huh`), to generate ideas when it is unclear what to build (use `ideation`), or to review an already-written plan with agents (use `review-plan`)./brainstormWork out how to solve a problem the user can already name — interview them with `blind-spots` to understand it, generate structurally different approaches, validate each with an independent critic, then present the survivors with trade-offs and a recommendation. Use when the user says "brainstorm", "brainstorm approaches", "how should we solve/approach/tackle X", "what are our options", "compare approaches", "think this through with me", or wants solutions weighed before committing. Works on any topic, with codebase recon when a repo is involved; `--debate` adds external advisors for high-stakes calls. Do NOT use when stuck on what to build or what the problem is (use `ideation`), to probe an already-chosen plan (use `blind-spots`), or to pick a library or service (use `evaluate-tech`).