
M15 Anti Pattern
The m15-anti-pattern skill helps developers identify and refactor common code anti-patterns during code reviews, focusing on Rust-specific issues like excessive cloning, unwrap calls in production, and fighting the borrow checker. It's designed for Rust developers and code reviewers who need to distinguish between solving symptoms versus root causes, and who want guidance on more idiomatic approaches. The skill maps anti-patterns to their underlying design problems and traces them to related skills for deeper understanding of ownership, error handling, and domain design.
- skills.sh installs
- 5.6K
- GitHub stars
- 1.3K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add zhanghandong/rust-skills --skill m15-anti-pattern --agent claude-codeInstalls into .claude/skills of the current project.
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
Sponsors
Promote your product hereReach 125k+ visitors monthlyPromote your product hereReach 125k+ visitors monthly
Agent CaffeineSponsoredClose your lid, come back to finished work
SnugSponsoredThe clipboard manager for the AI eraPromote your product hereReach 125k+ visitors monthly
WaxSponsoredBlock anything with supervision, without erasing your iPhonePromote your product hereReach 125k+ visitors monthly
knobsSponsoredSee your site on any phone, any day, in any language
Details
- Repository
- github.com/zhanghandong/rust-skills
- Categories
- Code Review & Quality, Rust
More from zhanghandong/rust-skills
All 34- Coding Guidelines1.2K
- M10 Performance895
- M07 Concurrency844
- M06 Error Handling827
- Rust Refactor Helper821
- M01 Ownership809
- M04 Zero Cost789
- M05 Type Driven786
- M02 Resource783
- M03 Mutability773
- M12 Lifecycle764
- M14 Mental Model751
- M09 Domain750
- M11 Ecosystem747
- M13 Domain Error738
- Rust Trait Explorer731
- Rust Code Navigator728
- Unsafe Checker726
- Domain Cli709
- Rust Symbol Analyzer702
- Rust Call Graph699
- Rust Router698
- Rust Learner688
- Rust Deps Visualizer684
Recommended
More Code Review & Quality1
microservices-architectjeffallan/claude-skillsDesigns distributed system architectures, decomposes monoliths into bounded-context services, recommends communication patterns, and produces service boundary d5.2Kskills.sh installs
2
indexion-refactortrkbt10/indexion-skillsAfter writing code, detect and clean up duplication at three levels — copy-paste blocks, cross-package shared code, unnecessary wrappers, and concept-level SoT 5Kskills.sh installs
3
architecture-decision-recordsaffaan-m/everything-claude-codearchitecture decision records4.8Kskills.sh installs
5
open-code-review-delegatealibaba/open-code-reviewDelegation mode for open-code-review (OCR). Instead of OCR calling an LLM endpoint, this skill instructs the host agent to perform the code review itself, using4.1Kskills.sh installs