m15-anti-pattern — Claude Code skill for Rust review
Reviews Rust code for anti-patterns and points to idiomatic replacements. Use it during code review or when ownership and error handling become hard to reason about.
npx skills add actionbook/rust-skills --skill m15-anti-pattern -a claude-codeWhat m15-anti-pattern does
m15-anti-pattern flags common Rust issues such as unnecessary .clone() calls, .unwrap() in production code, unnecessary Rc, convenience-driven unsafe, and String where &str fits. It also checks for index loops, ignored #[must_use] results, long functions, and overly public fields.
The skill connects a visible smell to its likely cause. Repeated cloning can signal an unclear ownership model, while lifetime struggles can call for a different data structure. It points to related skills including m01-ownership, m06-error-handling, and m09-domain. You cannot run it as a slash command because user-invocable is disabled.
What it helps with
- find unnecessary
.clone()calls in Rust code - replace
.unwrap()with error handling - trace borrow checker friction to a design issue
- turn index loops into iterator-based code
- review
unsafefor a safe alternative
Example prompts for the agent
- Review this Rust module for anti-patterns and explain each issue.
- Why does this code use so many
.clone()calls? Check the ownership model. - Is this
.unwrap()appropriate for production code?
How to install m15-anti-pattern
1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m15-anti-pattern -a claude-code2Manually: put the files in place
~/.claude/skills/m15-anti-pattern/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/m15-anti-pattern/
1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m15-anti-pattern -a codex2Manually: put the files in place
.agents/skills/m15-anti-pattern/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m15-anti-pattern -a cursor2Manually: put the files in place
.cursor/skills/m15-anti-pattern/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install actionbook/rust-skills m15-anti-pattern2Manually: put the files in place
.github/skills/m15-anti-pattern/SKILL.md1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m15-anti-pattern -a gemini-cli2Platform CLI
gemini skills install https://github.com/actionbook/rust-skills --path skills/m15-anti-patternManually: put the files in place
.devin/skills/m15-anti-pattern/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill m15-anti-pattern -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about m15-anti-pattern
How do I install m15-anti-pattern in Claude Code?
Run npx skills add actionbook/rust-skills --skill m15-anti-pattern -a claude-code, then run npx skills add actionbook/rust-skills --skill m15-anti-pattern -a claude-code again. The skill file is at ~/.claude/skills/m15-anti-pattern/SKILL.md.
What does m15-anti-pattern do?
It reviews Rust code for recurring anti-patterns including excess cloning, .unwrap() usage, unclear ownership, and questionable unsafe. It suggests directions for more idiomatic code.
Can I invoke m15-anti-pattern with a slash command?
No. Manual invocation is disabled, so it is intended to be used when reviewing code through relevant requests about Rust mistakes and code smells.