bevy-core-concepts
Skill16 starsChanged 3 months agoMITView on GitHub
Use when wiring up an `App`, writing a `Plugin`, choosing between `Update` and `FixedUpdate`, ordering `Startup`/`PreUpdate`/`PostUpdate`, or writing an exclusive system (`fn(&mut World)`) in Bevy 0.19. Covers the schedule graph, run order, and the `SimpleExecutor` removal.
In this repository33 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- bevy-a11ySkill
- bevy-animationSkill
- bevy-assetsSkill
- bevy-audioSkill
- bevy-camerasSkill
- bevy-captureSkill
- bevy-cargo-featuresSkill
- bevy-custom-assetsSkill
- bevy-diagnostics-profilingSkill
- bevy-ecs-componentsSkill
- bevy-ecs-queriesSkill
- bevy-ecs-systemsSkill
- bevy-fluentSkill
- bevy-input-actionsSkill
- bevy-migration-0-17-to-0-18Skill
- bevy-migration-0-18-to-0-19Skill
- bevy-pbr-materialsSkill
- bevy-physicsSkill
- bevy-portingSkill
- bevy-renderingSkill
- bevy-save-loadSkill
- bevySkill
- bevy-testingSkill
- bevy-uiSkill
- bevy-vfxSkill
- bevy-voxel-dataSkill
- bevy-voxel-pipelineSkill
- bevy-voxel-runtimeSkill
- bevy-wasm-webgpuSkill
- similarity-rsSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 79
Rule of thumb: if a system must produce the same result for the same inputs regardless of frame rate, put it in FixedUpdate.
- Very specific: line 88
ScheduleBuildErrorvariants were renamed: If you match on them, update: HierarchyLoop → HierarchySort(DiGraphToposortError::Loop(...)), … - Very specific: line 95
Don't put render-world passes in Update.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Bevy 0.19 — Core concepts (App, Plugin, Schedule, World)
When to use this skill
- Setting up a new Bevy app or library plugin.
- Deciding which schedule (
Startup,Update,FixedUpdate,PostUpdate, ...) a system belongs in. - Writing an exclusive system that needs
&mut World. - Hitting schedule cycles, elevated ambiguity diagnostics, or deferred-command order bugs.
- Asking "where should X run?"
Canonical pattern
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(GamePlugin)
.run();
}
pub struct GamePlugin;
impl Plugin for GamePlugin {
fn build(&self, app: &mut App) {
app.insert_resource(Score(0))
.add_systems(Startup, spawn_world)
.add_systems(Update, (read_input, apply_gravity).chain())
.add_systems(FixedUpdate, simulate_physics)
.add_systems(PostUpdate, sync_transforms);
}
}
#[derive(Resource)]
struct Score(u32);
fn spawn_world(mut commands: Commands) {
commands.spawn((Camera3d::default(), Transform::from_xyz(0.0, 4.0, 8.0)));
}
fn read_input(_keys: Res<ButtonInput<KeyCode>>) {}
fn apply_gravity(_t: Res<Time>) {}
fn simulate_physics(_t: Res<Time<Fixed>>) {}
fn sync_transforms(_q: Query<&mut Transform>) {}
// Exclusive system — full mutable World access, runs alone.
fn rebuild_index(world: &mut World) {
let count = world.entities().len();
world.insert_resource(EntityCount(count));
}
#[derive(Resource)]
struct EntityCount(u32);Schedule cheat sheet
| Schedule | Use for |
Startup | One-shot setup. Runs once before Update. |
PreUpdate | Reading input, networking ingress, frame-start bookkeeping. |
Update | Per-frame game logic. Runs at render rate. Default for game systems. |
PostUpdate | Reactive bookkeeping after Update (transform propagation lives here). |
Last | Anything that must run after PostUpdate (rare). |
FixedFirst / FixedPreUpdate / FixedUpdate / FixedPostUpdate / FixedLast | Deterministic, tick-rate work: physics, networking simulation, gameplay state. Runs zero or more times per render frame to catch up to Time<Fixed>. |
Rule of thumb: if a system must produce the same result for the same inputs regardless of frame rate, put it in FixedUpdate. Otherwise Update.
Bevy 0.19 gotchas
SimpleExecutorwas removed. It used to apply deferred commands after every system. The remaining executors use dependency information to placeApplyDeferred; add.before,.after, or.chain()when downstream systems must see commands in the same schedule. Shared mutable access is serialized, but does not by itself define which system goes first.ScheduleBuildErrorvariants were renamed. If youmatchon them, update:HierarchyLoop→HierarchySort(DiGraphToposortError::Loop(...)),DependencyCycle→DependencySort(DiGraphToposortError::Cycle(...)).- Executor configuration takes an executor value in 0.19. Replace
set_executor_kind(ExecutorKind::SingleThreaded)withset_executor(SingleThreadedExecutor::new())(orMultiThreadedExecutor::new()/default_executor()). - Resources implement
Componentin 0.19. Generic bounds that usedResourceonly to exclude components no longer do so; audit broad component queries and generic APIs. State::set()now always triggers a transition — even if the requested state equals the current one. Usenext_state.set_if_neq(...)for the old "no-op when equal" behavior.- Don't put render-world passes in
Update. Main-world components may prepare render data there, but GPU passes belong in render schedules. Seebevy-rendering. - Exclusive systems block everything in their schedule — use them only when you really need
&mut World(scene loading, batch reflection, schema migrations).
See also
bevy-ecs-systems— params, sets, conditions, ordering, and ambiguity diagnostics.bevy-ecs-components— entity data.bevy-rendering— render schedules and systems.bevy-physics— Rapier schedule placement andPhysicsSetordering.bevy-input-actions— frame input transfer into fixed ticks.bevy-testing— controlledAppstepping and manual time.bevy-migration-0-18-to-0-19— executor instances and resources-as-components.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

