Skip to content
Development
Command

/rtk-rust-safety-net

Defensive idioms when generating Rust code.

From plugin
rtk
86k13 skills6 agents13 commands
$ npx -y skills add rtk-ai/rtk --agent claude-code

Command definition

rtk-rust-safety-net.md

Defensive 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.

@rtk-ai
Ships withrtk

CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies

86k12 skills6 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
86.0k
Star history of rtk-ai/rtk on GitHub, a chart by star-history.com

Other commands on rtk.

clean-worktree

clean-worktree

Command

Interactive cleanup of stale worktrees (merged branches, orphaned refs)

@rtk-ai@rtk-aiInstall Command
diagnose

diagnose

Command

RTK environment diagnostics - Checks installation, hooks, version, command routing

@rtk-ai@rtk-aiInstall Command

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command