Borrowing it
Nothing to install: this file belongs to ahonn/dotfiles. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/ahonn/dotfiles/master/.claude/skills/rust-design-patterns/SKILL.mdgit clone --depth 1 https://github.com/ahonn/dotfilesWrote 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/ahonn/dotfiles/rust-design-patterns)<a href="https://agentmods.dev/skills/ahonn/dotfiles/rust-design-patterns"><img src="https://agentmods.dev/badge/skills/ahonn/dotfiles/rust-design-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/ahonn/dotfiles/rust-design-patterns"><img src="https://agentmods.dev/badge/skills/ahonn/dotfiles/rust-design-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 2 findings, up to high
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- high YARA Match · line 151 YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).Fix: Remove offensive tool references and exploit code. Legitimate agent skills should not contain penetration testing tools, exploit frameworks, or reconnaissance utilities.
- medium Excessive Agency · line 183 Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.Fix: Set explicit rate limits, timeouts, and resource quotas for API calls, file operations, and compute. Implement circuit breakers for runaway loops.
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.00026 | $0.00713 |
| Opus 5.5 | $0.00010 | $0.00285 |
| Sonnet 5.5 | $0.00005 | $0.00143 |
| Haiku 4.5 | $0.00003 | $0.00071 |
Grade A, and why
rust-design-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 1mo 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 — 43 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Rust Design Patterns
Start from the compiler error, API decision, or code under review. Read only the reference sections that match; the catalog is not a checklist to apply everywhere.
Establish applicability
- Check the crate's edition, MSRV, and whether it is a library or binary. Library crates carry compatibility constraints (
non_exhaustive, lint policy, public types) that binaries do not. - Follow the crate's existing conventions for errors, builders, and unsafe boundaries before introducing a new pattern.
- For borrow checker errors, reshape ownership before reaching for
clone,Rc, orArc. Treat a clone as a deliberate cost, not a way to silence the compiler. - When a lifetime is too short and no borrow reshaping fits, prefer an owned type over widening lifetimes or adding
'staticbounds.
Read by problem
| Problem or decision | Reference |
|---|---|
Move a value out of &mut, or swap enum variants |
ownership-patterns.md — mem::take and mem::replace |
| Borrow two fields of a struct independently | ownership-patterns.md — Struct Decomposition |
| Choosing shared ownership, or tempted to clone | ownership-patterns.md — Rc/Arc Decision Guide |
| Guaranteed cleanup (locks, files, transactions) | ownership-patterns.md — RAII Guards, Finalisation in Destructors |
| Unsafe code needs a safe boundary | ownership-patterns.md — Contain Unsafety in Small Modules |
Function parameter types (&str vs &String) |
api-design.md — Borrowed Types for Arguments |
| Many optional constructor parameters | api-design.md — Builder Pattern, Default Trait |
| Distinct types over the same representation | api-design.md — Newtype Pattern |
| Compile-time state transitions | api-design.md — Type State Pattern |
| Public types that must evolve without breaking callers | api-design.md — non_exhaustive, Constructor Conventions |
| FFI errors, strings, or object lifetimes | api-design.md — FFI Patterns |
| Dynamic dispatch without boxing | idioms.md — On-Stack Dynamic Dispatch |
Closure captures, post-setup immutability, Option in iterator chains |
idioms.md |
| A consuming call fails and the caller needs the value back | idioms.md — Return Consumed Argument on Error |
| Reviewing existing Rust for common mistakes | common-pitfalls.md — start with Review Checklist |
What ships with it
4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 1mo ago Changed · -273 lines · -51 tokens per session bb905b8dce85
- 1mo ago First seen · 316 lines · 77 tokens per session scan A da8cc58bf1fb
rust-design-patterns is a skill published in the GitHub repository ahonn/dotfiles (63 stars, last pushed 6d ago), licensed MIT. It adds 26 tokens to every session and 713 once invoked, about $0.0001 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.
Other skills, from other repositories
scaffold-rust
Scaffold a complete Rust project with CI/CD, release pipeline, and sr.yaml. Uses cargo as the native build system. Loads on top of scaffold-project (run that first for cross-language standard files). Use when creating a new Rust CLI, library, or workspace, or when the user mentions "new Rust project", "cargo init", or…
polars
Fast in-memory DataFrame library for datasets that fit in RAM. Use when pandas is too slow but data still fits in memory. Lazy evaluation, parallel execution, Apache Arrow backend. Best for 1-100GB datasets, ETL pipelines, faster pandas replacement. For larger-than-RAM data use dask or vaex.
gtars
High-performance toolkit for genomic interval analysis in Rust with Python bindings. Use when working with genomic regions, BED files, coverage tracks, overlap detection, tokenization for ML models, or fragment analysis in computational genomics and machine learning applications.
astropy
Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.
scaffold-go
Scaffold a complete Go project with CI/CD, release pipeline, Makefile, sr.yaml, .envrc, and standard files. Uses go toolchain and make as the native build system. Loads on top of scaffold-project (run that first for cross-language standard files). Use when creating a new Go CLI, service, or module, or when the user…
scaffold-node
Scaffold a complete Node/TypeScript project with CI/CD, release pipeline, sr.yaml, .envrc, and standard files. Uses pnpm and biome. Loads on top of scaffold-project (run that first for cross-language standard files). Use when creating a new Node.js app, TypeScript library, or website, or when the user mentions "new…