mcpField
R
rust-clap

rust-clap

github.com/pproencaDevelopment21866 installsUpdated 11w ago
Repository

About rust-clap

rust-clap is a reference skill for designing and testing Rust command-line applications with clap. Its prioritized rules cover argument parsing, command structure, help, errors, and tests.

Key features

  1. 0142 rules in eight categories
  2. 02Guidance for type-driven CLI design
  3. 03Argument and input validation patterns
  4. 04Subcommand and help-text guidance
  5. 05Error handling and testing practices

Use cases

  1. 01Design a new Rust CLI
  2. 02Add arguments or subcommands
  3. 03Validate command-line input
  4. 04Write CLI integration tests

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill rust-clap

After installing, type/rust-clapin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

metadata.json
assets/templates/
_template.md
references/
_sections.md
arg-conflicts-with.md
arg-default-value.md
arg-env-fallback.md
arg-requires.md
arg-short-long.md
arg-value-name.md
derive-args-reusable.md
derive-command-metadata.md
derive-doc-comments.md
derive-global-options.md
derive-parser-entry.md
derive-propagate-version.md
derive-subcommand-enum.md
error-color-styles.md
error-context.md
error-exit-codes.md
error-suggestions.md
help-after-help.md
help-hide-options.md
help-next-heading.md
help-shell-completions.md
subcmd-arg-groups.md
subcmd-args-struct.md
subcmd-external.md
subcmd-nested-hierarchy.md
subcmd-required-help.md
test-assert-cmd.md

Details

From the project README

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 DesignCRITICALtype-
2Derive API PatternsCRITICALderive-
3Argument ConfigurationHIGHarg-
4Validation & ParsingHIGHvalid-
5Subcommand ArchitectureMEDIUM-HIGHsubcmd-
6Help & DocumentationMEDIUMhelp-
7Error HandlingMEDIUMerror-
8Testing PatternsLOW-MEDIUMtest-

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

Comments

Markdown supported