Loading...
Loading...
Comprehensive Rust coding guidelines with 179 rules across 14 categories. Use when writing, reviewing, or refactoring Rust code. Covers ownership, error handling, async patterns, API design, memory optimization, performance, testing, and common anti-patterns. Invoke with /rust-skills.
npx skill4agent add jamals86/kalamdb rust-skills| Priority | Category | Impact | Prefix | Rules |
|---|---|---|---|---|
| 1 | Ownership & Borrowing | CRITICAL | | 12 |
| 2 | Error Handling | CRITICAL | | 12 |
| 3 | Memory Optimization | CRITICAL | | 15 |
| 4 | API Design | HIGH | | 15 |
| 5 | Async/Await | HIGH | | 15 |
| 6 | Compiler Optimization | HIGH | | 12 |
| 7 | Naming Conventions | MEDIUM | | 16 |
| 8 | Type Safety | MEDIUM | | 10 |
| 9 | Testing | MEDIUM | | 13 |
| 10 | Documentation | MEDIUM | | 11 |
| 11 | Performance Patterns | MEDIUM | | 11 |
| 12 | Project Structure | LOW | | 11 |
| 13 | Clippy & Linting | LOW | | 11 |
| 14 | Anti-patterns | REFERENCE | | 15 |
own-borrow-over-clone&T.clone()own-slice-over-vec&[T]&Vec<T>&str&Stringown-cow-conditionalCow<'a, T>own-arc-sharedArc<T>own-rc-single-threadRc<T>own-refcell-interiorRefCell<T>own-mutex-interiorMutex<T>own-rwlock-readersRwLock<T>own-copy-smallCopyown-clone-explicitCloneown-move-largeown-lifetime-elisionerr-thiserror-libthiserrorerr-anyhow-appanyhowerr-result-over-panicResulterr-context-chain.context().with_context()err-no-unwrap-prod.unwrap()err-expect-bugs-only.expect()err-question-mark?err-from-impl#[from]err-source-chain#[source]err-lowercase-msgerr-doc-errors# Errorserr-custom-typeBox<dyn Error>mem-with-capacitywith_capacity()mem-smallvecSmallVecmem-arrayvecArrayVecmem-box-large-variantmem-boxed-sliceBox<[T]>Vec<T>mem-thinvecThinVecmem-clone-fromclone_from()mem-reuse-collectionsclear()mem-avoid-formatformat!()mem-write-over-formatwrite!()format!()mem-arena-allocatormem-zero-copyBytesmem-compact-stringCompactStringmem-smaller-integersmem-assert-type-sizeapi-builder-patternapi-builder-must-use#[must_use]api-newtype-safetyapi-typestateapi-sealed-traitapi-extension-traitapi-parse-dont-validateapi-impl-intoimpl Into<T>api-impl-asrefimpl AsRef<T>api-must-use#[must_use]Resultapi-non-exhaustive#[non_exhaustive]api-from-not-intoFromIntoapi-default-implDefaultapi-common-traitsDebugClonePartialEqapi-serde-optionalSerializeDeserializeasync-tokio-runtimeasync-no-lock-awaitMutexRwLock.awaitasync-spawn-blockingspawn_blockingasync-tokio-fstokio::fsstd::fsasync-cancellation-tokenCancellationTokenasync-join-paralleltokio::join!async-try-jointokio::try_join!async-select-racingtokio::select!async-bounded-channelasync-mpsc-queuempscasync-broadcast-pubsubbroadcastasync-watch-latestwatchasync-oneshot-responseoneshotasync-joinset-structuredJoinSetasync-clone-before-awaitopt-inline-small#[inline]opt-inline-always-rare#[inline(always)]opt-inline-never-cold#[inline(never)]opt-cold-unlikely#[cold]opt-likely-hintlikely()unlikely()opt-lto-releaseopt-codegen-unitscodegen-units = 1opt-pgo-profileopt-target-cputarget-cpu=nativeopt-bounds-checkopt-simd-portableopt-cache-friendlyname-types-camelUpperCamelCasename-variants-camelUpperCamelCasename-funcs-snakesnake_casename-consts-screamingSCREAMING_SNAKE_CASEname-lifetime-short'a'de'srcname-type-param-singleTEKVname-as-freeas_name-to-expensiveto_name-into-ownershipinto_name-no-get-prefixget_name-is-has-boolis_has_can_name-iter-conventioniteriter_mutinto_itername-iter-methodname-iter-type-matchname-acronym-wordUuidUUIDname-crate-no-rs-rstype-newtype-idsUserId(u64)type-newtype-validatedEmailUrltype-enum-statestype-option-nullableOption<T>type-result-fallibleResult<T, E>type-phantom-markerPhantomData<T>type-never-diverge!type-generic-boundstype-no-stringlytype-repr-transparent#[repr(transparent)]test-cfg-test-module#[cfg(test)] mod tests { }test-use-superuse super::*;test-integration-dirtests/test-descriptive-namestest-arrange-act-asserttest-proptest-propertiesproptesttest-mockall-mockingmockalltest-mock-traitstest-fixture-raiitest-tokio-async#[tokio::test]test-should-panic#[should_panic]test-criterion-benchcriteriontest-doctest-examplesdoc-all-public///doc-module-inner//!doc-examples-section# Examplesdoc-errors-section# Errorsdoc-panics-section# Panicsdoc-safety-section# Safetydoc-question-mark?.unwrap()doc-hidden-setup# doc-intra-links[Vec]doc-link-typesdoc-cargo-metadataCargo.tomlperf-iter-over-indexperf-iter-lazyperf-collect-oncecollect()perf-entry-apientry()perf-drain-reusedrain()perf-extend-batchextend()perf-chain-avoidchain()perf-collect-intocollect_into()perf-black-box-benchblack_box()perf-release-profileperf-profile-firstproj-lib-main-splitmain.rslib.rsproj-mod-by-featureproj-flat-smallproj-mod-rs-dirmod.rsproj-pub-crate-internalpub(crate)proj-pub-super-parentpub(super)proj-pub-use-reexportpub useproj-prelude-modulepreludeproj-bin-dirsrc/bin/proj-workspace-largeproj-workspace-depslint-deny-correctness#![deny(clippy::correctness)]lint-warn-suspicious#![warn(clippy::suspicious)]lint-warn-style#![warn(clippy::style)]lint-warn-complexity#![warn(clippy::complexity)]lint-warn-perf#![warn(clippy::perf)]lint-pedantic-selectiveclippy::pedanticlint-missing-docs#![warn(missing_docs)]lint-unsafe-doc#![warn(clippy::undocumented_unsafe_blocks)]lint-cargo-metadata#![warn(clippy::cargo)]lint-rustfmt-checkcargo fmt --checklint-workspace-lintsanti-unwrap-abuse.unwrap()anti-expect-lazy.expect()anti-clone-excessiveanti-lock-across-await.awaitanti-string-for-str&String&stranti-vec-for-slice&Vec<T>&[T]anti-index-over-iteranti-panic-expectedanti-empty-catchif let Err(_) = ...anti-over-abstractionanti-premature-optimizeanti-type-erasureBox<dyn Trait>impl Traitanti-format-hot-pathformat!()anti-collect-intermediatecollect()anti-stringly-typed[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
panic = "abort"
strip = true
[profile.bench]
inherits = "release"
debug = true
strip = false
[profile.dev]
opt-level = 0
debug = true
[profile.dev.package."*"]
opt-level = 3 # Optimize dependencies in devrules/| Task | Primary Categories |
|---|---|
| New function | |
| New struct/API | |
| Async code | |
| Error handling | |
| Memory optimization | |
| Performance tuning | |
| Code review | |