Teaches Claude the constraints that make CLIs feel right to users: errors go to stderr so piping works, CLI args beat env vars beat config files, non-zero exits for automation, and progress bars for anything slow. Shows the clap derive patterns for argument parsing, how to layer configuration sources properly, and which crates handle what (indicatif for progress, dialoguer for prompts, ratatui for full TUIs). The trace down sections connect domain rules to actual Rust implementations, which is helpful when you're trying to figure out why your CLI feels janky. Honestly just a solid reference for the stuff you always forget between CLI projects.

skills.sh installs
709
GitHub stars
1.3K
last updated
Jul 14, 2026

Install

$ npx -y skills add zhanghandong/rust-skills --skill domain-cli --agent claude-code

Installs into .claude/skills of the current project.

Files

CLI Domain

Layer 3: Domain Constraints

Domain Constraints → Design Implications

Domain RuleDesign ConstraintRust Implication
User ergonomicsClear help, errorsclap derive macros
Config precedenceCLI > env > fileLayered config loading
Exit codesNon-zero on errorProper Result handling
Stdout/stderrData vs errorseprintln! for errors
InterruptibleHandle Ctrl+CSignal handling

Critical Constraints

User Communication

RULE: Errors to stderr, data to stdout
WHY: Pipeable output, scriptability
RUST: eprintln! for errors, println! for data

Configuration Priority

RULE: CLI args > env vars > config file > defaults
WHY: User expectation, override capability
RUST: Layered config with clap + figment/config

Exit Codes

RULE: Return non-zero on any error
WHY: Script integration, automation
RUST: main() -> Result<(), Error> or explicit exit()

Trace Down ↓

From constraints to design (Layer 2):

"Need argument parsing"
    ↓ m05-type-driven: Derive structs for args
    ↓ clap: #[derive(Parser)]

Sponsors

Details

Repository
github.com/zhanghandong/rust-skills
Categories
Rust, CLI & Terminal

More from zhanghandong/rust-skills

All 34

Recommended

More Rust
1zhanghandong avatardomain-cloud-nativezhanghandong/rust-skillsdomain cloud native596skills.sh installs
2zhanghandong avatardomain-fintechzhanghandong/rust-skillsdomain fintech581skills.sh installs
3zhanghandong avatardomain-mlzhanghandong/rust-skillsdomain ml573skills.sh installs
4nomadamas avatarrhwp-advancednomadamas/k-skillDebug HWP layout, dump document IR, compare versions, extract thumbnails, and unlock read-only HWPs with the upstream rhwp Rust CLI (export-svg/dump/dump-pages/10.3Kskills.sh installs
5trailofbits avatarsolana-vulnerability-scannertrailofbits/skillsScans Solana programs for 6 critical vulnerabilities including arbitrary CPI, improper PDA validation, missing signer/ownership checks, and sysvar spoofing. Use6Kskills.sh installs
6trailofbits avatardevcontainer-setuptrailofbits/skillsCreates devcontainers with Claude Code, language-specific tooling (Python/Node/Rust/Go), and persistent volumes. Use when adding devcontainer support to a proje5.6Kskills.sh installs