
M15 Anti Pattern
Rust code review checklist that flags anti-patterns and points to idiomatic replacements with tracing to design causes.
- skills.sh installs
- 9.4K
- GitHub stars
- 1.6K
- last updated
- Aug 21, 2026
What it does
- Covers an anti-pattern table mapping
.clone(),.unwrap(),Rc,unsafe,String, and similar habits to better alternatives - Includes a code smell to refactoring table, a top five beginner mistakes list, and a quick review checklist
- Enforces trace-up questions that ask whether a symptom like excessive cloning points to an unclear ownership design
- Designed for reviewing Rust code and cross-referencing related skills for ownership, error handling, and performance
Install
$ npx -y skills add actionbook/rust-skills --skill m15-anti-pattern -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Anti-Patterns
Layer 2: Design Choices
Core Question
Is this pattern hiding a design problem?
When reviewing code:
- Is this solving the symptom or the cause?
- Is there a more idiomatic approach?
- Does this fight or flow with Rust?
Anti-Pattern → Better Pattern
| Anti-Pattern | Why Bad | Better |
|---|---|---|
.clone() everywhere | Hides ownership issues | Proper references or ownership |
.unwrap() in production | Runtime panics | ?, expect, or handling |
Rc when single owner | Unnecessary overhead | Simple ownership |
unsafe for convenience | UB risk | Find safe pattern |
OOP via Deref | Misleading API | Composition, traits |
| Giant match arms | Unmaintainable | Extract to methods |
String everywhere | Allocation waste | &str, Cow<str> |
Ignoring #[must_use] | Lost errors | Handle or let _ = |
Thinking Prompt
When seeing suspicious code:
- Is this symptom or cause?
- Clone to avoid borrow? → Ownership design issue
- Unwrap "because it won't fail"? → Unhandled case
Details
- Repository
- github.com/actionbook/rust-skills
- Categories
- Rust, Code Review & Quality
- First seen
- May 16, 2026
More from actionbook/rust-skills
All 38- Coding Guidelines4.3K
- M10 Performance4K
- M07 Concurrency3.8K
- M06 Error Handling3.8K
- M01 Ownership3.7K
- M05 Type Driven3.7K
- M04 Zero Cost3.7K
- M02 Resource3.7K
- Rust Refactor Helper3.7K
- M03 Mutability3.7K
- M12 Lifecycle3.6K
- M09 Domain3.6K
- M14 Mental Model3.6K
- M13 Domain Error3.6K
- M11 Ecosystem3.6K
- Unsafe Checker3.6K
- Rust Code Navigator3.6K
- Rust Trait Explorer3.5K
- Rust Call Graph3.5K
- Rust Symbol Analyzer3.5K
- Domain Web3.5K
- Domain Cli3.5K
- Rust Learner3.4K
- Rust Skill Creator3.4K
Similar to M15 Anti Pattern
More Rust
unsafe-checkeractionbook/rust-skills3.6K installsReview unsafe Rust code and FFI boundaries for soundness, SAFETY documentation, and safer alternatives.
m01-ownershipactionbook/rust-skills3.7K installsRust ownership and lifetime error guide that maps compiler codes to design questions before quick fixes.
code-review-excellencegalaxy-dawn/claude-scholar375 installsStructured review workflow and checklists that shift code review toward knowledge sharing and constructive feedback.
rust-skillsleonardomso/rust-skills7.2K installsComprehensive Rust coding guidelines with 265 rules across 26 categories for writing and reviewing code.
code-review-checklistvudovn/ag-kit252 installsStructured checklist that reviews code for correctness, security, performance, quality, testing, and documentation.
code-quality-principlesathola/claude-night-market182 installsReference guide for applying KISS, YAGNI, and SOLID to refactoring and code review with language-specific examples.