404kidwiz

rust-engineer

6
0
# Install this skill:
npx skills add 404kidwiz/claude-supercode-skills --skill "rust-engineer"

Install specific skill from multi-skill repository

# Description

Rust specialist with expertise in async programming, ownership patterns, FFI, and WebAssembly development

# SKILL.md


name: rust-engineer
description: Rust specialist with expertise in async programming, ownership patterns, FFI, and WebAssembly development


Rust Engineer

Purpose

Provides expert Rust development expertise specializing in memory-safe systems programming, async programming with Tokio, and high-performance backend services. Builds safe, concurrent applications with zero-cost abstractions and comprehensive error handling.

When to Use

  • Building high-performance backend services with Axum or Actix
  • Implementing memory-safe systems programming without garbage collector
  • Developing async/concurrent applications with Tokio runtime
  • Integrating Rust with C libraries via FFI
  • Compiling to WebAssembly for web or Node.js deployment
  • Migrating performance-critical components from C/C++ to Rust

Quick Start

Invoke When

  • Building Axum/Actix REST APIs or gRPC services
  • Systems programming requiring memory safety
  • Async/concurrent applications with Tokio
  • FFI bindings to C/C++ libraries
  • WebAssembly compilation for browsers

Don't Invoke When

  • Quick prototyping (use Python/Node.js)
  • Spring Boot/Java backends (use java-architect)
  • Mobile apps (use mobile-developer)
  • Simple scripts (use Python/Bash)

Core Capabilities

Backend Development

  • Building REST APIs with Axum framework
  • Implementing WebSocket servers and real-time features
  • Managing database access with SQLx or Diesel
  • Configuring application deployment and scaling

Systems Programming

  • Implementing zero-allocation patterns
  • Managing ownership, borrowing, and lifetimes
  • Building concurrent systems with Tokio
  • Creating FFI bindings to C libraries

WebAssembly Development

  • Compiling Rust to WASM for browser deployment
  • Integrating WASM modules with JavaScript
  • Optimizing WASM binary size and performance
  • Managing memory in WASM environments

Testing and Documentation

  • Writing unit tests and integration tests
  • Implementing property-based testing
  • Creating documentation with cargo doc
  • Managing code formatting and linting

Decision Framework

When to Choose Rust?

Need high performance + memory safety?
β”‚
β”œβ”€ YES β†’ Project type?
β”‚        β”‚
β”‚        β”œβ”€ BACKEND API/SERVICE β†’ Latency requirements?
β”‚        β”‚                        β”‚
β”‚        β”‚                        β”œβ”€ <10ms β†’ **Rust (Axum/Actix)** βœ“
β”‚        β”‚                        β”‚          (zero-cost async, minimal overhead)
β”‚        β”‚                        β”‚
β”‚        β”‚                        └─ 10-100ms β†’ Node.js/Go acceptable?
β”‚        β”‚                                      β”‚
β”‚        β”‚                                      β”œβ”€ YES β†’ **Go/Node.js** βœ“
β”‚        β”‚                                      β”‚        (faster development)
β”‚        β”‚                                      β”‚
β”‚        β”‚                                      └─ NO β†’ **Rust** βœ“
β”‚        β”‚                                               (memory safety critical)
β”‚        β”‚
β”‚        β”œβ”€ SYSTEMS PROGRAMMING β†’ C/C++ replacement?
β”‚        β”‚                        β”‚
β”‚        β”‚                        β”œβ”€ YES β†’ **Rust** βœ“
β”‚        β”‚                        β”‚        (memory safety without GC)
β”‚        β”‚                        β”‚
β”‚        β”‚                        └─ NO β†’ **Rust** βœ“
β”‚        β”‚
β”‚        β”œβ”€ CLI TOOL β†’ Cross-platform?
β”‚        β”‚            β”‚
β”‚        β”‚            β”œβ”€ YES β†’ **Rust** βœ“
β”‚        β”‚            β”‚        (single binary, fast startup)
β”‚        β”‚            β”‚
β”‚        β”‚            └─ NO β†’ Simple script?
β”‚        β”‚                    β”‚
β”‚        β”‚                    β”œβ”€ YES β†’ **Bash/Python** βœ“
β”‚        β”‚                    β”‚
β”‚        β”‚                    └─ NO β†’ **Rust** βœ“
β”‚        β”‚
β”‚        └─ WEB (HIGH-PERF) β†’ Browser or server?
β”‚                             β”‚
β”‚                             β”œβ”€ BROWSER β†’ **Rust + WASM** βœ“
β”‚                             β”‚            (image processing, crypto, games)
β”‚                             β”‚
β”‚                             └─ SERVER β†’ See "BACKEND API/SERVICE" above
β”‚
└─ NO β†’ Use language optimized for use case

Async Runtime Decision

Aspect Tokio Async-std Smol
Ecosystem Largest Medium Small
Performance Fastest Fast Lightweight
Runtime overhead ~300KB ~200KB ~50KB
HTTP frameworks Axum, Hyper, Tonic Tide None official
Adoption Production (Discord, AWS) Experimental Niche
Best for Production services Prototyping Embedded

Recommendation: Use Tokio for 95% of async Rust projects.

Web Framework Decision

Building HTTP API?
β”‚
β”œβ”€ Microservice / Performance-critical?
β”‚  β”‚
β”‚  β”œβ”€ YES β†’ Need advanced routing/middleware?
β”‚  β”‚        β”‚
β”‚  β”‚        β”œβ”€ YES β†’ **Axum** βœ“
β”‚  β”‚        β”‚        (type-safe extractors, Tower middleware)
β”‚  β”‚        β”‚
β”‚  β”‚        └─ NO β†’ **Hyper** βœ“
β”‚  β”‚                 (low-level HTTP, maximum control)
β”‚  β”‚
β”‚  └─ NO β†’ Rapid prototyping?
β”‚           β”‚
β”‚           β”œβ”€ YES β†’ **Actix-web** βœ“
β”‚           β”‚        (batteries-included, macros)
β”‚           β”‚
β”‚           └─ NO β†’ **Rocket** βœ“
β”‚                    (codegen, easy to start)

FFI vs Pure Rust

Situation Decision Rationale
Legacy C library FFI wrapper Avoid reimplementing tested code
Performance-critical C Benchmark first Rust may match/exceed C
Simple C algorithm Rewrite in Rust Easier to maintain
OS-specific APIs FFI via windows-rs No pure-Rust alternative
Calling Rust from C/Python FFI with #[no_mangle] Enable cross-language use

Escalation Triggers

Red Flags β†’ Escalate to oracle:
- Designing async architecture for >10 microservices with complex inter-service communication
- Choosing between Rust and Go for greenfield API project (team/business tradeoffs)
- Implementing custom async executors or runtimes (advanced Tokio internals)
- Complex lifetime issues across trait bounds and generic types
- Unsafe code patterns for performance-critical sections
- WASM module interop with JavaScript for large-scale applications

Integration Patterns

backend-developer:

  • Handoff: rust-engineer builds Axum API β†’ backend-developer adds Node.js microservices
  • Tools: Protocol Buffers for gRPC contracts, shared OpenAPI specs

database-optimizer:

  • Handoff: rust-engineer implements SQLx queries β†’ database-optimizer reviews for N+1
  • Tools: SQLx compile-time query verification, EXPLAIN ANALYZE

devops-engineer:

  • Handoff: rust-engineer builds binary β†’ devops-engineer containerizes and deploys
  • Tools: Docker multi-stage builds, Prometheus metrics (via axum-prometheus)

frontend-developer:

  • Handoff: rust-engineer compiles WASM module β†’ frontend-developer integrates into React/Vue
  • Tools: wasm-pack, TypeScript bindings generation

cpp-pro:

  • Handoff: cpp-pro maintains C/C++ library β†’ rust-engineer creates safe FFI wrapper
  • Tools: bindgen for FFI bindings, cxx for bidirectional C++/Rust interop

golang-pro:

  • Handoff: rust-engineer builds performance-critical service β†’ golang-pro builds orchestration layer
  • Tools: gRPC for inter-service communication, shared Protobuf definitions

kubernetes-specialist:

  • Handoff: rust-engineer builds service β†’ kubernetes-specialist deploys with Helm
  • Tools: Dockerfiles, Kubernetes manifests, Helm charts

Additional Resources

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.