senior-rust-practiceslisted
Install: claude install-skill aiskillstore/marketplace
# Senior Rust Development Practices
Battle-tested patterns for Rust workspace architecture, code organization, dependencies, and testing that scale from prototype to production.
## Git Worktree Workflow Compliance
**All coding work MUST happen in git worktrees.** Before making any code changes:
1. Create a worktree: `git worktree add ~/.claude/worktrees/$(basename $(pwd))/<task> -b feat/<task>`
2. Work in that directory
3. Use `/merge` to consolidate changes back to main
Never edit files directly in the main worktree.
## Completion Requirements
**Before completing ANY Rust task, you MUST:**
1. Run tests: `cargo test --workspace`
2. Run linting: `trunk check`
3. Fix any issues before declaring done
If trunk has formatting issues, run `trunk fmt` to auto-fix.
## Workspace Architecture
### Start from "One Product = One Repo = One Workspace"
Use a Rust workspace when you have:
- Multiple crates that ship together (binary + libraries)
- Shared tooling / CI
- Shared versioning policy
**Canonical workspace structure:**
```text
repo/
Cargo.toml # workspace root
crates/
core/ # pure domain logic (no IO)
storage/ # DB, filesystem, etc.
api/ # HTTP/GRPC handlers, DTOs
cli/ # binary
tools/ # optional: internal binaries (codegen, migration, etc.)
tests/ # optional: black-box integration tests
```
### Keep Crates "Thin" and Boundaries "Hard"
**Layered arc