From rust-skills
Implement Rust command-line tools after the project shape is chosen, including argument parsing boundaries, command dispatch, stdin/stdout/stderr behavior, exit codes, configuration input, error messages, tests, and Cargo validation. Use for Rust CLI feature work, CLI refactors, or new binary crate implementation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/rust-skills:build-cli-projectThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Implement Rust command-line behavior with a clear boundary between user input, command execution, domain logic, and output.
Implement Rust command-line behavior with a clear boundary between user input, command execution, domain logic, and output.
The practical goal is a CLI that is easy to test, has descriptive operator-facing messages, and validates with the repository's Cargo commands.
Use repo-local Rust files, checked-out dependency sources, Dash MCP or Dash HTTP for installed Rust and Cargo docsets, and then official Rust and Cargo documentation when Dash/local coverage is missing or stale:
std::process::ExitCodestd::env::argsFor third-party argument parsers, error crates, config crates, terminal styling, or snapshot tools, prefer the repository's existing dependencies first. Add a new crate only when it removes real implementation complexity and comes from a fetchable registry or repository.
Cargo.tomlsrc/main.rssrc/bin/src/lib.rstests/ or near command codeUse the standard library for small internal tools when argument parsing is simple.
Use the repo's existing parser or error-handling crate when one is already established. If adding a new dependency, explain:
Do not add a CLI framework only because one is popular.
Prefer fast tests around parsing and command execution functions:
#[test]
fn parses_verbose_flag() {
let command = parse_args(["tool", "--verbose", "input.txt"]).unwrap();
assert!(command.verbose);
}
Use process-level integration tests only for behavior that truly depends on the executable boundary, such as stdout, stderr, current directory, environment, or exit status.
Keep error-message tests focused on stable user-facing text.
Choose the narrowest command that proves the change:
cargo test -p package-name
cargo clippy -p package-name --all-targets --all-features
cargo fmt --check
Use workspace-wide commands when the CLI change crosses package boundaries.
Return:
Command surface: subcommands, flags, inputs, outputs, and exit behavior changed.Implementation boundary: what lives in parsing, execution, domain logic, and output code.Dependencies: reused, added, or intentionally avoided dependencies.Tests: unit, integration, or process-level coverage added or recommended.Validation: exact Cargo commands run or skipped with the concrete reason.Next skill: usually rust:testing-workflow, rust:tooling-style-workflow, or rust:package-workflow.std::process::exit deep inside reusable functions.failed without naming the operation and likely cause.Creates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.
npx claudepluginhub gaelic-ghost/socket --plugin rust-skills