dotfiles: Skill for Claude Code

.claude/skills/rust-design-patterns/SKILL.md

rust-design-patterns is a skill for Claude Code from ahonn/dotfiles. It costs 26 tokens per session (713 once invoked), scanned A, original, MIT.

A guide to Rust idioms and design patterns, including ownership, borrowing, error handling, API design, and resource cleanup.

In plain words
What is it for?
Use it when writing or reviewing Rust code, fixing borrow-checker or lifetime errors, designing APIs, or working with unsafe code and foreign-function interfaces.
Why use it?
It helps developers solve Rust-specific problems and choose code structures that fit the language.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions AGENTS.md.

This is ahonn/dotfiles's own configuration. It tells Claude Code how to work on dotfiles itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything dotfiles configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/ahonn/dotfiles/master/.claude/skills/rust-design-patterns/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/ahonn/dotfiles

Made for: Claude Code.

Wrote 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.

agentmods badge for rust-design-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/ahonn/dotfiles/rust-design-patterns/github.svg)](https://agentmods.dev/skills/ahonn/dotfiles/rust-design-patterns)
Your own site
<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.

agentmods 80×15 button for rust-design-patterns

Your own site · 80×15
<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>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 713 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
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.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 1mo ago against content hash bb905b8dce85, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

.claude/skills/rust-design-patterns/SKILL.md · 43 lines

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, or Arc. 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 'static bounds.

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

Read the full file on GitHub · 43 lines

Files

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.

Changes

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.

  1. 1mo ago Changed · -273 lines · -51 tokens per session bb905b8dce85
  2. 1mo ago First seen · 316 lines · 77 tokens per session scan A da8cc58bf1fb

Subscribe to this mod's changes

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.

Related

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…

urmzd/dotfiles · 102 tokens

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.

magic3007/dotfiles · 69 tokens

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.

magic3007/dotfiles · 50 tokens

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.

magic3007/dotfiles · 56 tokens

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…

urmzd/dotfiles · 116 tokens

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…

urmzd/dotfiles · 119 tokens