rust-testing-code-review
Reviews Rust test code for unit test patterns, integration test structure, async testing, mocking approaches, and property-based testing. Covers Rust 2024 edition changes including async fn in traits for mocks,
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/anderskev/rust-testing-code-reviewWhat This Skill Does
The rust-testing-code-review skill acts as a specialized auditor for your Rust project's testing suite. It enforces standard community practices, ensures test maintainability, and identifies common pitfalls in Rust testing. By leveraging this skill, developers ensure that their unit tests, integration tests, and async test setups are robust and idiomatic. The skill scans for structural issues like incorrect module placement, suboptimal assertion usage, improper async runtime handling, and poor error path coverage, providing actionable feedback to elevate code quality.
Installation
To integrate this skill into your environment, run the following command via the OpenClaw CLI:
clawhub install openclaw/skills/skills/anderskev/rust-testing-code-review
Use Cases
- Automated Code Reviews: Use this on pull requests to ensure new test files adhere to the project's testing philosophy.
- Refactoring Support: When moving code or changing architectural patterns, use this skill to check if your test organization remains consistent with the module structure.
- Async Optimization: Ideal for developers transitioning legacy sync code to async-await patterns to verify that
tokioruntime configurations are correctly implemented. - Security and Edge Cases: Ensures that error variants and panic conditions are properly handled rather than glossing over failure modes.
Example Prompts
- "Please review the file
src/services/auth_test.rsand check if our async mocking strategy follows best practices for trait-based dependency injection." - "Analyze the
tests/integration_suite.rsfile. Are we following the recommended pattern for test isolation and shared state management?" - "Review my unit tests for the
DataParserstruct. Ensure my assertions are descriptive and that I am effectively covering the error branch cases."
Tips & Limitations
- Contextual Awareness: The skill works best when provided with the relevant
Cargo.tomldependencies, as it helps the AI understand if you are using specific crates likemockallortokio. - Limitations: The skill is a static analysis tool; it cannot execute your tests or determine the actual pass/fail rate. It focuses on the quality, structure, and maintainability of the test code itself.
- Best Practices: Always prioritize keeping the test logic minimal. If a test file becomes too large, use the skill to identify logical boundaries where the code should be broken into smaller, modular files within the
tests/directory.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-anderskev-rust-testing-code-review": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-read
Related Skills
tutorial-docs
Tutorial patterns for documentation - learning-oriented guides that teach through guided doing
fetch-pr-feedback
Fetch review comments from a PR and evaluate with receive-feedback skill
swift-testing-code-review
Reviews Swift Testing code for proper use of
wish-ssh-code-review
Reviews Wish SSH server code for proper middleware, session handling, and security patterns. Use when reviewing SSH server code using charmbracelet/wish.
explanation-docs
Explanation documentation patterns for understanding-oriented content - conceptual guides that explain why things work the way they do