ecto/muni
Overview
This skill reviews Rust microservices in the depot/ directory and focuses on Axum web framework, SQLx database patterns, Docker deployment, and WebSocket communication. It targets the depot services (discovery, dispatch, map-api, gps-status, mapper) and provides actionable guidance to improve correctness, performance, and maintainability. Use it to verify new endpoints, schema changes, WebSocket protocols, and integration fixes.
How this skill works
The review inspects main.rs entry points, router setup, shared AppState, async patterns with Tokio, and middleware configuration. It checks SQLx usage and migrations for the dispatch service, validates WebSocket upgrade and broadcast patterns, and evaluates Docker multi-stage builds and environment-driven configuration. The skill reports deviations from recommended patterns and suggests concrete fixes for error handling, concurrency, and security.
When to use it
- When adding or modifying REST endpoints in any depot service
- When changing PostgreSQL schemas, migrations, or SQLx queries (dispatch)
- When implementing or debugging WebSocket protocols and broadcast flows
- When reviewing concurrency, Tokio usage, or shared AppState synchronization
- When validating Dockerfile multi-stage builds and container runtime configuration
Best practices
- Use #[tokio::main] and avoid blocking operations inside async handlers
- Attach typed SharedState (Arc<AppState>) and prefer RwLock for mutable collections
- Create Router with grouped REST routes, explicit WebSocket upgrades, and permissive CORS for internal services
- Use parameterized SQLx queries, apply migrations on startup, and set sensible pool sizes
- Return Result<impl IntoResponse, (StatusCode,String)> from handlers and map errors to clear HTTP codes
- Use broadcast channels for fan-out, subscribe per WebSocket connection, and handle lagged receivers gracefully
Example use cases
- Verify a new /zones CRUD set: router, parameterized queries, and correct status codes
- Review a database migration for dispatch: migration file, run_migrations call, and pool configuration
- Audit a WebSocket flow: upgrade handler, message enum parsing, and broadcast subscription
- Check Dockerfile: multi-stage build, minimal runtime image, and port binding to 0.0.0.0
- Debug async deadlocks: RwLock usage, no await while holding locks, and appropriate channel choices
FAQ
Use .fetch_optional() and convert None to NOT_FOUND with ok_or_else, logging context before returning the error.
What to do if WebSocket messages fail to parse?
Log a warning, send an error reply if protocol requires it, and continue the connection instead of panicking.
6 skills
This skill reviews Rust depot services focusing on Axum, SQLx, WebSocket, and Docker patterns to improve reliability and integration.
This skill performs in-depth reviews of embedded Rust firmware for RP2350 and ESP32-S3, focusing on Embassy patterns, memory use, LED control, CAN, and SLCAN.
This skill performs focused frontend code reviews for the depot console, enhancing WebSocket teleop reliability, 3D rendering performance, and state-management
This skill automates end-to-end Muni deployments to rovers and depot, handling cross-compilation, config, services, and rollback procedures.
This skill helps you review Rust firmware for safety-critical CAN, watchdogs, e-stop handling, and VESC integration to ensure robust BVR operation.
This skill proactively maintains project documentation by updating CHANGELOG, READMEs, and inline docs after significant work, ensuring consistency.