takurot
UserClaude Code skills for intermediate-to-advanced Rust (ownership, concurrency, unsafe, FFI, API design), adapted from Google's Comprehensive Rust course
Categories
Indexed Skills (11)
rust-api-design
Design predictable Rust public APIs — method naming conventions, doc comment structure, and which std traits to implement. Use when writing a library crate's public surface, reviewing API ergonomics, naming a constructor/conversion/accessor method, or deciding whether a type needs Debug/Display/Eq/Ord/Hash/Clone/Copy/From/TryFrom.
rust-async
Debug Rust async/await bugs — an executor that silently runs futures sequentially, a hang at an await point, a cancelled future losing state, or an async trait that won't compile with dyn. Use when working with tokio, futures, join!/select!, or diagnosing why "concurrent" async code isn't actually concurrent.
rust-concurrency-sync
Fix Rust thread and shared-state concurrency issues — Send/Sync compile errors, choosing a channel type, Arc<Mutex<T>> deadlocks, and mutex poisoning. Use when spawning OS threads, sharing state across threads, a type "cannot be sent between threads safely," or a multi-threaded program hangs/deadlocks.
rust-ffi
Call C or C++ from Rust (or vice versa) correctly — string/representation mismatches, error-handling conventions, ownership across the FFI boundary, and choosing between bindgen (C) and cxx (C++). Use when writing an extern "C" binding, wrapping a C/C++ library, converting between C strings and Rust &str, or reviewing an FFI boundary for soundness.
rust-newtype-and-raii
Wrap a value in a newtype to enforce an invariant or prevent argument mix-ups, or use Drop to guarantee cleanup / enforce that an API is finalized correctly. Use when designing a type that must always be valid once constructed, when a resource (lock, file, transaction, connection) must always be released or finalized, or when reviewing whether a Drop-based guarantee actually holds.
rust-ownership-and-lifetimes
Diagnose Rust borrow checker and lifetime errors, and choose between references, Cell/RefCell, Rc/Weak, and owned data. Use when rustc reports a borrow/lifetime error (E0502, E0499, E0597, E0106, "cannot borrow as mutable"), when adding lifetime annotations to a struct or function, or when deciding how a type should hold or share data it doesn't own.
rust-pinning
Understand and correctly use Pin<Ptr> — what pinning actually prevents, Unpin vs !Unpin, PhantomPinned, and the specific ways Drop can accidentally move a pinned value. Use when hand-implementing Future, building a self-referential struct, seeing "cannot be unpinned" or an unsatisfied `Unpin` trait bound compile error, or implementing Drop for a !Unpin type.
rust-polymorphism
Decide between generics and dyn Trait, understand why Rust has no inheritance, and restrict who can implement a trait (sealed traits, enums). Use when converting OOP-style inheritance designs to Rust, choosing static vs dynamic dispatch, hitting an orphan-rule error, downcasting a trait object, or deciding whether an API's extension points should be public.
rust-typestate-and-tokens
Design compile-time state machines (typestate pattern) and proof-of-permission token types in Rust. Use when a value's valid operations depend on which step of a protocol it's in (builders, serializers, connection handshakes), when you want "calling this without permission" to be a compile error instead of a runtime check, or when indexes/handles need to be proven valid without repeated bounds checks.
rust-unsafe-fundamentals
Write correct everyday unsafe Rust — dereferencing raw pointers, mutable statics, unions, unsafe functions, and unsafe extern "C" declarations — with proper safety comments. Use when writing your first unsafe block, calling into a C function, or reviewing whether an unsafe block's safety comment actually justifies the code. For advanced soundness reasoning and safety-precondition design, see rust-unsafe-soundness.
rust-unsafe-soundness
Reason rigorously about whether unsafe Rust is sound — derive and document safety preconditions, tell encapsulated vs exposed unsafe apart, spot "crying wolf" unsafe markers, and use MaybeUninit for uninitialized/partially-initialized memory. Use when auditing an unsafe function for soundness, writing a
Bio shown is the top-scored skill's repo description as a fallback — real GitHub bios land in a future update.