Agent skill · software engineering · rtk-ai

code-simplifier

Review RTK Rust code for idiomatic simplification. Detects over-engineering, unnecessary allocations, verbose patterns. Applies Rust idioms without changing behavior.

Why this skill is useful

Adds specific Rust idioms and patterns for simplifying code that the AI wouldn't reliably generate on its own.

What it needs

About 2k tokens when loaded. Last updated 2026-08-06. 75,070 stars on the source repository.

What this skill does

RTK Code Simplifier Review and simplify Rust code in RTK while respecting the project's constraints. Constraints (never simplify away) LazyLock regex — cannot be moved inside functions even if "simpler" .context() on every ? — verbose but mandatory Fallback to raw command — never remove even if it looks like dead code Exit code propagation — never simplify to Ok(()) #[cfg(test)] mod tests — never remove test modules Simplification Patterns 1. Iterator chains over manual loops 2. String building 3. Option/Result chaining 4. Struct destructuring 5. Early returns over nesting 6. Avoid redundant clones 7. Use if let for single-variant match RTK-Specific Checks Run these after simplification: What NOT to Simplify static RE: LazyLock<Regex> = LazyLock::new( Regex::new(...).unwrap()); — the .unwrap() here is acceptable, it's init-time .context("description")? chains — verbose but required The fallback match arm Err(e) => { eprintln!(...); rawoutput } — looks redundant but is the safety net std::process::exit(code) at end of run() — looks like it could be Ok(())but it isn't

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills rtk-ai/code-simplifier

View the source on GitHub

Browse the @skills marketplace