From apollo-skills
Guides writing and reviewing idiomatic Rust code covering ownership patterns, error handling, performance optimization, testing, linting with Clippy, and Cargo tooling.
npx claudepluginhub apollographql/skills --plugin apollo-skillsThis skill is limited to using the following tools:
Apply these guidelines when writing or reviewing Rust code. Based on Apollo GraphQL's [Rust Best Practices Handbook](https://github.com/apollographql/rust-best-practices).
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Apply these guidelines when writing or reviewing Rust code. Based on Apollo GraphQL's Rust Best Practices Handbook.
Before reviewing, familiarize yourself with Apollo's Rust best practices. Read ALL relevant chapters in the same turn in parallel. Reference these files when providing feedback:
&T over .clone() unless ownership transfer is required&str over String, &[T] over Vec<T> in function parametersCopy types (≤24 bytes) can be passed by valueCow<'_, T> when ownership is ambiguousResult<T, E> for fallible operations; avoid panic! in productionunwrap()/expect() outside teststhiserror for library errors, anyhow for binaries only? operator over match chains for error propagation--release flagcargo clippy -- -D clippy::perf for performance hints.iter() instead of .into_iter() for Copy types.collect() callsRun regularly: cargo clippy --all-targets --all-features --locked -- -D warnings
Key lints to watch:
redundant_clone - unnecessary cloninglarge_enum_variant - oversized variants (consider boxing)needless_collect - premature collectionUse #[expect(clippy::lint)] over #[allow(...)] with justification comment.
process_should_return_error_when_input_empty()///) for public API examplescargo insta for snapshot testing generated outputdyn Trait only when heterogeneous collections are neededEncode valid states in the type system to catch invalid operations at compile time:
struct Connection<State> { /* ... */ _state: PhantomData<State> }
struct Disconnected;
struct Connected;
impl Connection<Connected> {
fn send(&self, data: &[u8]) { /* only connected can send */ }
}
// comments explain why (safety, workarounds, design rationale)/// doc comments explain what and how for public APIsTODO needs a linked issue: // TODO(#42): ...#![deny(missing_docs)] for libraries