Code Simplifier
Rust simplification guide for RTK that removes verbosity while preserving the project's required constraints.
- CCM score
- 69 of 100
- skills.sh installs
- 2.3K
- GitHub stars
- 88.2K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers seven idiom patterns: iterator chains,
joinstring building, Option/Result chaining, struct destructuring, early returns, redundant clone removal, andif let - Lists project constraints never to simplify away, including
LazyLockregexes,.context()on?, raw-command fallbacks, and exit code propagation - Provides post-change checks:
cargo fmt,cargo clippy, andcargo test, plus greps forRegex::newand production.unwrap()calls - Designed for RTK maintainers who want idiomatic Rust cleanup without changing command behavior
Install
$ npx -y skills add rtk-ai/rtk --skill code-simplifier -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
RTK Code Simplifier
Review and simplify Rust code in RTK while respecting the project's constraints.
Constraints (never simplify away)
LazyLockregex — 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
// ❌ Verbose
let mut result = Vec::new();
for line in input.lines() {
let trimmed = line.trim();
if !trimmed.is_empty() && trimmed.starts_with("error") {
result.push(trimmed.to_string());
}
}
// ✅ Idiomatic
let result: Vec<String> = input.lines()
.map(|l| l.trim())
.filter(|l| !l.is_empty() && l.starts_with("error"))
.map(str::to_string)
.collect();
2. String building
// ❌ Verbose push loop
let mut out = String::new();
for (i, line) in lines.iter().enumerate() {
out.push_str(line);
if i < lines.len() - 1 {
out.push('\n');
}
}
// ✅ join
let out = lines.join("\n");
Details
- Repository
- github.com/rtk-ai/rtk
- Categories
- Rust, Code Review & Quality
- First seen
- Jun 3, 2026
Questions
What does the code-simplifier skill do for RTK Rust code?
It reviews RTK Rust code for idiomatic simplification, detecting over-engineering, unnecessary allocations and verbose patterns. It applies Rust idioms such as iterator chains, early returns and avoiding redundant clones without changing behavior.
How do I install the code-simplifier skill?
Run npx -y skills add rtk-ai/rtk --skill code-simplifier -y in your project. The agent can then simplify Rust code when asked to simplify, refactor or make code idiomatic.
Which constraints does the code-simplifier skill keep in place?
It never removes LazyLock regex statics, the context calls on every question-mark operator, the fallback to raw command output, exit code propagation, or test modules. These parts look redundant but act as safety nets in RTK.
Where does code-simplifier rank in the Rust category?
It ranks in the top 50 on the Rust category page on Claude Marketplaces. Other skills in that category include fix-errors, rust-best-practices, rust-async-patterns, rust-testing and rust-patterns.
More from rtk-ai/rtk
All 7Similar to Code Simplifier
More Rustm15-anti-patternactionbook/rust-skills9.6K installsRust code review checklist that flags anti-patterns and points to idiomatic replacements with tracing to design causes.
tdd-rustrtk-ai/rtk1.5K installsTest-driven workflow for building RTK output filters in Rust, with real fixtures and enforced token-savings checks.
rust-refactorpproenca/dot-skills334 installsDecision frameworks and six transformation patterns for simplifying, splitting, and migrating working Rust code.
design-patternsrtk-ai/rtk2K installsRust design pattern reference for RTK CLI filter modules: Newtype, Builder, RAII, and more.
code-quality-principlesathola/claude-night-market183 installsReference guide for applying KISS, YAGNI, and SOLID to refactoring and code review with language-specific examples.