Implements software engineering skills for Rust programming, covering key aspects including the ownership model, async/await, Cargo package manager, and unsafe code practices. Each section provides guidance, examples, and constraints for using these features effectively.
Scanned 6/12/2026
Install via CLI
openskills install paulpas/agent-skill-router---
name: rust-skills-software-engineering
description: Implements software engineering skills for Rust programming, covering key aspects including the ownership model, async/await, Cargo package manager, and unsafe code practices. Each section provides guidance, examples, and constraints for using these features effectively.
license: MIT
compatibility: opencode
metadata:
archetypes: implementation, reference
anti_triggers: documentation, tutorial
response_profile:
verbosity: medium
directive_strength: high
abstraction_level: operational
version: "1.0.0"
domain: coding
triggers: rust, ownership model, async/await, cargo, unsafe code, memory safety
role: implementation
scope: implementation
output-format: code
related-skills: coding/rust/ownership-model, coding/rust/async-await, coding/rust/cargo, coding/rust/unsafe-code
---
# Rust Skills for Software Engineering
Implements software engineering skills for Rust programming, covering key aspects including the ownership model, async/await, Cargo package manager, and unsafe code practices. Each section provides guidance, examples, and constraints for using these features effectively.
## TL;DR Checklist
- [ ] Understand Rust's ownership model and how it ensures memory safety.
- [ ] Utilize async/await for writing non-blocking code.
- [ ] Use Cargo for package management and dependency resolution.
- [ ] Recognize when to apply unsafe code and avoid pitfalls.
---
## When to Use
- When building safe and efficient applications in Rust.
- To implement concurrent programming patterns using async/await.
- For managing dependencies and building projects using Cargo.
- To understand and utilize unsafe code when necessary for performance.
---
## When NOT to Use
- Avoid unsafe code unless absolutely necessary; prefer safe Rust practices.
- Do not use async/await in synchronous contexts.
---
## Core Workflow
1. **Ownership Model** — Understand how ownership, borrowing, and lifetimes work in Rust. Use Rust's compiler to enforce these rules.
2. **Async/Await** — Implement asynchronous functions to leverage concurrent programming in I/O-bound applications. Use tokio or async-std as a runtime.
3. **Cargo** — Create and manage your Rust projects using Cargo, ensuring all dependencies are declared in `Cargo.toml`.
4. **Unsafe Code** — Identify scenarios where unsafe code is necessary; encapsulate it within safe abstractions.
---
## Implementation Patterns
### Pattern 1: Ownership Model
```rust
fn main() {
let s1 = String::from("Hello");
let s2 = s1; // Ownership is moved, s1 is no longer valid
println!("{}", s2); // This is valid
}
```
### Pattern 2: Async/Await
```rust
#[tokio::main]
async fn main() {
let response = fetch_data().await;
println!("Response: {}", response);
}
async fn fetch_data() -> String {
// Perform async operation
"data".to_string()
}
```
### Pattern 3: Using Cargo
```bash
# Create a new Rust project using Cargo
cargo new my_project
# Build the project
cd my_project && cargo build
# Add dependencies in Cargo.toml
```
### Pattern 4: Unsafe Code
```rust
unsafe {
// Unsafe operations that bypass Rust's safety guarantees
}
```
## Constraints
### MUST DO
- Use the ownership model to manage memory safety and prevent data races.
- Use Rust’s type system to enforce correctness at compile time.
### MUST NOT DO
- Avoid memory leaks by adhering to the ownership model; do not create dangling references.
- Do not overuse unsafe code; it should be a last resort for efficiency.
---
## Related Skills
| Skill | Purpose |
|---|---|
| `coding/rust/ownership-model` | A focused skill on Rust’s ownership model |
| `coding/rust/async-await` | A focused skill on asynchronous programming in Rust |
| `coding/rust/cargo` | A focused skill on using Cargo for Rust package management |
| `coding/rust/unsafe-code` | A focused skill on Rust's unsafe code practices |
## Live References
> Authoritative documentation links for this domain. The model follows markdown links at load time to resolve external references and inline content.
- [The Rust Programming Language (Official Book)](https://doc.rust-lang.org/book/) — Official Rust book covering ownership, borrowing, lifetimes, traits, and concurrency
- [Rust API Guidelines](https://rust-lang.github.io/api-guidelines/) — Official Rust API design guidelines for writing idiomatic, consistent libraries
- [Rust by Example](https://doc.rust-lang.org/rust-by-example/) — Official Rust documentation with runnable code examples for all language features
- [Cargo Documentation](https://doc.rust-lang.org/cargo/) — Official Cargo (Rust's package manager and build system) documentation
- [Rust Unsafe Code Guidelines](https://github.com/RustLangUnsafeCode/Guidelines) — Community-maintained safety guidelines for writing correct unsafe Rust codeNo comments yet. Be the first to comment!