rust-engineering

rust-engineering is a skill for Claude Code, Codex from GalaxyRuler/Galactic-skills. It costs 110 tokens per session (1,012 once invoked), scanned A, original, MIT.

A set of guidelines for building production Rust software with safe types, explicit errors, controlled concurrency, testing, security, and performance in mind. Rust is a programming language designed to prevent many memory and threading errors.

In plain words
What is it for?
Use it when creating, refactoring, designing, reviewing, or integrating Rust applications, asynchronous code, databases, CLIs, desktop apps, or WebAssembly.
Why use it?
It helps keep Rust code maintainable and reliable by catching invalid states early and avoiding unsafe error handling or unbounded operations.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/galaxyruler/galactic-skills/rust-engineering
Any agent
npx skills add GalaxyRuler/Galactic-skills --skill rust-engineering
Clone the repo
git clone --depth 1 https://github.com/GalaxyRuler/Galactic-skills

Made for: Claude Code, Codex.

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-engineering

README.md
[![agentmods](https://agentmods.dev/badge/skills/galaxyruler/galactic-skills/rust-engineering.svg)](https://agentmods.dev/skills/galaxyruler/galactic-skills/rust-engineering)
Your own site
<a href="https://agentmods.dev/skills/galaxyruler/galactic-skills/rust-engineering"><img src="https://agentmods.dev/badge/skills/galaxyruler/galactic-skills/rust-engineering.svg" alt="Measured on agentmods" height="20"></a>
Per session 110 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,012 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00110 $0.01012
Opus 5 $0.00055 $0.00506
Sonnet 5 $0.00022 $0.00202
Haiku 4.5 $0.00011 $0.00101

Measured 5d ago against content hash 280ccca4bd52, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rust-engineering 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 5d 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.

skills/rust-engineering/SKILL.md · 76 lines

How it starts

The opening of the file, as written. The whole thing — 76 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Rust Engineering

Strict operational guidelines for generating, refactoring, and reviewing production Rust code.

Core principles

  1. Make illegal states unrepresentable — ADTs (enums/structs) + Typestate eliminate invalid states at compile time
  2. Explicit over implicitResult<T, E> everywhere, no .unwrap() in production paths
  3. Pragmatism (KISS/YAGNI) — simplest correct solution wins; no premature trait objects
  4. Zero-cost abstractions — monomorphized generics + ownership = safety without GC overhead

Agent workflow

  1. Analyze context — determine domain (backend API, CLI, Tauri desktop, WASM frontend) → select patterns
  2. Enforce type design — scaffold data model with Newtypes and Enums
  3. Implement — strict ownership, borrowing, async concurrency rules
  4. Validate & secure — error propagation, structured logging, no unbounded/unsafe vulnerabilities
  5. Review — run code review checklist before finalizing. See REVIEW.md

Ownership & borrowing

  • Prefer &T over .clone(). Clone only when ownership transfer unavoidable.
  • Tree-like ownership hierarchies; avoid circular graphs.
  • Cow<'a, T> for conditional ownership when mutation is rare.
  • Rc<T> single-threaded, Arc<T> multi-threaded shared ownership.
  • RefCell<T> single-threaded / Mutex<T>+RwLock<T> multi-threaded interior mutability.

Lifetimes & traits

  • Rely on elision rules. Explicit annotations: short lowercase ('a, 'ctx).
  • Derive Debug, Clone, PartialEq, Eq, Default on public types.
  • Prefer impl Trait / generics (static dispatch) over Box<dyn Trait> unless heterogeneous collections required.

Error handling

  • Result<T, E> + ? operator for all fallible operations.
  • thiserror for library error enums, anyhow for application context.
  • .unwrap()/.expect() only for statically proven invariants (compiler blind spots).

Async / concurrency

  • IO-bound → tokio::spawn. CPU-bound → tokio::task::spawn_blocking or Rayon.
  • Never hold std::sync::Mutex across .await. Use tokio::sync::Mutex or channels.

Read the full file on GitHub · 76 lines

Files

What ships with it

5 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. 5d ago First seen · 76 lines · 110 tokens per session scan A 280ccca4bd52

Subscribe to this mod's changes

rust-engineering is a skill published in the GitHub repository GalaxyRuler/Galactic-skills (5 stars, last pushed today), licensed MIT. It adds 110 tokens to every session and 1,012 once invoked, about $0.0006 per session on Opus 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-08-31.