# M15 anti pattern

> M15 anti pattern is an open-source agent skill for developer tools. Reviews Rust code for common anti-patterns and suggests more idiomatic alternatives. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/k1-c/linear-tui/tree/main/.claude/skills/m15-anti-pattern
- **Repository:** https://github.com/k1-c/linear-tui
- **GitHub stars:** 21
- **License:** MIT
- **Skill name:** m15-anti-pattern
- **Collection:** https://github.com/k1-c/linear-tui
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

This skill guides an agent through reviewing Rust code for design-level anti-patterns, such as cloning to escape the borrow checker, unwrapping in production paths, reaching for Rc or Arc when ownership is single, and using String where a borrowed string would do. For each suspicious pattern it asks whether the code treats a symptom or a root cause, and whether a restructured ownership or error-handling approach would fit better.

The skill is built around reference tables that map each anti-pattern to its underlying cause, a better pattern, and related skills in the same collection for deeper study. It includes a short checklist for quick reviews, a list of smells with refactoring suggestions, and common compiler error patterns linked to their likely causes.

It is written for Rust code and assumes the agent can read the source under review. It contains no scripts; the agent works from the instructions and its own reading of the code.

## When your agent uses it

> Use when reviewing code for anti-patterns. Keywords: anti-pattern, common mistake, pitfall, code smell, bad practice, code review, is this an anti-pattern, better way to do this, common mistake to avoid, why is this bad, idiomatic way, beginner mistake, fighting borrow checker, clone everywhere, unwrap in production, should I refactor, 反模式, 常见错误, 代码异味, 最佳实践, 地道写法

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/k1-c/linear-tui/tree/HEAD/.claude/skills/m15-anti-pattern)
- [License: MIT](https://github.com/k1-c/linear-tui/tree/HEAD/.claude/skills/m15-anti-pattern)

## Features

- **Anti-pattern lookup table:** Maps common Rust mistakes such as excessive cloning or unwrap use to their reasons and better alternatives.
- **Symptom versus cause prompts:** Guides the agent to ask whether a suspicious pattern hides an ownership or design problem.
- **Code smell refactoring map:** Links smells like many pub fields or giant enums to specific refactoring steps.
- **Beginner mistake ranking:** Lists the five most frequent Rust beginner errors with direct fixes.
- **Review checklist:** Provides a short checklist covering clones, unwraps, unsafe blocks and oversized functions.
- **Deprecated pattern replacements:** Suggests modern std alternatives such as OnceLock in place of lazy_static.

## Good for

- Review my Rust pull request for common anti-patterns
- Why is cloning everywhere in this code considered a problem?
- Suggest a more idiomatic way to handle this unwrap in production code
- Check whether this struct exposes too many pub fields
- Help me stop fighting the borrow checker in this function

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/m15-anti-pattern` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/m15-anti-pattern &&
cp -R "$tmp/.claude/skills/m15-anti-pattern" ~/.claude/skills/m15-anti-pattern &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/m15-anti-pattern` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/m15-anti-pattern` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/m15-anti-pattern &&
cp -R "$tmp/.claude/skills/m15-anti-pattern" ~/.agents/skills/m15-anti-pattern &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/m15-anti-pattern` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/m15-anti-pattern` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/m15-anti-pattern &&
cp -R "$tmp/.claude/skills/m15-anti-pattern" ~/.cursor/skills/m15-anti-pattern &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/m15-anti-pattern` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/k1-c/linear-tui.git --path .claude/skills/m15-anti-pattern
```

Or copy the folder to `~/.gemini/skills/m15-anti-pattern` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/m15-anti-pattern`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/m15-anti-pattern &&
cp -R "$tmp/.claude/skills/m15-anti-pattern" ~/.copilot/skills/m15-anti-pattern &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/m15-anti-pattern` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/k1-c/linear-tui.git
```

Then copy `linear-tui/.claude/skills/m15-anti-pattern` into your agent's skills folder as `m15-anti-pattern`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does M15 anti pattern need to run?

It is a plain instruction file with no scripts. It is meant for reviewing Rust code, so the agent needs access to the source it is reviewing.

### When does M15 anti pattern trigger?

It triggers when the agent is asked to review code for anti-patterns, common mistakes, code smells, or whether a refactor is worthwhile, including related keywords in English and Chinese.

### Does M15 anti pattern change any files?

The skill only gives the agent review guidance. It does not declare any tools or file changes.

### How do I install M15 anti pattern in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/m15-anti-pattern to use it in all your projects, or to .claude/skills/m15-anti-pattern in one project.

### Does M15 anti pattern run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use M15 anti pattern?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to M15 anti pattern?

The closest alternatives to M15 anti pattern are M01 ownership, Patterns, Coding guidelines, M14 mental model and M11 ecosystem.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [M01 ownership](https://ai-powered.com/skills/m01-ownership): M01 ownership is an open-source agent skill for developer tools.
- [Patterns](https://ai-powered.com/skills/patterns-xiaolai): Patterns is an open-source agent skill for developer tools.
- [Coding guidelines](https://ai-powered.com/skills/coding-guidelines): Coding guidelines is an open-source agent skill for developer tools.
- [M14 mental model](https://ai-powered.com/skills/m14-mental-model): M14 mental model is an open-source agent skill for knowledge and memory.
- [M11 ecosystem](https://ai-powered.com/skills/m11-ecosystem): M11 ecosystem is an open-source agent skill for developer tools.
- [M06 error handling](https://ai-powered.com/skills/m06-error-handling): M06 error handling is an open-source agent skill for developer tools.
- [M10 performance](https://ai-powered.com/skills/m10-performance): M10 performance is an open-source agent skill for developer tools.
- [M03 mutability](https://ai-powered.com/skills/m03-mutability): M03 mutability is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/m15-anti-pattern
