Microsoft rust guidelines
Microsoft's Pragmatic Rust Guidelines for API design, crate architecture, library UX, resilience, FFI, performance optimization, documentation, and AI-oriented code. Invoke this skill when designing new Rust APIs, setting up crate structures, writing library code, implementing FFI, optimizing hot paths, authoring documentation, or making architectural decisions about Rust code organization.From its SKILL.md
npx -y skills add pngdeity/apm-user-repository --skill microsoft-rust-guidelinesAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.5 KB, 520 tokens by cl100k_base, as published. Nobody here has run it
Microsoft Pragmatic Rust Guidelines
Description
Microsoft's comprehensive Rust coding guidelines covering library design, API surface decisions, resilience patterns, application conventions, FFI, performance, documentation, and AI-oriented code design. Safety-critical rules (unsafe code, soundness, panic behavior, lint overrides, Debug/Display) are enforced implicitly via instructions; all other guidelines are available on demand through this skill.
When to Invoke
Summon this skill when performing any of the following activities:
- API Design — designing public interfaces, choosing between generics/dyn traits, error type design, builder pattern
- Crate Architecture — splitting crates, feature flag design, dependency management
- Library Resilience — mocking I/O, avoiding statics, strong typing, test utilities
- Bare-metal / Building — -sys crates, OOBE compliance, build script design
- FFI — cross-DLL state management, native escape hatches, type portability
- Applications — allocator choice, application-level error handling
- Performance — hot path identification, throughput optimization, yield points
- Documentation — module docs, canonical doc sections, first sentence conventions
- AI-Oriented Design — making codebases agent-friendly
Reference Files
Load the relevant reference for your specific task:
| Task | Reference |
|---|---|
| API design, traits, builders, AsRef, Sans-IO | references/library-ux.md |
| Mockable I/O, statics, strong types, glob reexports | references/library-resilience.md |
| Feature flags, OOBE, -sys crates | references/library-building.md |
| Type leakage, Send/Sync, escape hatches | references/library-interop.md |
| Naming conventions, magic values, crate splitting, static verification, logging | references/universal.md |
| Error handling (anyhow/eyre), mimalloc | references/applications.md |
| DLL state isolation, portable types | references/ffi.md |
| Hot path profiling, throughput, yield points | references/performance.md |
| Module docs, canonical sections, doc(inline), first sentence | references/documentation.md |
| Designing APIs for AI agent consumption | references/ai.md |
What ships with it: 10 files
72.9 KB alongside SKILL.md
references/
- ai.md2.6 KB
- applications.md1.7 KB
- documentation.md4.5 KB
- ffi.md2.6 KB
- library-building.md4.5 KB
- library-interop.md4.3 KB
- library-resilience.md8.3 KB
- library-ux.md22.3 KB
- performance.md3.6 KB
- universal.md18.5 KB