skills/rust-cli-clap/SKILL.md
Implicit Rust CLI and Clap skill. Use for command-line apps and tools, clap derive or builder APIs, subcommands, flags, config and env precedence, stdin/stdout/stderr contracts, JSON output, exit codes, completions, manpages, shell UX, CLI tests, and binary distribution.
npx skillsauth add bjornmelin/dev-skills rust-cli-clapInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build Rust command-line tools that are predictable, scriptable, pleasant in terminals, and easy to ship.
Cargo.toml, src/bin, clap definitions, integration tests, snapshots, release scripts, and README examples.clap derive for ordinary CLIs. Use the builder API when commands are generated dynamically, hidden/unstable command surfaces need custom construction, or macros make the shape harder to read.--json/machine output where automation is expected, and stable exit codes.Open only the section needed for the task:
references/clap-parser-playbook.md for clap derive/builder design, argument groups, validators, completions, and migration notes.references/terminal-contracts.md for stdout/stderr, color, progress, config precedence, error messages, and shell automation rules.references/testing-packaging.md for assert_cmd, trycmd, snapshots, binaries, completions, manpages, cargo-dist, and release checks.clap = { features = ["derive", "env"] } when environment variables are part of the contract; otherwise avoid unused features.camino or Utf8PathBuf only when UTF-8 paths are an explicit invariant. Otherwise keep PathBuf.anstream/anstyle or clap styling for color-aware output; respect NO_COLOR, CLICOLOR, and non-TTY behavior.tracing for diagnostics when the CLI has subcommands, network calls, daemon/client modes, or hidden debugging flags.thiserror for domain errors and miette or color-eyre at the presentation boundary only when rich reports add value.For CLI changes, prefer the smallest ladder that proves the contract:
cargo fmt --all --check
cargo test --all-targets
cargo clippy --workspace --all-targets --all-features -- -D warnings
Add focused command tests for new flags, output modes, exit codes, config precedence, and examples shown in docs. Snapshot CLI output only after normalizing volatile paths, timestamps, colors, and ordering.
development
Pre-PR multi-model review, parallel opus and codex exec adversarial lanes, then adversarial verification of merged findings. Read-only. Use before shipping nontrivial diffs.
tools
Independent gpt-5.6 diff review via the Codex CLI, normal or steerable adversarial with JSON findings. Use before shipping nontrivial changes.
development
Delegate implementation, investigation, or bulk work to gpt-5.6 codex via pinned codex exec. Use for clear-spec builds, migrations, debugging, or any task MODELS.md routes to codex.
development
Adversarial pre-mortem: imagine the plan failed, work backwards to surface risky assumptions + irreversible bets, then harden them. Proactively offer it (after the current request; confirm first) before a hard-to-reverse or one-way-door call (API, schema, framework, a hire), an all-upside plan, or unvalidated assumptions. Also on request.