.claude/skills/rust-backend-rules/SKILL.md
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.
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.
179 rules across 14 categories for production Rust. Each category is a separate reference file with a table of contents — open only the ones relevant to your task.
Derived from Effective Rust, Rust API Guidelines, and The Rust Book:
.clone() or unsafe.Result, propagate with ?,
add context via thiserror. Reserve panics for true programmer bugs.criterion, cargo flamegraph,
or EXPLAIN ANALYZE before changing allocation strategy or adding #[inline].cargo fmt, cargo clippy, cargo test,
cargo doc, cargo deny are your quality gates, not optional extras.Each file has a table of contents at the top. Open only the categories you need:
When the borrow checker rejects code, try these before reaching for .clone():
let variable to extend its
lifetime to the enclosing block.{ ... } so it drops before the
conflicting use.Cow<'_, T> — when a function sometimes needs owned data and
sometimes borrowed, avoid unconditional cloning.Before any .await point, verify:
MutexGuard, RwLockWriteGuard, or RefMut held across the .awaittokio::task::spawn_blockingtokio::fs, not std::fs.clone())?.await?&str, &[T])?/// doc comments with examples?cargo clippy -- -D warnings passes without suppression?cargo fmt --check && cargo clippy -- -D warnings && cargo test
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.
development
Frontend development rules for Next.js 16, React 19, TanStack Query, Zustand, Zod, Tailwind v4, and shadcn/ui in services/frontend. Use when writing, reviewing, or refactoring React components, data fetching hooks, state management, forms, or UI styling.