m15-anti-pattern

Identify and document Rust anti-patterns during code reviews.

3|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/0xharryriddle/codex-field-kit --skill m15-anti-pattern-0xharryriddle
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: m15-anti-pattern
Source: https://github.com/0xharryriddle/codex-field-kit/tree/main/archive/upstream/chasebuild-agent-skills/rust/skills/m15-anti-pattern
Command: npx skills add https://github.com/0xharryriddle/codex-field-kit --skill m15-anti-pattern-0xharryriddle

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rust developers often encounter common anti-patterns that erode safety, readability, and maintainability; this skill helps identify and address those patterns during code reviews.

Core Features & Use Cases

  • Comprehensive anti-pattern catalog covering common Rust pitfalls (e.g., clone everywhere, unwrap in production, misused Rc) to aid rapid identification.
  • Guided refactoring prompts with concrete steps and best practices to rewrite problematic code for safer, idiomatic Rust.
  • Educational prompts for code reviews and learning, with trace-up and trace-down pointers to related materials and patterns.
  • Use cases include codebases with frequent panics from unwraps or ownership pitfalls that benefit from structured review guidance.

Quick Start

Inspect a Rust module for anti-patterns and apply the guide to propose safe, idiomatic refactors.

Frequently Asked Questions about m15-anti-pattern

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify common Rust anti-patterns during a code review?

Identifying Rust anti-patterns during code review involves scanning for patterns like excessive cloning, unwrap in production, and misused Rc that erode safety, readability, and maintainability. This skill provides a structured checklist to rapidly spot these ownership and error-handling pitfalls across library and application code.

What is the best way to refactor Rust code with excessive cloning and unwrap usage?

Refactoring Rust code with excessive cloning and unwrap usage requires guided prompts with concrete steps to rewrite problematic code safely. This skill provides structured trace-up and trace-down pointers alongside best practices to replace panics and ownership pitfalls with idiomatic Rust improvements.

Can I use this anti-pattern checklist for both library and application Rust codebases?

Yes, this anti-pattern checklist can be applied to both library and application Rust codebases. It is designed to inspect Rust modules during code reviews, covering ownership and error-handling scenarios regardless of whether the code is library or application logic.

Why does misused Rc cause ownership pitfalls in Rust and how do I fix it?

Misused Rc causes ownership pitfalls in Rust by introducing unnecessary reference counting when ownership can be restructured more safely. This skill helps spot misused Rc anti-patterns and provides guided refactoring prompts to rewrite the code for safer, idiomatic Rust improvements.

How do I fix frequent Rust panics caused by unwrap in production code?

Fixing frequent Rust panics caused by unwrap in production code involves identifying these anti-patterns and applying structured refactoring guidance. This skill offers a comprehensive catalog to spot unwrap usage and proposes safe, idiomatic error-handling alternatives instead of panicking.

When should I not use Rc in Rust and what are the ownership limitations?

You should avoid using Rc in Rust when standard ownership transfers or references can achieve the same result without reference counting overhead. This skill helps identify these misused Rc anti-patterns during code reviews and provides guidance to refactor toward safer, idiomatic ownership models.