28
GitHub Stars
5
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill ecto/muni --skill depot-services-review- api-design-patterns.md20.4 KB
- database-patterns.md18.6 KB
- docker-deployment.md15.0 KB
- SKILL.md29.1 KB
- websocket-patterns.md19.9 KB
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.