AgentStack
SKILL verified MIT Self-run

Rust Engineering

skill-galaxyruler-galactic-skills-rust-engineering · by GalaxyRuler

Production-grade Rust engineering guidelines — ownership, type-driven design, error handling, async/concurrency, testing, security, and performance. Use when writing new Rust applications, designing Rust architecture, refactoring Rust code, implementing async/concurrency, integrating databases (SQLx/SeaORM/Diesel), configuring Rust CI/CD pipelines, building with axum/actix-web/Tauri/WASM, or perf…

No reviews yet
0 installs
15 views
0.0% view→install

Install

$ agentstack add skill-galaxyruler-galactic-skills-rust-engineering

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README — it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-galaxyruler-galactic-skills-rust-engineering)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
17d ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming — see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps — measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Rust Engineering? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

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 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](REVIEW.md)

Ownership & borrowing

  • Prefer &T over .clone(). Clone only when ownership transfer unavoidable.
  • Tree-like ownership hierarchies; avoid circular graphs.
  • Cow for conditional ownership when mutation is rare.
  • Rc single-threaded, Arc multi-threaded shared ownership.
  • RefCell single-threaded / Mutex+RwLock 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 unless heterogeneous collections required.

Error handling

  • Result + ? 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.

Observability

  • tracing crate for structured, span-based instrumentation. #[instrument] on async functions.
  • tracing-subscriber with fmt layer (dev) and json layer (prod). Filter via RUST_LOG env var.
  • Pair with tracing-opentelemetry for distributed trace export when needed.

Project structure

  • main.rs minimal entry point, lib.rs core domain logic. Cargo Workspaces for multi-crate.
  • Newtype pattern (struct UserId(u64)) for domain boundaries.
  • Typestate pattern for state-machine transitions enforced at compile time.

Testing

  • #[test] in #[cfg(test)] module for unit tests. tests/ dir for integration tests.
  • cargo-nextest for parallel execution. mockall/wiremock for mocking. proptest for property-based testing. cargo-fuzz for untrusted input.

Architecture, security, performance

Domain-specific backends (axum, actix-web, Tauri, WASM), database paradigms (SQLx, SeaORM, Diesel), supply-chain auditing, unsafe constraints, deployment: [ARCHITECTURE.md](ARCHITECTURE.md), [SECURITY-PERF.md](SECURITY-PERF.md).

For Tauri desktop/mobile apps, see the [tauri-engineering](../tauri-engineering/SKILL.md) skill — it covers guest-host architecture, IPC commands, ACL security, and binary optimization.

Anti-patterns & review checklist

Critical anti-patterns (locks across await, stringly-typed interfaces, N+1 queries, missing graceful shutdown) and the full review checklist: [REVIEW.md](REVIEW.md).

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.