m15-anti-pattern

The m15-anti-pattern skill provides a structured framework for identifying and refactoring common Rust anti-patterns, code smells, and beginner mistakes during code reviews.

5.6K
Installs
5
Use cases
5/10
Quality

Is m15-anti-pattern safe to install?

Safe to install

Safe to install: our audit of m15-anti-pattern's source files found 0 shell commands, 0 external URLs, no file writes (none risk). Every command and URL listed appears verbatim in the skill's source. The skill consists of static documentation and guidance for code review. It does not execute code, access the network, or modify files.

How we audit skills: our security review methodology.

Who is this skill for?

Rust developers performing code reviews or seeking to improve code quality by identifying idiomatic alternatives to common pitfalls.

What can you do with it?

  • Identifying unnecessary .clone() calls and suggesting ownership improvements.
  • Replacing .unwrap() calls with proper error handling using the ? operator or expect.
  • Refactoring index-based loops to use iterators.
  • Replacing String allocations with &str or Cow<str> where appropriate.
  • Detecting and resolving borrow checker conflicts through structural changes.

How good is this skill?

Quality score: 5/10. The skill is well-structured, provides clear tables for anti-pattern identification, and includes actionable checklists for code reviews.

What does the skill file contain?

SKILL.md
# 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 |
| `unsa...

Frequently asked questions

How does this skill help with borrow checker issues?

It prompts the user to evaluate if the ownership model is correct and suggests tracing the issue back to domain design or reference patterns.

What should I do if I see many .clone() calls?

The skill advises checking if the ownership model is correct and replacing clones with proper references or ownership.

Does this skill provide automated refactoring?

No. It provides a checklist and guidance for manual refactoring based on identified code smells.

Data sourced from zhanghandong/rust-skills on GitHub. Install counts from skills.sh. The summary and security audit are derived from the skill's source files: every command and URL listed appears verbatim in the source.

Related skills

make-interfaces-feel-better

37.7K

Frontend developers and designers using AI agents to review UI code or implement design system improvements

This skill provides design engineering principles for polishing user interfaces. It guides the agent in reviewing and implementing UI details such as typography, animations, border radii, optical alignment, and performance optimizations.

noneuidesignjakubkrehel

golang-code-style

33.3K

Go developers and AI coding agents performing code reviews or writing new Go code

This skill provides a comprehensive set of Go code style conventions focused on clarity, maintainability, and idiomatic patterns. It covers variable declarations, control flow, function design, file organization, and string handling, serving as a guide for human-judgment-based code reviews that complement automated linters.

lowgolangcoding-standardssamber

vue-best-practices

24.1K

Vue

This skill provides a structured workflow for Vue.js development, mandating the use of the Composition API, TypeScript, and specific architectural patterns. It requires developers to plan component boundaries, follow strict SFC structure, and apply core reactivity and data flow principles before implementing features.

lowvuetypescripthyf0

swiftui-pro

21.8K

SwiftUI developers seeking to improve code quality and ensure adherence to modern Apple development standards

The swiftui-pro skill reviews SwiftUI code for modern API usage, maintainability, and performance. It validates code against a set of local reference files covering accessibility, data flow, navigation, and Swift best practices.

lowSwiftUISwifttwostraws