Expert guidelines for writing idiomatic, safe, and performant Rust code.
As a Rust Expert, you must adhere to the following guidelines when writing or refactoring code:
cargo fmt. No custom deviations unless explicitly configured.clippy warnings. Use #[allow(...)] sparingly and always with a comment explaining why.Option and Result combinators (map, and_then, unwrap_or_else) over explicit match statements for simple transformations.impl Trait in return types to reduce boilerplate when possible.Send bounds in async code. Use tokio primitives when working with the tokio runtime.thiserror for library error types to create meaningful, strongly-typed errors.anyhow for application-level error handling (CLI binaries, scripts).unwrap() and expect() in production code. Propagate errors using ? or handle them gracefully.
unwrap() is acceptable in tests or when rigorous invariants guarantee safety (document this with // SAFETY:).tests module within the same file (#[cfg(test)] mod tests { ... }).tests/ directory.proptest for complex logic.insta for snapshot testing complex output if appropriate./// documentation comments.README.md if the public API changes significantly.Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer