Development
Command
/rtk-rust-safety-net
Defensive idioms when generating Rust code.
$ npx -y skills add rtk-ai/rtk --agent claude-code
Command definition
rtk-rust-safety-net.mdDefensive idioms when generating Rust code.
Rust safety net
When writing Rust:
- Avoid `.unwrap()` and `.expect()` outside of tests, build scripts,
and at-startup code where a panic IS the failure mode. In every other path return `Result<T, E>` (custom error or `anyhow::Error`).
- `clone()` is acceptable in glue code; in hot paths, prefer `&str`
over `String` and slice references over `Vec` clones.
- `unsafe` requires a SAFETY comment immediately above explaining why
the invariants hold. No `unsafe` for "performance" without a benchmark.
- `mem::transmute`, `from_raw_parts` on user-provided lengths, and
uninitialized memory are forbidden in business code.
- For async: avoid blocking calls (std::fs, std::sync::Mutex held
across .await) inside an async fn. Use tokio::fs / tokio::sync.
Stats
86,389
Stars
5,532
Forks
Active
Maintenance
Rust
Language
Apache-2.0
License
Last commit
Created
Ships withrtk
CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies
86k12 skills6 agents
Other commands on rtk.
More commands from other plugins.
Auto-invoked
Auto-invoked
build
CommandImplement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

