# rust-best-practices

> Claude/Codex skill by [@apollographql](https://omgskills.com/library/apollographql/index.md) · 123 stars · Updated 2026-11-01

Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook. Use this skill when: (1) writing new Rust code or functions, (2) reviewing or refactoring existing Rust code, (3) deciding between borrowing vs cloning or ownership patterns, (4) implementing error handling with Result types, (5) optimizing Rust code for performance, (6) writing tests or documentation for Rust projects.

Tags: agent-skills, apollo, graphql

## Install

```sh
git clone https://github.com/apollographql/skills /tmp/skills && ln -s /tmp/skills/skills/rust-best-practices ~/.claude/skills/rust-best-practices
```

## From README

Rust Best Practices Apply these guidelines when writing or reviewing Rust code. Based on Apollo GraphQL's Rust Best Practices Handbook. Best Practices Reference 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: Chapter 1 - Coding Styles and Idioms: Borrowing vs cloning, Copy trait, Option/Result handling, iterators, comments, when to extract a function (duplication vs.

## Links

- HTML page: https://omgskills.com/library/apollographql/skills/rust-best-practices/
- GitHub: https://github.com/apollographql/skills
- Author: [@apollographql](https://omgskills.com/library/apollographql/index.md)

## More from this repo

- [apollo-client](https://omgskills.com/library/apollographql/skills/skills/apollo-client/index.md) — Guide for building React applications with Apollo Client 4.x.
   - [@apollographql](https://omgskills.com/library/apollographql/index.md) · 123 stars
- [apollo-connectors](https://omgskills.com/library/apollographql/skills/apollo-connectors/index.md) — DEPRECATED: superseded by the graphos-factory skill (npx skills add apollographql/skills@graphos-factory), which builds...
   - [@apollographql](https://omgskills.com/library/apollographql/index.md) · 123 stars
- [apollo-federation](https://omgskills.com/library/apollographql/skills/skills/apollo-federation/index.md) — Guide for authoring Apollo Federation subgraph schemas.
   - [@apollographql](https://omgskills.com/library/apollographql/index.md) · 123 stars
