rust-engineer
Qué hace
Guía al agente de IA para escribir código Rust fiable con una fuerte seguridad de memoria. Está pensada para desarrolladores que construyen sistemas o software sensible al rendimiento en Rust.
Cuándo usarla
- ✓Cuando luchas con errores de propiedad o de préstamo en código de Rust.
- ✓Cuando necesitas diseñar traits o APIs genéricas en Rust.
- ✓Cuando construyes una app asíncrona de Rust con tokio.
Link de la skill
https://github.com/Jeffallan/claude-skills/blob/main/skills/rust-engineer/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Corrige los errores del borrow checker de este archivo de Rust y limpia el manejo de errores con thiserror.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente averigua las relaciones de lifetimes y de préstamo, diseña los traits y gestiona los errores con Result y el operador de interrogación. Después ejecuta clippy, rustfmt y el conjunto de pruebas.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
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
- Analyze ownership — Design lifetime relationships and borrowing patterns; annotate lifetimes explicitly where inference is insufficient
- Design traits — Create trait hierarchies with generics and associated types
- Implement safely — Write idiomatic Rust with minimal unsafe code; document every
unsafeblock with its safety invariants - Handle errors — Use
Result/Optionwith?operator and custom error types viathiserror - Validate — Run
cargo clippy --all-targets --all-features,cargo fmt --check, andcargo 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
// 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
use std::fmt;
trait Summary {
fn summarise(&self) -> String;
fn preview(&self) -> String { // default implementation
format!("{}...", &self.summarise()[..50])
}
}
#[derive(Debug)]
struct Article { title: String, body: String }
impl Summary for Article {
fn summarise(&self) -> String {
format!("{}: {}", self.title, self.body)
}
}
Error Handling with thiserror
use thiserror::Error;
#[derive(Debug, Error)]
pub enum AppError {
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("parse error for value `{value}`: {reason}")]
Parse { value: String, reason: String },
}
// ? propagates errors ergonomically
fn read_config(path: &str) -> Result<String, AppError> {
let content = std::fs::read_to_string(path)?; // Io variant via #[from]
Ok(content)
}
Async / Await with Tokio
use tokio::time::{sleep, Duration};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let result = fetch_data("https://example.com").await?;
println!("{result}");
Ok(())
}
async fn fetch_data(url: &str) -> Result<String, reqwest::Error> {
let body = reqwest::get(url).await?.text().await?;
Ok(body)
}
// Spawn concurrent tasks — never mix blocking calls into async context
async fn parallel_work() {
let (a, b) = tokio::join!(
sleep(Duration::from_millis(100)),
sleep(Duration::from_millis(100)),
);
}
Validation Commands
cargo fmt --check # style check
cargo clippy --all-targets --all-features # lints
cargo test # unit + integration tests
cargo test --doc # doctests
cargo bench # criterion benchmarks (if present)
Constraints
MUST DO
- Use ownership and borrowing for memory safety
- Minimize unsafe code (document all unsafe blocks with safety invariants)
- Use type system for compile-time guarantees
- Handle all errors explicitly (
Result/Option) - Add comprehensive documentation with examples
- Run
cargo clippyand fix all warnings - Use
cargo fmtfor consistent formatting - Write tests including doctests
MUST NOT DO
- Use
unwrap()in production code (preferexpect()with messages) - Create memory leaks or dangling pointers
- Use
unsafewithout documenting safety invariants - Ignore clippy warnings
- Mix blocking and async code incorrectly
- Skip error handling
- Use
Stringwhen&strsuffices - Clone unnecessarily (use borrowing)
Output Templates
When implementing Rust features, provide:
- Typ
Preguntas frecuentes
¿Qué comprobaciones ejecuta?
Ejecuta cargo clippy con todos los targets y features, cargo fmt --check y cargo test.
¿Usa código unsafe?
Reduce el código unsafe al mínimo y documenta las reglas de seguridad de cada bloque unsafe.
¿Qué runtime asíncrono usa?
Trabaja con tokio para el código asíncrono.
Detalles
Descripción original del autor
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 pro
repo: Jeffallan/claude-skills
Popularidad
- Estrellas en GitHub
- 12 mil
- Posición en el ranking
- #11452
- Licencia
- MIT
- Actualizada
- 30/10/2026
Comentarios
- …
Más skills de este repositorio
angular-architect
12 milAyuda a tu agente a construir apps de Angular 17 y posteriores con componentes independientes, enrutamiento con carga diferida, estado con NgRx, patrones de RxJS y optimización del rendimiento.
api-designer
12 milAyuda a tu agente a diseñar APIs REST o GraphQL y a escribir especificaciones OpenAPI 3.1, con reglas para recursos, paginación, formatos de error y versionado.
architecture-designer
12 milAyuda a tu agente a diseñar la arquitectura de un sistema, comparar patrones y tecnologías, y escribir Registros de Decisiones de Arquitectura que expliquen cada elección.
atlassian-mcp
12 milAyuda a tu agente a buscar y actualizar incidencias de Jira y páginas de Confluence mediante MCP, incluidas las consultas JQL y CQL, los sprints y la sincronización de la documentación.
Skills parecidas
diffs
394 milPermite que tu agente genere un diff real y compartible de los cambios, como enlace de visualización o archivo de imagen, en lugar de un resumen escrito a mano.
coding-agent
394 milAyuda a tu agente a pasar un trabajo de programación grande a Codex, Claude Code u OpenCode como trabajador en segundo plano, y después revisar su progreso.
gh-issues
394 milAyuda a tu agente a encontrar incidencias de GitHub, elegir cuáles trabajar y abrir pull requests con correcciones, incluido el seguimiento de los comentarios de revisión.