rust-core

Enforces ownership, borrowing, and error-handling best practices in Rust code.

Updated Feb 16, 2026
One-click install
npx skills add https://github.com/hwatkins/my-skills --skill rust-core-hwatkins
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-core
Source: https://github.com/hwatkins/my-skills/tree/main/skills/rust-core
Command: npx skills add https://github.com/hwatkins/my-skills --skill rust-core-hwatkins

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rust projects often struggle with memory safety bugs and complex ownership semantics. This skill provides a practical, opinionated set of rules and patterns to write safe, idiomatic Rust that minimizes unsafe code and clarifies lifetimes.

Core Features & Use Cases

  • Emphasizes ownership, borrowing, and lifetimes to prevent data races and invalid references.
  • Promotes explicit error handling, trait-based design, and zero-cost abstractions for robust libraries and apps.
  • Use cases include refactoring legacy Rust code, designing safe APIs, and building performant systems software.

Quick Start

Refactor a small Rust module to demonstrate proper ownership, borrowing, and lifetimes following the guidelines.

Frequently Asked Questions about rust-core

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix Rust ownership and borrowing errors when refactoring?

Fix Rust ownership and borrowing errors by applying strict rules for lifetime correctness and data race prevention, guiding you to refactor legacy code into safe, idiomatic Rust without unsafe blocks.

What's the best way to handle errors in a Rust library?

The best way to handle errors in a Rust library is using explicit error handling with thiserror and Result types, ensuring rigorous memory safety and clear abstractions for robust systems programming.

How does trait-based design work for Rust systems programming?

Trait-based design in Rust systems programming works by promoting zero-cost abstractions and clear interfaces, enabling you to build performant systems software with robust, safe APIs.

Can I use these Rust guidelines for both application and library codebases?

Yes, you can apply these Rust guidelines to both application and library codebases, as they enforce memory safety, ownership rules, and error handling best practices across systems programming projects.

Why does Rust require explicit lifetimes and how do I manage them?

Rust requires explicit lifetimes to prevent invalid references and clarify ownership semantics, managing them through opinionated patterns that enforce borrowing rules for safe memory usage.

When should I avoid unsafe code in Rust?

You should avoid unsafe code in Rust when safe, idiomatic patterns using ownership, borrowing, and trait-based design can achieve the same performance and memory safety without associated risks.