Skillshub rust-clap

Rust Clap Best Practices

install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/pproenca/dot-skills/rust-clap" ~/.claude/skills/comeonoliver-skillshub-rust-clap && rm -rf "$T"
manifest: skills/pproenca/dot-skills/rust-clap/SKILL.md
source content

Rust Clap Best Practices

Comprehensive best practices guide for building CLI applications in Rust using clap. Contains 42 rules across 8 categories, prioritized by impact to guide CLI design, argument parsing, and testing.

When to Apply

Reference these guidelines when:

  • Designing new Rust CLI applications
  • Adding arguments or subcommands to existing CLIs
  • Validating and parsing command-line input
  • Writing integration tests for CLI tools
  • Improving help text and user experience

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Type-Driven DesignCRITICAL
type-
2Derive API PatternsCRITICAL
derive-
3Argument ConfigurationHIGH
arg-
4Validation & ParsingHIGH
valid-
5Subcommand ArchitectureMEDIUM-HIGH
subcmd-
6Help & DocumentationMEDIUM
help-
7Error HandlingMEDIUM
error-
8Testing PatternsLOW-MEDIUM
test-

Quick Reference

1. Type-Driven Design (CRITICAL)

2. Derive API Patterns (CRITICAL)

3. Argument Configuration (HIGH)

4. Validation & Parsing (HIGH)

5. Subcommand Architecture (MEDIUM-HIGH)

6. Help & Documentation (MEDIUM)

7. Error Handling (MEDIUM)

8. Testing Patterns (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information