- Use the current stable Rust edition,
cargo fmt, andclippy -D warningsfor Rust core and binding crates. - Library code returns
Result<T, E>with typed errors. Do notunwrap, panic, or exit in library paths. - Public APIs have rustdoc, error documentation, and examples that use
?instead ofunwrap. - Unsafe code has
SAFETYcomments and should be isolated behind small, tested abstractions. - Async public futures are
Sendwhere host runtimes may move them across threads. - Public DTOs that cross binding boundaries are FFI-friendly or have explicit binding-safe equivalents.
- Keep binding-safe DTOs separate from integration-specific request and response types.
- Avoid Rust-only API shapes that cannot be represented naturally in target languages.
- Use one source of truth for version numbers and sync binding manifests from it during release.
Rust Polyglot Conventions
Rust conventions for a core that backs multiple language bindings: stable-edition tooling, typed Result errors with no panics in library paths, rustdoc with error docs, isolated unsafe, Send futures, FFI-friendly DTOs, and single-source version syncing. Load when writing or reviewing a Rust core exposed through polyglot bindings.
Rust Polyglot Conventions by goldziher · c93ff24
npx skillmds@latest add goldziher/rust-polyglot-conventions File contents
---name: rust-polyglot-conventionsdescription: Rust conventions for a core that backs multiple language bindings: stable-edition tooling, typed Result errors with no panics in library paths, rustdoc with error docs, isolated unsafe, Send futures, FFI-friendly DTOs, and single-source version syncing. Load when writing or reviewing a Rust core exposed through polyglot bindings.---- Use the current stable Rust edition, `cargo fmt`, and `clippy -D warnings` for Rust core and binding crates.- Library code returns `Result<T, E>` with typed errors. Do not `unwrap`, panic, or exit in library paths.- Public APIs have rustdoc, error documentation, and examples that use `?` instead of `unwrap`.- Unsafe code has `SAFETY` comments and should be isolated behind small, tested abstractions.- Async public futures are `Send` where host runtimes may move them across threads.- Public DTOs that cross binding boundaries are FFI-friendly or have explicit binding-safe equivalents.- Keep binding-safe DTOs separate from integration-specific request and response types.- Avoid Rust-only API shapes that cannot be represented naturally in target languages.- Use one source of truth for version numbers and sync binding manifests from it during release.
goldziher/ai-rulez/tree/main/internal/builtins/universal/polyglot-bindings/skills/rust-polyglot-conventions commit c93ff2431b
Frequently asked questions
Run npx skillmds@latest add goldziher/rust-polyglot-conventions in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Rust conventions for a core that backs multiple language bindings: stable-edition tooling, typed Result errors with no panics in library paths, rustdoc with error docs, isolated unsafe, Send futures, FFI-friendly DTOs, and single-source version syncing. Load when writing or reviewing a Rust core exposed through polyglot bindings. It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
goldziher (@goldziher) published this skill. Their other Agent Skills are listed on their SkillMD profile.