/bevy-skills:bevy-voxel-runtimefrom bevy-skills
Manages production-grade voxel remeshing in Bevy 0.20 with async compute tasks, revision tokens, dirty/halo fan-out, priority queues, and atomic mesh/collider swaps.
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.
AsyncComputeTaskPool task per edit.Use this skill after the block catalog and mesher are correct. It owns the runtime contract between edits, background meshing, and main-thread presentation. A worker result is only a proposal: the world revision must still accept it.
use bevy::prelude::*;
use std::collections::{BinaryHeap, HashMap, VecDeque};
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct SectionCoord { x: i32, y: i32, z: i32 }
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
struct WorkToken {
coord: SectionCoord,
revision: u64,
epoch: u64,
}
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
enum WorkState {
#[default]
Idle,
Queued,
Running,
RunningAndDirty,
Ready,
}
#[derive(Resource, Default)]
struct RemeshRuntime {
state: HashMap<SectionCoord, WorkState>,
latest: HashMap<SectionCoord, WorkToken>,
queued: BinaryHeap<PriorityEntry>,
completed: VecDeque<MeshResult>,
}
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
struct PriorityEntry {
// Include the token or queue generation so obsolete heap entries can be skipped.
priority: i64,
queue_generation: u64,
token: WorkToken,
}
struct MeshResult {
token: WorkToken,
mesh: MeshPayload,
collider: ColliderPayload,
}
struct MeshPayload;
struct ColliderPayload;
The worker input must own an immutable snapshot of the section plus required halo. Do not hold ECS borrows, asset borrows, or world locks across background work.
use bevy::tasks::{block_on, poll_once, AsyncComputeTaskPool, Task};
#[derive(Component)]
struct RemeshTask { token: WorkToken, task: Task<MeshResult> }
fn collect_results(
mut commands: Commands,
mut runtime: ResMut<RemeshRuntime>,
mut tasks: Query<(Entity, &mut RemeshTask)>,
) {
for (entity, mut job) in &mut tasks {
if let Some(result) = block_on(poll_once(&mut job.task)) {
commands.entity(entity).despawn();
runtime.completed.push_back(result);
}
}
}
block_on and poll_once are re-exported from bevy::tasks; this matches the
polling shape in bevy-voxel-pipeline and bevy-voxel-data.
&mut World is a plain SystemParam (0.20). The apply step can be any
system taking world: &mut World; System::is_exclusive no longer exists, so do
not gate on it.iter_many yields Result (0.20). Applying results to a list of section
entities needs query.iter_many(ids).matched() for the old skip-missing semantics.MeshTag(x) is MeshTag::new(x);
compute_aabb is get_aabb via bevy::camera::primitives::MeshAabb.futures_lite::future::poll_once. 0.20 re-exports
block_on/poll_once from bevy::tasks; futures::check_ready also works.Name is From<&'static str> only (0.20). Label section entities with
Name::new(format!(..)).bevy_rapier3d 0.37 (2026-10-10) and avian3d 0.8
(2026-10-20) both depend on bevy ^0.20. Older bevy_rapier3d 0.36 is 0.19-only.edit -> compute dirty footprint -> bump revisions -> coalesce queue intent
-> priority scheduler -> bounded task starts -> completed-result queue
-> validate token -> bounded main-thread upload -> mesh+collider swap
\-> stale reject + metric
Update/PostUpdate or an exclusive system with a measured
per-frame budget. GPU asset creation is main-world work, not worker work.| Problem | Read |
|---|---|
| Dirty footprints, halo semantics, revision and lifecycle tokens | Dirtying and revisions |
| Coalescing, priority heaps, task ownership, and queue bounds | Queues and priorities |
| Stale rejection, atomic presentation swaps, and diagnostics | Apply and telemetry |
bevy-voxel-data — stable serialized block IDs and dense runtime palettes.bevy-voxel-pipeline — mesh generation and block-mesh-rs.bevy-diagnostics-profiling — diagnostics, spans, and platform budgets.bevy-physics — collider ownership and physics scheduling.bevy-migration-0-19-to-0-20 — iter_many, MeshTag::new, exclusive-system changes.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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./bevy-assetsUse when loading with `AssetServer::load` or `AssetServer::load_builder().with_settings(..)`, holding a `Handle<T>`, spawning a glTF scene with `WorldAssetRoot` (`Handle<WorldAsset>`), mutating through `Assets::get_mut` / `AssetMut`, polling `LoadState::is_loaded`, resolving an `AssetPath`, or replacing `AssetId::invalid()` with `Option<AssetId<T>>` in Bevy 0.20./bevy-audioUse when implementing audio in Bevy 0.20 with `AudioPlayer`, `PlaybackSettings`, `AudioSink` or `SpatialAudioSink`, spatial listeners, application mix groups, ambience/music transitions, asset lifetime, browser gesture restrictions, or choosing built-in audio versus `bevy_seedling 0.8`./bevy-camerasUse when spawning `Camera3d` or `Camera2d`, choosing a `Projection`, rendering to an image with the `RenderTarget` component, adding `Hdr` / `Tonemapping::Linear` / `ScreenSpaceTransmission` to a camera, wiring `FreeCamera`, `PanCamera` or the new `PanOrbitCamera` from `bevy::camera_controller`, ordering views with `Camera::order`, or setting a per-camera `AmbientLight` in Bevy 0.20.Other plugins' skills for the same job