Agent skill · software engineering · davila7
rust-cli-builder
Plan and build production-ready Rust CLI tools using clap for argument parsing, with subcommands, config file support, colored output, and proper error handling. Uses interview-driven planning to clarify commands, input/output formats, and distribution strategy before writing any code.
Why this skill is useful
Provides domain-specific knowledge on building Rust CLI tools with clap, including planning and error handling patterns not commonly known.
What it needs
Requires rust installed locally. About 8k tokens when loaded. Last updated 2026-08-06. 30,138 stars on the source repository.
What this skill does
Rust CLI Tool Builder When to use Use this skill when you need to: Scaffold a new Rust CLI tool from scratch with clap Add subcommands to an existing CLI application Implement config file loading (TOML/JSON/YAML) Set up proper error handling with anyhow/thiserror Add colored and formatted terminal output Structure a CLI project for distribution via cargo install or GitHub releases Phase 1: Explore (Plan Mode) Enter plan mode. Before writing any code, explore the existing project: If extending an existing project Find Cargo.toml and check current dependencies (clap version, serde, tokio, etc.) Locate the CLI entry point (src/main.rs or src/cli.rs) Check if clap is using derive macros or builder pattern Identify existing subcommand structure Look for existing error types, config structs, and output formatting Check if there's a src/lib.rs separating library logic from CLI If starting from scratch Check the workspace for any existing Rust projects or workspace Cargo.toml Look for a .cargo/config.toml with custom settings Check for rust-toolchain.toml to know the target Rust edition Phase 2: Interview (AskUserQuestion) Use AskUserQuestion to clarify requirements. Ask in rounds. Round 1: Tool purpose and commands Round 2: Subcommands (if multi-command) Round 3: Configuration and output Round 4: Async and error handling Phase 3: Plan (ExitPlanMode) Write a concrete implementation plan covering: 1. Project structure — Cargo.toml dependencies, src/ file layout 2. CLI definition — clap derive structs for all commands, args, and flags 3. Config loading — config file format and merge strategy with CLI args 4. Core logic — main functions for each subcommand, separated from CLI layer 5. Error types — error enum or anyhow usage, user-facing error messages 6. Output formatting — colored output, JSON mode, progress indicators 7. Tests — unit tests for core logic, integration tests for CLI behavior Present via ExitPlanMode for user approval. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills davila7/rust-cli-builder