Human-friendly and AI-compatible guidelines for building robust, maintainable, and idiomatic Rust applications
This repository provides comprehensive, practical guidelines for Rust development, especially focused on async and service-oriented applications. Whether you're building web services, CLI tools, or distributed systems, these guidelines help you write code that is:
- β Robust β Handle errors gracefully and avoid common pitfalls
- β Maintainable β Clear structure and consistent patterns
- β Idiomatic β Follow Rust community best practices
- β AI-Compatible β Structured for both human developers and AI assistants
π Read the Complete Guidelines
The guidelines cover everything from project setup to advanced API design:
- Latest Rust edition usage
- Workspace management
- Configuration and secrets handling
- Feature-based module structure
- Dependency injection patterns
- Documentation standards
thiserrorand specific error types- Input validation strategies
- Compile-time safety patterns
- Tokio runtime best practices
- Graceful shutdown patterns
- Unit, integration, and property-based testing
- Logging and tracing setup
- Consistent naming conventions
- Ownership and borrowing guidelines
- Generic bounds and
whereclauses
- Browse the guidelines: Start with guidelines.md
- Apply to your project: Use the patterns and examples provided
- Contribute: Found something missing? Open an issue or PR!
- Rust developers building production applications
- Teams establishing coding standards
- AI assistants needing structured Rust guidance
- Anyone wanting to write better Rust code
These guidelines are living documents that evolve with the Rust ecosystem. Contributions, suggestions, and discussions are welcome!
This project is licensed under either of
- EUPL v1.2
- Apache License, Version 2.0
- MIT License
at your option.
Happy coding! π¦