rust-cli
Skill1 starsChanged 4 days agoMITView on GitHub
Design, implement, test, and release production Rust command-line applications, including command contracts, subcommands, configuration precedence, stdin/stdout/stderr, exit codes, file safety, daemon IPC, terminal handling, packaging, and process-level tests. Use when users ask for a Rust CLI, command parser, clap integration, Unix-style pipelines, daemon clients, PTY/TUI behavior, shell completion, or CLI release engineering.
8 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- marcioaltoe/skillstheir own version, first seen Nov 29, 2026
- gurinderu/crafttheir own version, first seen Nov 29, 2026
- Galvarcus/claude-skillstheir own version, first seen Nov 8, 2026
- po4yka/rust-skillstheir own version, first seen Nov 2, 2026
- adxptived/Rust-Skillstheir own version, first seen Oct 17, 2026
- full-stack-skills/rust-skillsedited, first seen Oct 15, 2026
Used with
Projects with it also use rust-embedded, rust-macros and 3 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
huialiSkillrust-embedded
嵌入式与 no_std 专家。处理 no_std, embedded-hal, 裸机开发, 中断, DMA, 资源受限环境等问题。触发词:no_std, embedded, embedded-hal, microcontroller, firmware, ISR, DMA, 嵌入式, 裸机--- # 嵌入式与 no_std 开发 ## 核心问题 **如何在资源受限环境或没有标准库的情况下编程?** no_std 不是 Rust 的子集,而是一种不同的编程模式。
Also in 4 projects that use this
dawidpereiraSkillrust-macros
Rust macros — macro_rules!, proc macros, derive macros, attribute macros, fragment specifiers, repetition, hygiene, cargo expand, when to use macros vs generics. Use when writing or debugging declarative or procedural macros, choosing between macros and other abstractions, understanding expansion errors, or generating repetitive code.
Also in 4 projects that use this
huialiSkillrust-observability
Also in 3 projects that use this
adxptivedSkillrust-security
Rust application security, supply-chain hardening, cryptography hygiene, secrets handling, and secure service patterns. Use when: - User asks about secure Rust code, threat modeling, auth, tokens, password hashing, or secrets - User uses crates like argon2, password-hash, ring, rustls, secrecy, zeroize, jsonwebtoken, or biscuit - User handles untrusted input, file paths, uploads, subprocesses, deserialization, or SSRF-prone URLs - User wants cargo audit, cargo deny, dependency policy, SBOMs, or supply-chain checks - User writes unsafe code exposed to untrusted data or FFI boundaries - User builds web APIs that need TLS, CORS, cookies, sessions, CSRF, rate limits, or tenant isolation - User implements OAuth2/OIDC, API key validation, JWT verification, or mTLS
Also in 3 projects that use this
- +1 more from huiali
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- full-stack-skills/rust-skills★ 898% same
Wrote their own version · 7
- Galvarcus/claude-skills★ 8same name
- po4yka/rust-skills★ 7same name
- tumf/skills★ 4same name
- adxptived/Rust-Skills★ 1same name
- gurinderu/craft★ 1same name
- Microbiosis/rust-claude-skills★ 1same name
- marcioaltoe/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository16 other files it gives its agents.
- accessibilitySkill
- cargo-fuzzSkill
- core-web-vitalsSkill
- impeccableSkill
- property-based-testingSkill
- rust-best-practicesSkill
- rust-cargo-buildSkill
- rust-concurrencySkill
- rust-databaseSkill
- rust-http-clientSkill
- rust-performanceSkill
- rust-testingSkill
- rust-web-securitySkill
- rust-webSkill
- sonjoo-auditSkill
- sonjoo-auditSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 10 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Treat the command-line interface as a stable user protocol rather than embedding business logic directly in main.
- Distinctive: line 17
Before making changes, confirm requirements, existing help text, scripts, READMEs, tests, and release configurations:
- Distinctive: line 26
If critical contracts are missing, infer the minimal compatible solution from existing behavior and tests while explicitly stating …
- Distinctive: line 32
Check entry points and build boundaries:
- Distinctive: line 45
Write a behavior matrix first, then implement parsing logic.
- Very specific: line 53
When using parsers like clap, rely on official documentation for locked repository versions.
- Distinctive: line 57
Keep the entry point thin:
- Distinctive: line 71
Write normal results to stdout.
- Distinctive: line 72
Do not mix logs, colors, or progress bars when consuming pipes from stdout.
- Very specific: line 74
Use Path/PathBuf; do not manually concatenate platform-specific paths.
- Distinctive: line 81
Do not print debug stacks or sensitive values to terminal users by default.
- Very specific: line 86
Do not use unwrap()/expect() on user input, files, network operations, or configuration failures.
- Distinctive: line 90
Ensure coverage of at least the following scenarios:
- Very specific: line 115
If cross-platform or specific target support is declared, verify in the corresponding environment or CI matrix.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rust CLI Delivery
Treat the command-line interface as a stable user protocol rather than embedding business logic directly in main. Complete an end-to-end loop from contract confirmation, implementation to real process verification.
Confirm Constraints
Before making changes, confirm requirements, existing help text, scripts, READMEs, tests, and release configurations:
- Command name, subcommands, arguments, defaults, mutual exclusions, compatibility requirements;
- Human output format versus machine output (quiet mode, verbose, JSON, colorless);
- Input priority for stdin, files, and arguments; stdout/file write destinations;
- Exit codes corresponding to success, usage errors, data errors, transient failures;
- Supported platforms, shells, TTY/pipes environments, MSRV, dependency versions;
- Configuration file precedence over environment variables over command-line options.
If critical contracts are missing, infer the minimal compatible solution from existing behavior and tests while explicitly stating assumptions. Do not arbitrarily alter flags, output text, or exit codes.
Workflow
1. Establish Behavior Baseline
Check entry points and build boundaries:
rustc --version --verbose
cargo metadata --no-deps --format-version 1
cargo test --all-targets
cargo run -- --helpRecord at least one successful invocation with its parameters, stdout, stderr, and exit code; record at least one failed invocation. Existing snapshots or shell callers serve as compatibility constraints.
2. Define Command Contracts
Write a behavior matrix first, then implement parsing logic. Distinguish:
- Required positional arguments, optional arguments, repeatable options, subcommands;
- User input errors versus runtime errors;
- Normal data output versus diagnostic output;
- Interactive vs non-interactive modes;
- Stable machine format versus evolvable human-readable formats.
When using parsers like clap, rely on official documentation for locked repository versions. Do not mix derive attributes or APIs from different major versions based on memory.
3. Separate Parsing, Execution, and Presentation
Keep the entry point thin:
Process parameters & environment
-> Parse into Options/Command
-> Call testable run(command, io, context)
-> Map domain results to output and ExitCodeLet domain logic return structured results or errors; only decide color codes, newlines, stderr messages, and exit codes at boundaries. Avoid calling process::exit directly in deep functions, reading global environment variables indiscriminately, or printing unconditionally.
4. Implement I/O with Configuration Priority
- Inject input/output adapters using
BufRead,Write, or explicit wrappers for testable pipe behavior; - Write normal results to stdout; diagnostic and progress messages go to stderr;
- Do not mix logs, colors, or progress bars when consuming pipes from stdout;
- Enable interactive prompts only after detecting a TTY, providing an option to override this behavior;
- Use
Path/PathBuf; do not manually concatenate platform-specific paths.
Explicitly define precedence: CLI > Environment Variables > Configuration Files > Defaults. Write tests for conflicts where applicable. When writing files, consider partial writes, atomic replacement strategies, existing file policies, and permission sensitivities. Read Command Contract & I/O if specific command matrices, standard streams, or configuration patterns are needed.
5. Design Operable Errors
- Provide short, contextual, actionable error messages for expected failures;
- Do not print debug stacks or sensitive values to terminal users by default;
- Retain the full error chain for detailed modes and logging purposes;
- Map error categories into stable exit codes;
- Handle broken pipes correctly: do not generate noise when downstream filters close prematurely.
Do not use unwrap()/expect() on user input, files, network operations, or configuration failures.
6. Verify with Real Processes
Ensure coverage of at least the following scenarios:
--helpand--version;- A successful execution path;
- Unknown parameters, missing arguments, conflicting options;
- Separation between stdout and stderr streams;
- Precise exit codes;
- stdin pipe or temporary file behavior;
- Configuration precedence without TTY support;
- Path risks involving spaces, non-UTF-8 content, or platform differences (when applicable).
Prioritize testing compiled binaries over parsing functions alone. Read CLI Testing & Release if test coverage and release artifacts are required. General test stratification is delegated to rust-testing.
7. Validate Distribution Forms
Enforce repository-level gates:
cargo fmt --all -- --check
cargo check --all-targets
cargo test --all-targets
cargo clippy --all-targets -- -D warnings
cargo build --releaseIf cross-platform or specific target support is declared, verify in the corresponding environment or CI matrix. Packaging, features, workspace configuration, cross-compilation, and release details are handled by rust-cargo-build.
8. Handle Daemon, IPC, Terminal Modes
When a CLI includes persistent daemons, local IPC, PTYs, TUIes, or similar: do not keep all code in the binary crate. Separate parsing logic, protocol DTOs, platform layers, clients, servers, and public SDKs accordingly. Write end-to-end tests for handshake versions, capability negotiation, frame sizes, race conditions during auto-startup, signals, attach upgrades, shutdown sequences, and tool/boundary selection per Daemon & IPC Terminal Toolkit.
Completion Criteria
Report completion only when all of the following are satisfied:
- Command contracts and compatibility assumptions are clearly defined;
- Business logic is separated from process boundaries;
- Real-process tests exist for stdout, stderr, exit codes, and configuration precedence;
fmt,check,test, and Clippy pass;- Supported platforms and distribution artifacts have evidence of support; unverified parts are explicitly marked.
Handoff Boundaries
| Primary Concern | Assigned To |
| Ownership, path semantics, I/O trait definitions or error types | rust-best-practices |
| Test stratification, coverage, fuzzing, benchmarks | rust-testing |
| Cargo features, workspace configuration, cross-compilation, packaging, release | rust-cargo-build |
| Tokio tasks, cancellation, signals, async lifetimes | rust-concurrency |
| HTTP services | rust-web |
On-Demand Resources
- Command Contract & I/O: Read when designing parameters, standard streams, configuration, and exit codes.
- CLI Testing & Release: Read before writing real-process tests or preparing for release.
- Daemon & IPC Terminal Toolkit: Read when building local daemons, control protocols, PTYs, TUIes, or cross-platform terminal applications.
- Example Scenarios: Read if end-to-end task templates are required.
examples/golden-cli/: Use offline compilation to verify stdout, stderr, and exit codes for golden examples.
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

