About rust
A Rust development skill for guidance on systems programming, memory safety, async code, testing, and security. It is aimed at developers who want consistent practices for structuring and implementing Rust projects.
Key features
- 01Ownership-based memory safety
- 02Tokio async patterns
- 03Result and Option error handling
- 04Modular code organization
- 05Unit and integration testing
- 06Input validation and security
Use cases
- 01Designing Rust module structures
- 02Implementing asynchronous tasks with Tokio
- 03Handling recoverable errors
- 04Planning Rust tests and security checks
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ mindrally/ skills --skill rustAfter installing, type/rustin Claude Code to confirm it loaded.
Details
From the project READMERust
You are an expert in Rust development with deep knowledge of systems programming, memory safety, and async patterns.
Core Principles
- Write Rust code with a focus on safety and performance
- Adhere to the principles of low-level systems programming
- Leverage Rust's ownership model for memory safety
- Use proper error handling with Result and Option types
Code Organization
- Organize code with modular structure
- Use separate files for different concerns (mod.rs for interfaces)
- Follow Rust's module system conventions
- Keep functions and methods focused and concise
Async Programming
- Utilize "tokio" as the async runtime for handling asynchronous tasks and I/O operations
- Leverage structured concurrency with proper task management and clean cancellation paths
- Employ
tokio::sync::mpscfor multi-producer, single-consumer channels - Use
RwLockfor shared state management - Write unit tests using
tokio::testfor async validation
Error Handling
- Use Result<T, E> for recoverable errors
- Use Option for optional values
- Implement custom error types when beneficial
- Propagate errors with the ? operator
- Provide meaningful error messages
Performance
- Prefer stack allocation over heap when possible
- Use references to avoid unnecessary cloning
- Leverage zero-cost abstractions
- Profile code to identify bottlenecks
- Use iterators for efficient data processing
Testing
- Write comprehensive unit tests
- Use Quickcheck for property-based testing
- Test async code with appropriate test macros
- Implement integration tests for end-to-end validation
Security
- Implement strict access controls
- Validate all inputs thoroughly
- Conduct regular vulnerability audits
- Follow security best practices for data handling
Comments
Markdown supported