1 rust rules available
One Windsurf rule matches rust: a Rust development rule for systems and async code. Windsurf's rules documentation now redirects to Devin docs, which use .devin/rules/; legacy .windsurfrules files are still imported. The glob-triggered file applies to .rs files and Cargo.toml.
Windsurf's rules documentation (docs.windsurf.com/windsurf/cascade/memories) now redirects to Devin documentation, which describes rules for the Devin Local agent in Devin Desktop. Current rules live in .devin/rules/*.md with a trigger setting, and the legacy Windsurf files (.windsurf/rules/*.md, .windsurf/global_rules.md and .windsurfrules) are still imported by default. AGENTS.md files are read as always-on rules.
.devin/rules/rust.mdStarting point, not a tested configuration for your repository. Applied when files matching globs are involved (trigger: glob). Review the instructions, adapt the file paths and run your project's existing checks.
--- trigger: glob globs: "**/*.rs,**/Cargo.toml" --- # Rust instructions for Windsurf ## Focus for this project - Put optional dependencies behind Cargo features and gate code with #[cfg(feature = "...")]. - Write rustdoc comments with a runnable example for new public items. - Run cargo test --all-features as well as the default feature set. ## Rust conventions - Read the edition and rust-version fields in Cargo.toml and stay within them; do not raise either without being asked. - Return Result from fallible functions and propagate with ?. No unwrap() or expect() outside tests, examples and documented invariants. - Borrow (&str, &[T]) in parameters where ownership is not needed, and avoid clone() added only to satisfy the borrow checker; explain any clone that remains. - Every unsafe block needs a // SAFETY: comment stating the invariant it relies on. ## Before you finish - Run cargo fmt --check, cargo clippy --all-targets -- -D warnings and cargo test and report the actual output. If you cannot run them, say so and list the exact commands instead of saying they pass. - Summarize which of the rules above affected the change. - If a legacy .windsurfrules or .windsurf/rules file gives conflicting guidance, point out the conflict instead of silently choosing one.
Create your own Windsurf rules for Rust and share with the community.
Ask for a small change to one matching file. Check the tool's loaded context or instruction view, inspect the diff for the requested convention, and run the relevant build or test. A well-formatted file does not guarantee the model follows every instruction.
The docs recommend keeping rules short and specific. The current docs say AGENTS.md, AGENTS.local.md and AGENT.md are read as always-on rules, including files in subdirectories. Use .devin/rules/ when you need glob, model-decision or manual triggers.
Documentation checked 2026-11-05: Devin docs: Local customizations (redirect target of Windsurf memories docs)Windsurf docs: Cascade memories (redirects)
Illustrative input and expected result. This example is a verification guide, not a recorded model run.
You use the Windsurf agent to add a feature to a Rust crate and want feature flags and docs handled correctly.
Add optional serde support to the Config struct.
A serde feature in Cargo.toml with optional dependency, cfg_attr derives, a doc example, and test output for default and all features.
Content reviewed 2026-11-05. Confirm instruction activation in your installed client before relying on it.