
Code Simplifier
Built specifically for the RTK project, this reviews Rust code for verbose patterns and applies idiomatic simplifications without breaking behavior. It knows RTK's non-negotiable constraints (lazy_static regexes, mandatory context() chains, fallback handlers) and won't touch them. Instead it targets the usual suspects: manual loops that should be iterator chains, nested matches that need flattening, unnecessary clones and allocations. The simplifications are standard Rust idioms, nothing clever. Useful when you've been heads-down implementing features and the code works but reads like you were thinking in Python. Runs clippy and tests after changes to verify no regressions.
- skills.sh installs
- 2.2K
- GitHub stars
- 86K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add rtk-ai/rtk --skill code-simplifier --agent claude-codeInstalls into .claude/skills of the current project.
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");
Sponsors
Details
- Repository
- github.com/rtk-ai/rtk
- Categories
- Git & Pull Requests, Code Review & Quality, Rust
- First seen
- Jun 3, 2026