rust-api-design

Installation
SKILL.md

Rust API Design (Rust API Guidelines)

Authority: Rust API Guidelines — the de-facto standard checklist of ~100 C-* rules used by std, tokio, serde, bevy. See the full checklist for canonical wording of every rule.

This skill owns the shape of a public Rust API: types, traits, naming, conversions, and the boundaries that keep the API usable, ergonomic, and resistant to breakage. It does not own Cargo manifest (rust-cargo-build), workspace topology (rust-workspace), in-crate src/ layout (rust-module-layout), or semver/publish (rust-semver).

Capability Boundaries

✅ Strengths

  1. Translating API Guidelines' ~100 C-* rules into concrete design decisions for a public crate
  2. Naming types, functions, methods, and features to match std and ecosystem conventions
  3. Choosing between generics, trait objects, concrete types, and the newtype pattern
  4. Designing From/Into/TryFrom/AsRef/Borrow conversions (rejecting Deref polymorphism)
  5. Picking which auto traits (Debug, Clone, Eq, Hash, Send, Sync) to derive
  6. Sealing traits, marking #[non_exhaustive], hiding struct fields — to reserve room to evolve
  7. Replacing bool parameters with enums, raw integers with newtypes, String with &str
  8. Designing iterators, Extend, Default, Display/FromStr correctly
  9. Avoiding panic!/unwrap/expect in public APIs in favor of Result
Installs
2
GitHub Stars
1
First Seen
6 days ago
rust-api-design — full-stack-skills/rust-skills