# Rust Conventions

> Work on Rust crates in packages/rust_viterbo. Use for crate layout, commands (fmt/clippy/test/bench), and coding conventions.

- Skill: `majiayu000/rust-conventions` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/rust-conventions`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/rust-conventions/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/rust-conventions

---


# Rust Conventions (rust_viterbo)

## Crates

- `geom` (math)
- `algorithm` (symplectic capacity algorithms)
- `ffi` (PyO3/Maturin bindings)

## Commands

- `cargo fmt`
- `cargo clippy --workspace --all-targets`
- `cargo test --workspace`
- `cargo test --release <filter>`
- `cargo bench`

## Conventions

- Favor pure functions with immutable types.
- Follow best practices for mathematically correct Rust code.
- Use `nalgebra` for linear algebra operations.

## Testing and profiling

- Cover happy paths, edge cases, error paths.
- Benchmark only after profiling identifies hotspots.
- Document why changes are made (e.g., performance impact).

## Caching

- Shared target dir: `/workspaces/worktrees/shared/target` (set by worktree script).

