.agents/skills/rust-backend-rules/SKILL.md
Comprehensive Rust coding guidelines for Axum/Tokio/SQLx backends. 179 rules across ownership, error handling, memory optimization, API design, async patterns, testing, linting, and anti-patterns. Use when writing, reviewing, or refactoring Rust code, Cargo settings, or services/backend code.
npx skillsauth add sdn0303/terrasight rust-backend-rulesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Production Rust guidance for this repository. The full source rulebook is copied verbatim in references/rust-rules.md; keep SKILL.md lean and open the reference file only for the categories you need.
services/backendCargo.toml, profiles, linting, or project structure.unwrap() in non-test code; prefer ? or expect("invariant")src/domain/ pure with zero external dependencies&str / &[T] over &String / &Vec<T>anyhow only at app boundarycargo fmt, cargo clippy -- -D warnings, and cargo test| Priority | Category | Prefix | Notes |
|----------|----------|--------|-------|
| 1 | Ownership & Borrowing | own- | Remove unnecessary clones, design for slices/borrows first |
| 2 | Error Handling | err- | Propagate context, avoid panics in production |
| 3 | Memory Optimization | mem- | Cut allocations only after measuring |
| 4 | API Design | api- | Clear types, builders, trait boundaries, DTO shape |
| 5 | Async/Await | async- | Avoid holding locks/borrows across .await |
| 6 | Compiler Optimization | opt- | Profile first; prefer evidence over folklore |
| 7 | Naming Conventions | name- | Keep APIs readable and idiomatic |
| 8 | Type Safety | type- | Encode invariants in types |
| 9 | Testing | test- | Cover success path, failure path, and regressions |
| 10 | Documentation | doc- | Document panics, errors, and public contracts |
| 11 | Performance Patterns | perf- | Focus on hot paths and measurable impact |
| 12 | Project Structure | struct- | Keep module boundaries intentional |
| 13 | Clippy & Linting | lint- | Treat warnings as design feedback |
| 14 | Anti-patterns | anti- | Use during review to catch regressions fast |
references/rust-rules.md.AGENTS.md.Useful search patterns:
^# own- for ownership and borrowing^# err- for error handling^# async- for async/Tokio patterns^# anti- for code review sweeps^# err-no-unwrap-prod for the repo's no-unwrap invariant.clone()?.await?development
Rust coding rules for Axum/Tokio/SQLx backends in services/backend. 179 rules split into 14 category files covering ownership, error handling, async, API design, and more. Use when writing, reviewing, or refactoring Rust code, designing error types, async flows, or public APIs.
content-media
PostgreSQL and PostGIS patterns for schema design, spatial queries, query optimization, indexing, and zero-downtime migrations. Use when writing SQL, creating tables, optimizing queries, or writing migration files.
development
Mapbox GL JS v3 development patterns for real estate data visualization. Use when working with Mapbox maps, Standard Style configuration, layer slots, 3D lighting, expressions, react-map-gl/mapbox integration, or migrating from MapLibre GL JS.
development
MapLibre GL JS + PostGIS integration patterns for real estate data visualization. Use when working on map layers, spatial queries, GeoJSON data pipelines, or 3D extrusion effects.