Agent Skills: Rust Clap Best Practices

Rust Clap CLI argument parsing best practices. This skill should be used when writing, reviewing, or refactoring Rust CLI applications using clap. Triggers on tasks involving argument parsing, CLI design, subcommands, and command-line interfaces in Rust.

UncategorizedID: pproenca/dot-skills/rust-clap

Install this agent skill to your local

pnpm dlx add-skill https://github.com/pproenca/dot-skills/tree/HEAD/skills/.experimental/rust-clap

Skill Files

Browse the full folder contents for rust-clap.

Download Skill

Loading file tree…

skills/.experimental/rust-clap/SKILL.md

Skill Metadata

Name
rust-clap
Description
Rust Clap CLI argument parsing best practices. This skill should be used when writing, reviewing, or refactoring Rust CLI applications using clap. Triggers on tasks involving argument parsing, CLI design, subcommands, and command-line interfaces in Rust.

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

| Priority | Category | Impact | Prefix | |----------|----------|--------|--------| | 1 | Type-Driven Design | CRITICAL | type- | | 2 | Derive API Patterns | CRITICAL | derive- | | 3 | Argument Configuration | HIGH | arg- | | 4 | Validation & Parsing | HIGH | valid- | | 5 | Subcommand Architecture | MEDIUM-HIGH | subcmd- | | 6 | Help & Documentation | MEDIUM | help- | | 7 | Error Handling | MEDIUM | error- | | 8 | Testing Patterns | LOW-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

| File | Description | |------|-------------| | references/_sections.md | Category definitions and ordering | | assets/templates/_template.md | Template for new rules | | metadata.json | Version and reference information |