rust-cli-clap
Rust CLI Clap
Build Rust command-line tools that are predictable, scriptable, pleasant in terminals, and easy to ship.
Operating Model
- Discover the existing CLI contract first:
Cargo.toml,src/bin,clapdefinitions, integration tests, snapshots, release scripts, and README examples. - Preserve user-facing command behavior unless the task explicitly asks for a breaking change. If behavior changes, update tests and docs in the same patch.
- Prefer
clapderive 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. - Design command output as an API: human output on stdout, diagnostics on stderr, deterministic
--json/machine output where automation is expected, and stable exit codes. - Keep command handlers thin. Parse into typed arguments, normalize config once, then call library code that tests can exercise without spawning a process.
Reference Map
Open only the section needed for the task:
references/clap-parser-playbook.mdforclapderive/builder design, argument groups, validators, completions, and migration notes.references/terminal-contracts.mdfor stdout/stderr, color, progress, config precedence, error messages, and shell automation rules.references/testing-packaging.mdforassert_cmd,trycmd, snapshots, binaries, completions, manpages,cargo-dist, and release checks.
More from bjornmelin/dev-skills
streamdown
|
13zod-v4
Expert guidance for Zod v4 schema validation in TypeScript. Use when designing schemas, migrating from Zod 3, handling validation errors, generating JSON Schema/OpenAPI, using codecs/transforms, or integrating with React Hook Form, tRPC, Hono, or Next.js. Covers all Zod v4 APIs including top-level string formats, strictObject/looseObject, metadata, registries, branded types, and recursive schemas.
9vitest-dev
World-class Vitest QA/test engineer for TypeScript + Next.js (local + CI performance focused)
8docker-architect
SOTA Docker/Compose architecture, implementation, refactor, and security hardening. Use when working on containerization tasks such as creating or rewriting Dockerfiles, docker-compose files, buildx/bake configs, .dockerignore, and CI pipelines for build/test/scan/publish; auditing existing container setups for security, correctness, size/perf, and best practices (least privilege, non-root, minimal images, pinned base images, BuildKit secrets, healthchecks); debugging Docker build/run issues; or designing dev vs prod compose workflows across services (DB/cache/queues) with correct networking, volumes, secrets, and resource limits.
7pytest-dev
World-class pytest engineer for Python: write/refactor tests, fix flakiness, design fixtures/markers, add coverage, speed up suites (collection/runtime), and optimize CI (GitHub Actions sharding, xdist parallelism, caching). Use when asked about pytest best practices, pytest 9.x features (subtests, strict mode, TOML config), pytest plugins (xdist/cov/asyncio/mock/httpx), or test performance/CI tuning.
6notebook-ml-architect
>
5