/bevy-skills:bevy-migration-0-19-to-0-20from bevy-skills
Guides migration from Bevy 0.19 to 0.20, covering breaking changes like observer generics, pointer events, deprecated UI types, iter_many Results, set_if_neq rename, and WESL shader imports.
Ships in bevy-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Released 2026-10-08 (0.20.0); current patch 0.20.1. Apply top-down. Coming from 0.18? Do
bevy-migration-0-18-to-0-19 first.
bevy = "0.19" → bevy = "0.20" bump.On<Add, T>, Pointer<Click>, Interaction::Pressed, set_if_neq, or naga_oil #import lines.IntoObserverSystem errors mention "one too many generics".use bevy::core_pipeline::tonemapping::Tonemapping;
use bevy::mesh::MeshTag;
use bevy::picking::hover::Hovered;
use bevy::prelude::*;
use bevy::ui::Pressed;
use bevy::ui_widgets::Button;
// 1. Lifecycle observers carry the bundle on the event, not on `On`.
fn on_player_added(add: On<Add<Player>>, mut commands: Commands) {
commands.entity(add.entity).insert(Name::new(format!("player-{}", add.entity)));
}
// Dynamic components: `On<Add>` → `On<Add<()>>`.
// 2. Pointer events are flat. Fields moved onto `.pointer`.
fn on_click(click: On<PointerClick>) {
info!("clicked {} at {:?}", click.entity, click.pointer.position);
}
// 3. `ui::Interaction` and `ui::widgets::Button` are deprecated. `Pressed` is a marker.
fn style_button(mut buttons: Query<(&Hovered, Has<Pressed>, &mut BackgroundColor), With<Button>>) {
for (hovered, pressed, mut bg) in &mut buttons {
bg.0 = match (pressed, hovered.get()) {
(true, _) => Color::srgb(0.1, 0.1, 0.1),
(false, true) => Color::srgb(0.3, 0.3, 0.3),
_ => Color::srgb(0.2, 0.2, 0.2),
};
}
}
// 4. `iter_many` family yields `Result`; `.matched()` restores skip-missing behaviour.
fn visit(targets: Res<Targets>, names: Query<&Name>) {
for name in names.iter_many(targets.0.iter()).matched() {
info!("{name}");
}
}
// 5. `set_if_neq` → `set_if_different` (old name is a deprecated wrapper).
fn go_play(mut next: ResMut<NextState<Phase>>) {
next.set_if_different(Phase::Play);
}
// 6. `&mut World` is a normal `SystemParam`; it may sit anywhere in the signature.
fn world_anywhere(mut counter: Local<u32>, world: &mut World) {
*counter += 1;
world.spawn((Mesh3d::default(), MeshTag::new(7))); // MeshTag(7) → MeshTag::new(7)
}
Player, Targets, Phase are ordinary Component/Resource/States types.
// Camera3d no longer requires ScreenSpaceTransmission. Add it back for refraction.
commands.spawn((
Camera3d::default(),
bevy::pbr::ScreenSpaceTransmission::default(),
Tonemapping::Linear, // "no tone curve" — `Tonemapping::None` is now a raw passthrough
));
Tonemapping::None skips ColorGrading, DebandDither, and the negative clamp. Use Linear for the old "no curve" look. Camera2d now defaults to Linear.Tonemapping and DebandDither live in bevy_render::view (reflect paths changed; Rust imports still work)..wgsl + #import/#ifdef/#define_import_path → .wesl + import bevy_pbr::render::forward_io::VertexOutput; + @if(DEF). Plain WGSL without preprocessor lines still loads. GLSL removed. shader_format_wesl feature removed. Module paths follow crate file paths (bevy_pbr::mesh_view_bindings → bevy_pbr::render::mesh_view_bindings). Full table: references/wesl-shaders.md.UnpreparedBindGroup → BindGroupBuilder; AsBindGroup::unprepared_bind_group → build_bind_group. #[derive(AsBindGroup)] users: no change.#[derive(ExtractComponent)] #[extract_app(RenderApp)], impl SyncComponent<RenderApp>; new bevy_extract crate.Sprite renders through Mesh2d + SpriteMeshMaterial and gained alpha_mode. Overlapping sprites at equal Z may reorder; give them explicit Z.Material::enable_oit, shader def MATERIAL_OIT_ENABLED); oit_draw wants premultiplied color.MeshAabb::compute_aabb → get_aabb. WgpuWrapper removed. ViewDepthTexture → ViewDepthStencilTexture. AtmosphereBuffer is a per-camera component. RenderDebugOverlayPlugin joins DefaultPlugins when the bevy_dev_tools + render_dev_tools features (the dev collection) are on; enable keys via bevy::dev_tools::render_debug::RenderDebugOverlayKeybindings.On<E, B> lost B; IntoObserverSystem<E: EventPattern, M, Out> has three generics. Custom bundle-generic events implement EventPattern.ExclusiveSystemParam, ExclusiveFunctionSystem, System::is_exclusive, ExclusiveMarker removed. Exclusivity is tracked at runtime via SystemAccess. WorldId in an exclusive system → Local<WorldId> or world.id().Render, RenderGraph, Core2d/Core3d, ExtractSchedule, UI sets in PostUpdate) use .chain_weak(). Only tracked data conflicts are ordered. If you relied on a channel, atomic, or interior mutability across sets, add an explicit .after(...).FilteredResources* deprecated → QueryParamBuilder + Query<FilteredEntityRef> with .with::<IsResource>().Name: From<&'static str> only; use Name::new(s.to_owned()) for runtime strings.WorldQuery manual impls must add empty init_nested_access and update_archetypes.DeferredWorld::query deprecated → query_state.query_mut(&mut world). ComponentInfo::id() removed. ComponentId lifecycle constants are typed. define_label! takes no interner argument. ScheduleBuildSettings.shuffle_seed exists under the debug feature.Access::reads_and_writes → reads. TypeIdMap deprecated → TypeIdHashMap / TypeIdIndexMap.TextFont::default().font_size is FontSize::Rem(1.) (was Px(20.)); set Px explicitly for fixed sizes.FontSource::SansSerif etc → FontSource::sans_serif() / GenericFontFamily. resolve_font_source → text_font.font.resolve_font_family(fonts). Font::from_bytes no longer takes a family name.Val::Em/Val::Rem with em()/rem() helpers; Node requires EmSize; Val::resolve takes em_size, rem_size; FontSize::eval takes RemSize.BorderRadius is a Node field (Node { border_radius: BorderRadius::all(CornerRadius::circular(px(8.))), .. }), not a component. Its fields are CornerRadius (.into() from Val works); constructors are no longer const.EditableText + TextInput are separate components. TextScroll → EditableText::viewport. Escape blurs the field and now bubbles.CalculatedClip is an enum (Rects / FullyClipped). TextReader::get returns TextLayoutItem. FocusCause::Auto added. UI rendering is retained (ExtractedUiNodes::changed).cursor module moved to bevy_picking::cursor (and the custom_cursor feature with it); FeathersNumberInput takes a NumberInputValue component; contextual theming reorganised ThemeProps.AssetId::invalid() deprecated → Option<AssetId>. UntypedHandle::meta_transform removed. AssetLoadError::RequestedHandleTypeMismatch is boxed.compressed_image_saver now emits BCn/ASTC; old UASTC behaviour is compressed_image_saver_universal. JPEG joined the default processor list.bevy_curve and bevy_shape split from bevy_math (bevy_math/curve feature gone; enable bevy/bevy_curve). Prelude unchanged; direct bevy_math::primitives::* imports move to bevy_shape.FromType<T> → CreateTypeData<T>; PartialReflect::to_dynamic returns Result; ReflectFromPtr::from_ptr* → raw_pointer_cast; as_reflect → ptr_as_reflect.@ prefix on scene references, -- between entities, template_value gone. references/bsn-syntax.md.LinearRgba::with_luminance no longer clamps. macOS activation follows Window::focused.Interaction, ui::widgets::Button, set_if_neq, FilteredResources, TypeIdMap, AssetId::invalid(). Builds pass with warnings; fix them before 0.21.ScreenSpaceTransmission makes glass opaque-looking. No error.chain_weak only reorders systems with no tracked conflict. Bugs surface as flaky frames, not panics..wgsl fails at asset load, not at cargo check. Rename to .wesl and convert directives.wesl crates).bevy-migration-0-18-to-0-19 — the previous release's catalogue; apply it first.bevy-ecs-components — observers and lifecycle events in their 0.20 form.bevy-ui — Button + Hovered + Pressed, FontSize::Rem, CornerRadius.bevy-pbr-materials — WESL custom materials and ScreenSpaceTransmission.bevy-cargo-features — bevy_curve, bevy_shape, compressed_image_saver*, custom_cursor.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub chrisgliddon/bevy-skills --plugin bevy-skills32 skills in this plugin
/bevyUse when starting any Bevy task, choosing between Update and FixedUpdate, picking Cargo feature flags, or recalling which sibling skill covers ECS, assets, rendering, UI, or migration. Routes to the right Bevy 0.20 skill and pins the engine version for downstream snippets./bevy-a11yUse when designing or auditing high-standard video-game accessibility in Bevy 0.20, integrating screen readers and focus navigation, supporting adaptive controllers and complete remapping, implementing captions or audio description, checking contrast and motion safety, or building disabled-player test evidence./bevy-animationUse when wiring `AnimationPlayer` + `AnimationGraphHandle`, building an `AnimationGraph` from glTF clips, blending state-driven animations with `AnimationTransitions::play`, isolating body parts with `AnimationMask`, firing gameplay sync via `#[derive(AnimationEvent)]` + `On<E>` observers, tweening with `AnimatableCurve` / `EaseFunction` / `CubicSegment::new_bezier_easing` from `bevy::curve`, or applying the 12 Basic Principles of Animation to 3D characters in Bevy 0.20.Other plugins' skills for the same job