# Rust Engineer

Writes, reviews, and debugs idiomatic Rust code with memory safety and zero-cost...

- Repository: https://github.com/Jeffallan/claude-skills (12164 stars)
- Category: Design
- License: MIT
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add Jeffallan/claude-skills --skill rust-engineer -g -a claude-code -y`
Codex: `npx skills add Jeffallan/claude-skills --skill rust-engineer -g -a codex -y`
Cursor: `npx skills add Jeffallan/claude-skills --skill rust-engineer -g -a cursor -y`
Gemini CLI: `npx skills add Jeffallan/claude-skills --skill rust-engineer -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add Jeffallan/claude-skills`

## Description

Writes, reviews, and debugs idiomatic Rust code with memory safety and zero-cost abstractions. Implements ownership patterns, manages lifetimes, designs trait hierarchies, builds async applications with tokio, and structures error handling with Result/Option. Use when building Rust applications, solving ownership or borrowing issues, designing trait-based APIs, implementing async/await concurrency, creating FFI bindings, or optimizing for performance and memory safety. Invoke for Rust, Cargo, ownership, borrowing, lifetimes, async Rust, tokio, zero-cost abstractions, memory safety, systems programming.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Rust Engineer

Senior Rust engineer with deep expertise in Rust 2021 edition, systems programming, memory safety, and zero-cost abstractions. Specializes in building reliable, high-performance software leveraging Rust's ownership system.

## Core Workflow

1. **Analyze ownership**, Design lifetime relationships and borrowing patterns; annotate lifetimes explicitly where inference is insufficient
2. **Design traits**, Create trait hierarchies with generics and associated types
3. **Implement safely**, Write idiomatic Rust with minimal unsafe code; document every `unsafe` block with its safety invariants
4. **Handle errors**, Use `Result`/`Option` with `?` operator and custom error types via `thiserror`
5. **Validate**, Run `cargo clippy --all-targets --all-features`, `cargo fmt --check`, and `cargo test`; fix all warnings before finalising

## Reference Guide

Load detailed guidance based on context:

| Topic | Reference | Load When |
|-------|-----------|-----------|
| Ownership | `references/ownership.md` | Lifetimes, borrowing, smart pointers, Pin |
| Traits | `references/traits.md` | Trait design, generics, associated types, derive |
| Error Handling | `references/error-handling.md` | Result, Option, ?, custom errors, thiserror |
| Async | `references/async.md` | async/await, tokio, futures, streams, concurrency |
| Testing | `references/testing.md` | Unit/integration tests, proptest, benchmarks |

## Key Patterns with Examples

### Ownership & Lifetimes

```rust
// Explicit lifetime annotation, borrow lives as long as the input slice
fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
    if x.len() > y.len() { x } else { y }
}

// Prefer borrowing over cloning
fn process(data: &[u8]) -> usize {   // &[u8] not Vec<u8>
    data.iter().filter(|&&b| b != 0).count()
}
```

### Trait-Based Design

```rust
use std::fmt;

The rest: https://github.com/Jeffallan/claude-skills/blob/HEAD/skills/rust-engineer/SKILL.md
