# Bevy (digest) Sources: the Bevy 0.20 API docs (https://docs.rs/bevy/0.20.0 and https://docs.rs/bevy_ecs/0.20.0), Bevy's own lint configuration in its published `Cargo.toml`, and the migration guides at https://bevy.org/learn/migration-guides/. Checked against bevy 0.20.0 (October 2026); every behavior below was confirmed with a test on that version. Read this when `Cargo.toml` depends on `bevy` or `bevy_ecs`. Check the project's Bevy version first. Bevy breaks its API every release (0.17 renamed events to messages, 0.20 changed the observer generics), so follow the version in `Cargo.lock`, not this file, when they disagree. Bevy calls your systems and builds their arguments, so a few general rules don't fit system functions. The exceptions below replace them for Bevy code only. Everything else in the skill (errors, panics, naming, tests, unsafe) still applies. ## Keep Bevy's conventions **System parameters are taken by value.** `Res`, `ResMut`, `Query`, `Single`, `Commands`, `Local`, `MessageReader`, and `MessageWriter` are already borrows that Bevy hands the system for one run. Don't change them to `&Res` or report them as needless pass-by-value. Normal borrowing advice still holds inside a system and for helper functions it calls: pass `&Health`, not a whole `Query`. **Use `use bevy::prelude::*`.** The prelude is Bevy's documented import pattern, and clippy's `wildcard_imports` already exempts paths that contain `prelude`. The rule against glob imports still applies to your own modules, so don't invent an application prelude. **Plain-data components and resources may have public fields.** `Health(pub u32)` and `Velocity(pub Vec2)` are passive data that many systems read and write, which is the passive-data exception in SKILL.md section 4. Keep fields private only when the fields must hold an invariant together, such as a list that must stay sorted. Settings such as a regeneration rate and a cap are plain data: enforce the cap in the system that applies it, not with getters and a panicking constructor. **Complex queries and many parameters are normal.** Bevy's own workspace allows `clippy::type_complexity` and `clippy::too_many_arguments`. Allow them at the crate level, or give a query reused by several systems a `type` alias. Don't split a system or wrap its queries in a custom `SystemParam` only to silence the lint; derive `SystemParam` when a group of parameters is reused and deserves a name. **Lints.** The BeautifulRust lints in `lints/lints.toml` turn on `rust_2018_idioms` and clippy's pedantic group, which flag every idiomatic system signature. In a Bevy crate, add these lines to the existing `[lints.rust]` and `[lints.clippy]` tables: ```toml # under [lints.rust] elided_lifetimes_in_paths = "allow" # write Res