Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add heyAyushh/stacc --skill anti-patternsgit clone --depth 1 https://github.com/heyAyushh/staccWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/heyayushh/stacc/anti-patterns)<a href="https://agentmods.dev/skills/heyayushh/stacc/anti-patterns"><img src="https://agentmods.dev/badge/skills/heyayushh/stacc/anti-patterns/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/heyayushh/stacc/anti-patterns"><img src="https://agentmods.dev/badge/skills/heyayushh/stacc/anti-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00044 | $0.00753 |
| Opus 5.5 | $0.00018 | $0.00301 |
| Sonnet 5.5 | $0.00009 | $0.00151 |
| Haiku 4.5 | $0.00004 | $0.00075 |
Grade A, and why
rust-anti-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.
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?
Top 5 Beginner Mistakes
| Rank | Mistake | Fix |
|---|---|---|
| 1 | Clone to escape borrow checker | Use references |
| 2 | Unwrap in production | Propagate with ? |
| 3 | String for everything | Use &str |
| 4 | Index loops | Use iterators |
| 5 | Fighting lifetimes | Restructure to own data |
Anti-Pattern Reference
| Anti-Pattern | Why Bad | Better |
|---|---|---|
.clone() everywhere |
Hides ownership issues | Proper references or ownership |
.unwrap() in production |
Runtime panics | ?, expect, or matching |
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 _ = |
Code Smell → Refactoring
| Smell | Indicates | Refactoring |
|---|---|---|
Many .clone() |
Ownership unclear | Clarify data flow |
Many .unwrap() |
Error handling missing | Add proper handling |
Many pub fields |
Encapsulation broken | Private + accessors |
| Deep nesting | Complex logic | Extract methods |
| Long functions | Multiple responsibilities | Split |
| Giant enums | Missing abstraction | Trait + types |
Quick Review Checklist
- No
.clone()without justification - No
.unwrap()in library code - No
pubfields with invariants - No index loops when iterator works
- No
Stringwhere&strsuffices - No ignored
#[must_use]warnings - No
unsafewithout// SAFETY:comment - No giant functions (>50 lines)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 96 lines · 44 tokens per session scan A 6077ff0a7f91
rust-anti-patterns is a skill published in the GitHub repository heyAyushh/stacc (3 stars, last pushed 2mo ago), licensed MIT. It adds 44 tokens to every session and 753 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
rust-anti-patterns compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| rust-anti-patternsheyAyushh/stacc | Skill | 3 | 2mo ago | MIT | A | 44 | Claude Code, Codex |
| rust-best-practicesbgauryy/octocode | Skill | 977 | today | MIT | A | 47 | Claude Code, Codex |
| rust-skillsleonardomso/rust-skills | Skill | 801 | 9d ago | MIT | A | 56 | Claude Code, Codex |
| cargo-fallowfallow-rs/fallow-skills | Skill | 146 | today | MIT | A | 104 | Claude Code, Codex |
| laravel-rust-best-practicesAsyrafHussin/agent-skills | Skill | 118 | 2d ago | MIT | A | 236 | Claude Code, Codex |
| rust-for-laravel-developersAsyrafHussin/agent-skills | Skill | 118 | 2d ago | MIT | A | 229 | Claude Code, Codex |
| laravel-php-to-rustAsyrafHussin/agent-skills | Skill | 118 | 2d ago | MIT | A | 185 | Claude Code, Codex |