code-simplifier
Skill16 starsChanged 8 months agoApache-2.0View on GitHub
Use when writing, reviewing, or editing Rust code in this project - applies iterator chains, Option/Result chaining, early returns, borrow-over-clone, and if-let simplifications per project conventions
42 other projects use a version of this.
Adopted by
Most recently taken up by
- kopp0510/claude-ddtheir own version, first seen Oct 5, 2026
- aktsmm/Agent-Skillstheir own version, first seen Oct 4, 2026
- yeisonrestrepo/code-conductortheir own version, first seen Oct 3, 2026
- wty-yy/skillstheir own version, first seen Oct 2, 2026
- zvadaadam/az-skillstheir own version, first seen Sep 28, 2026
- kaiohenricunha/dotbabeltheir own version, first seen Sep 24, 2026
Used with
Projects with it also use comment-analyzer, performance and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
lin30Skillcomment-analyzer
微博评论抓取与深度分析,生成可视化HTML报告。Use when user asks to analyze weibo comments, analyze social media comments, or requests sentiment analysis from weibo posts
Also in 3 projects that use this
pluginagentmarketplaceSkillperformance
Optimize application performance through caching strategies, load balancing, database scaling, and monitoring. Build systems handling thousands of concurrent users.
Also in 3 projects that use this
AWSSkillsetup-matt-pocock-skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
Also in 3 projects that use this
OpenAISkillverification-before-completion
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
Also in 4 projects that use this
AWSSkillto-spec
Turn the current conversation into a spec and publish it to the project issue tracker: no interview, just synthesis of what you've already discussed.
Also in 3 projects that use this
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 9 projects that use this
- +2 more from aws
Other versions42 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 42
- rtk-ai/rtk★ 82ksame name
- getsentry/skills★ 1ksame name
- Azure/azqr★ 793same name
- microsoft/ghqr★ 529same name
- feiskyer/codex-settings★ 244same name
- FlorianBruniaux/ccboard★ 96same name
- zvadaadam/az-skills★ 49same name
- roman01la/skills-agents★ 48same name
- 1024XEngineer/bytemind★ 43same name
- kumaran-is/claude-code-onboarding★ 36same name
32 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository2 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- tool-creatorSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 40 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Use iterator chains for transformation logic.
- Very specific: line 146
Use match only when both arms carry logic.
“Common” is measured: kept by at least 6 in 10 of the 40 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rust Code Simplifier
Proactive pattern guide for writing simple, idiomatic Rust. Apply these patterns whenever writing or modifying Rust code — not only when asked to simplify.
Project rules: These patterns align with .claude/rules/rust-patterns.md. When in doubt, re-read the rules file.
1. Iterator Chains Over Manual Loops
Use iterator chains for transformation logic. Reserve for loops only when the body needs early error returns with ?.
// WRONG
let mut names = Vec::new();
for tool in tools {
if tool.is_available() {
names.push(tool.name().to_owned());
}
}
// RIGHT
let names: Vec<String> = tools
.iter()
.filter(|t| t.is_available())
.map(|t| t.name().to_owned())
.collect();When to keep a loop: The body calls fallible operations with ?:
// Loop is correct here — early return on error
for entry in entries {
let meta = entry.metadata().context("failed to read metadata")?;
process(&meta).await?;
}2. Option/Result Chaining
Flatten nested match/if let on Option/Result into chained combinators or ?.
// WRONG — nested match pyramid
match config.project.as_ref() {
Some(project) => match project.settings.as_ref() {
Some(settings) => match settings.get("key") {
Some(val) => Some(val.to_owned()),
None => None,
},
None => None,
},
None => None,
}
// RIGHT — ? operator for Option propagation
config
.project
.as_ref()?
.settings
.as_ref()?
.get("key")
.map(|v| v.to_owned())Combinator quick reference:
| Pattern | Use when |
? | Propagate None/Err to caller |
.map() | Transform inner value |
.and_then() | Chain operations that return Option/Result |
.unwrap_or_default() | Fallback to Default impl |
.unwrap_or_else(|| ...) | Fallback with computation |
3. Early Returns
Guard against invalid/empty states at the top. Avoid deep nesting for the main logic.
// WRONG — main logic buried in nested conditions
fn process(entries: &[Entry], prefix: &str) -> Vec<String> {
let mut results = Vec::new();
if !entries.is_empty() {
if !prefix.is_empty() {
for entry in entries {
if entry.name.starts_with(prefix) {
results.push(entry.name.strip_prefix(prefix).unwrap().to_owned());
}
}
}
}
results
}
// RIGHT — guard clauses, then flat logic
fn process(entries: &[Entry], prefix: &str) -> Vec<String> {
if entries.is_empty() || prefix.is_empty() {
return Vec::new();
}
entries
.iter()
.filter(|e| e.name.starts_with(prefix))
.filter_map(|e| e.name.strip_prefix(prefix))
.map(|s| s.to_owned())
.collect()
}Signals to look for: is_empty(), is_none(), is_err(), boolean flags checked before the real work begins.
4. Avoid Redundant Clones
Borrow instead of cloning. When ownership is needed, use .to_owned() (not .clone()). Use String::from("...") for string literals (not "...".to_string()).
// WRONG — clones where borrows suffice
fn format_tool(tool: &Tool) -> String {
let data = tool.data.clone();
let name = tool.name.clone();
format!("{}: {}", name, data)
}
// RIGHT — format! borrows automatically
fn format_tool(tool: &Tool) -> String {
format!("{}: {}", tool.name, tool.data)
}// WRONG
let label = "default".to_string();
let copy = config.clone();
// RIGHT
let label = String::from("default");
let copy = config.to_owned();5. if let for Single-Variant Match
Use match only when both arms carry logic. Use if let when only one variant matters.
// WRONG — match with throwaway arm
match result {
Some(val) => process(val),
None => (),
}
// RIGHT
if let Some(val) = result {
process(val);
}
// RIGHT — match when both arms carry logic
match result {
Ok(ctx) => tool.format(ctx).await,
Err(e) => log_and_report(e),
}Common Mistakes
| Mistake | Fix |
.clone() to satisfy borrow checker | Restructure to borrow, or use .to_owned() if ownership needed |
"literal".to_string() | String::from("literal") |
Nested if/match guarding empty/none | Early return guard clause at top |
for loop that only filters + maps | Iterator chain with .filter().map().collect() |
match x { Some(v) => f(v), None => () } | if let Some(v) = x { f(v); } |
Nested match on Option chains | ? operator or .and_then() |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

