| name | rust-code-review |
| description | Perform comprehensive Rust code review covering correctness, safety, performance, and idiomatic patterns. Use when asked to review code, check for issues, audit a module, or ensure code quality before merge. Covers ownership, lifetimes, concurrency, API design, and Rust idioms. |
| allowed-tools | Read, Grep, Glob, Bash |
| user-invocable | true |
Rust Code Review
Perform a thorough, multi-dimensional code review of Rust code in the cqlsh-rs project. Reviews cover correctness, safety, performance, idiomatic patterns, and maintainability.
Review Process
- Read the code — Read all changed or targeted files completely
- Understand context — Check how the code fits into the module hierarchy
- Apply checklist — Systematically evaluate against each review dimension
- Report findings — Categorize by severity and provide actionable fixes
Review Dimensions
1. Correctness
2. Memory Safety & Ownership
3. Concurrency Safety
4. Error Handling
5. Performance
6. API Design
7. Idiomatic Rust
8. Documentation & Naming
Severity Levels
| Level | Label | Action |
|---|
| P0 | Blocker | Must fix — correctness bug, safety issue, data loss risk |
| P1 | Major | Should fix — performance issue, error handling gap, API misuse risk |
| P2 | Minor | Consider fixing — style, idiom, minor improvement |
| P3 | Nit | Optional — cosmetic, naming preference |
Output Format
## Code Review: `<module/file>`
### Summary
<1-2 sentence overview of code quality and main findings>
### Findings
#### P0 — Blockers
- **[file:line]** <description>
```rust
// suggested fix
P1 — Major
...
P2 — Minor
...
Positive Observations
## cqlsh-rs Specific Checks
- CQL type handling matches Python cqlsh behavior exactly
- Output formatting is byte-identical to Python cqlsh where specified
- CLI flag names and short forms match Python cqlsh `--help` output
- cqlshrc parsing handles all documented sections and options
- Connection handling follows the same retry/timeout behavior as Python cqlsh