> plugins, define Component/Resource types, write systems with Query/Res/Commands, filter and order systems, and use the Time resource for frame-rate-independent motion. Use when building or debugging a Bevy game in Rust — when the user or a Cargo.toml depending on bevy.
npx skills add https://github.com/gamedev-skills/awesome-gamedev-agent-skills --skill bevy-ecs
Structure a Bevy game in Rust around the Entity Component System: the App and
plugins, components and resources, systems with queries, scheduling, and
frame-rate-independent updates. Pins Bevy 0.16+ (code targets 0.16; Bevy's API
shifts each minor release — match your Cargo.toml).
App, defining Component/Resource types, writingsystems that query entities, ordering/filtering systems, or fixing
borrow-conflict panics and frame-dependent movement.
Cargo.toml depends on bevy and code calls App::new(),add_systems, Query, or Commands.
When *not* to use: this is the ECS core. Deep rendering, custom shaders/
pipelines, UI layout, and audio are separate concerns. For engine-agnostic AI or
procedural algorithms, pair with game-ai / procedural-gen.
bevy = "0.16" (or your target) in Cargo.toml and treat the matching docs as
truth. Enable dynamic_linking in dev for faster iterative builds.
App. App::new().add_plugins(DefaultPlugins) gives windowing,input, rendering, time, etc. Register systems into schedules: Startup (once)
and Update (every frame).
#[derive(Component)] forper-entity data; #[derive(Resource)] for one-of-a-kind data (score, settings,
the Time clock).
Query<...>for entities, Res<T>/ResMut<T> for resources, Commands for deferred
spawn/despawn. Systems run in parallel when their accesses don't conflict.
time.delta_secs() so speed is frame-rate independent..chain() or explicit constraints;gate systems with run_if. Group related setup into Plugins. Build with
cargo run and read the panics — Bevy reports conflicting queries at startup.
# Cargo.toml — pin the version; the API differs across minor releases.
[dependencies]
bevy = "0.16"
# Dev-only: faster recompiles. (Add the matching dynamic linking setup per the book.)
# bevy = { version = "0.16", features = ["dynamic_linking"] }
// main.rs
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins) // window, input, render, time, ...
.add_systems(Startup, setup) // runs once at startup
.add_systems(Update, move_players) // runs every frame
.run();
}
#[derive(Component)]
struct Player;
#[derive(Component)]
struct Velocity(Vec2);
#[derive(Resource)]
struct Score(u32);
fn setup(mut commands: Commands) {
commands.insert_resource(Score(0));
// Camera2d is a component with required components (bundles removed in 0.16);
// spawning it pulls in Transform, Camera, etc. automatically.
commands.spawn(Camera2d);
// Spawn an entity as a tuple of components.
commands.spawn((
Player,
Velocity(Vec2::new(150.0, 0.0)),
Transform::from_xyz(0.0, 0.0, 0.0),
));
}
// Iterate every entity that has BOTH Velocity and Transform; mutate Transform.
fn move_players(time: Res<Time>, mut query: Query<(&Velocity, &mut Transform)>) {
for (velocity, mut transform) in &mut query {
// delta_secs() is f32 seconds (renamed from delta_seconds() in 0.16).
transform.translation += velocity.0.extend(0.0) * time.delta_secs();
}
}
// Only entities tagged Player (the Player component itself isn't read).
fn aim_player(mut q: Query<&mut Transform, With<Player>>) { /* ... */ }
// Disjoint two mutable Transform queries so they don't conflict at runtime.
fn separate(
mut players: Query<&mut Transform, With<Player>>,
mut enemies: Query<&mut Transform, Without<Player>>,
) { /* ... */ }
// React only when Health changed since last run (change detection).
fn on_health_change(q: Query<&Health, Changed<Health>>) {
for health in &q { /* update the HUD, etc. */ }
}
fn add_points(mut score: ResMut<Score>) {
score.0 += 10; // ResMut = write access
}
fn show_score(score: Res<Score>) {
info!("score: {}", score.0); // Res = read access
}
fn main() {
App::new()
.add_plugins((DefaultPlugins, GameplayPlugin))
// .chain() forces order: damage resolves before death is checked.
.add_systems(Update, (apply_damage, check_deaths).chain())
// run_if gates a system on a condition each frame.
.add_systems(Update, spawn_wave.run_if(wave_timer_finished))
.run();
}
struct GameplayPlugin;
impl Plugin for GameplayPlugin {
fn build(&self, app: &mut App) {
app.insert_resource(Score(0))
.add_systems(Startup, setup)
.add_systems(Update, (move_players, add_points));
}
}
delta_seconds() not found → it was renamed to time.delta_secs() (andelapsed_secs()) in 0.16. Using the old name fails to compile.
time.delta_secs(). Never assume a fixed frame time.
Querys in onesystem both write the same component, or one reads while another writes overlapping
entities. Make them disjoint with With/Without, or use ParamSet.
Camera2dBundle/SpriteBundle not found → bundles were deprecated in 0.15 andremoved in 0.16.
Spawn the components directly (Camera2d, Sprite, Transform); required
components fill in the rest.
Component is not implemented" → you forgot #[derive(Component)](or #[derive(Resource)] for a resource).
Commands aredeferred and applied at the next sync point. Read the entity in a subsequent system,
not the one that spawned it.
If B must follow A, add (A, B).chain() or an explicit ordering constraint.
the buffered-event API was reworked after 0.16). Verify against the docs for
*your* pinned version; don't mix versions.
SystemSet ordering, States/OnEnter/OnExit, changedetection, Commands lifecycle and sync points, ParamSet for conflicting
queries, and a version note on the events/observers API, read
references/queries-and-scheduling.md.
game-ai — FSMs/behavior trees/steering as portable concepts to implement in ECS.procedural-gen — noise/RNG/generation algorithms to drive from systems.pygame-core / love2d-core — lighter-weight engines for smaller projects.Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification
Take gamedev-skills/bevy-ecs from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.