bevy
Skill1 starsChanged 4 months agoMITView on GitHub
This skill should be used when working on Bevy game engine projects. It provides specialized knowledge for Bevy's Entity Component System (ECS) architecture, component-driven design patterns, system ordering, UI development, build strategies, and common pitfalls. Use this skill when implementing game features, debugging Bevy code, designing component architectures, or working with Bevy's UI system.
3 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- chrisgliddon/bevy-skillstheir own version, first seen Nov 3, 2026
- elodin-sys/elodintheir own version, first seen Oct 8, 2026
- jarrodmedrano/jarrod-claude-skillsedited, first seen Jan 25, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- jarrodmedrano/jarrod-claude-skills★ 295% same
Wrote their own version · 2
- elodin-sys/elodin★ 553same name
- chrisgliddon/bevy-skills★ 29same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. 0 are common, 15 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
15
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 43
The registry examples are your bible: Always check them before implementing new features.
- Distinctive: line 76
Check Bevy examples for similar patterns
- Distinctive: line 78
Create a plugin for the feature domain
- Distinctive: line 181
Only use during development
- Distinctive: line 182
CRITICAL: Always use this for development builds
- Distinctive: line 189
Use after every significant change
- Distinctive: line 196
Use for final testing and distribution
- Very specific: line 202
Avoid cargo clean unless absolutely necessary
- Very specific: line 211
After component changes: Run cargo check
- Very specific: line 212
After system changes: Run cargo check then cargo build --features bevy/dynamic_linking
- Distinctive: line 215
Do the new features work?
- Distinctive: line 217
Do visual changes appear correctly?
- Distinctive: line 277
Phase 2: Content: - Add entities and populate world
- Distinctive: line 304
Use spatial partitioning for proximity queries
- Distinctive: line 306
Consider Fixed timestep for physics
- Very specific: line 321
Not using Changed<T> for expensive operations
- Distinctive: line 330
When implementing multi-step features, use the plan-implementer subagent with this structure:
- Distinctive: line 406
Prefer composition over inheritance
- Distinctive: line 409
Use messages (buffered) to decouple systems.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Bevy Game Development Skill
A specialized skill for developing games and applications using the Bevy game engine, based on real-world experience building complex Bevy projects.
When to Use This Skill
Invoke this skill when:
- Implementing features in a Bevy game or application
- Designing component architectures for ECS
- Creating or debugging Bevy systems
- Working with Bevy's UI system
- Building and testing Bevy projects
- Troubleshooting common Bevy issues
- Organizing project structure for Bevy applications
Before You Start: Essential Bevy Tips
⚠️ Bevy 0.19 Breaking Changes
This skill targets Bevy 0.19 (0.19.0, released 2026-06-19) — the current version. For a project still on 0.18, the items below marked as 0.18-era (messages,
single()) still apply; see the migration-gotchas section inreferences/bevy_specific_tips.mdfor the 0.18 → 0.19 deltas.
When working with Bevy 0.19, be aware of these API shapes:
- Material handles wrapped in
MeshMaterial3d<T>(notHandle<T>); meshes inMesh3d - Buffered events are "messages":
EventWriter→MessageWriter(.write()),EventReader→MessageReader(.read()),add_event::<T>()→add_message::<T>(),#[derive(Event)]→#[derive(Message)] - Observers (
commands.trigger(),add_observer()) are a separate reactive tool — not a replacement for buffered messages - Queries use
.single()/.single_mut()(both returnResult);get_single*was removed TextFont.font_sizeis theFontSizeenum:font_size: FontSize::Px(35.0)Assets::get_mutreturns anAssetMutguard — the binding must bemut- Color arithmetic operations removed (use component extraction)
See references/bevy_specific_tips.md for the full API reference and the "Bevy 0.18 → 0.19 migration gotchas" section.
Consult Bevy Registry Examples First
The registry examples are your bible. Always check them before implementing new features.
Location:
~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy-0.19.0/examplesThere are MANY examples covering all aspects of Bevy development. Review relevant examples to understand best practices and working patterns.
Use Plugin Structure
Break your app into discrete modules using plugins. This improves organization and makes code discoverable.
pub struct CombatPlugin;
impl Plugin for CombatPlugin {
fn build(&self, app: &mut App) {
app
.add_message::<DamageEvent>()
.add_systems(Update, (process_damage, check_death));
}
}See references/bevy_specific_tips.md for detailed plugin patterns and examples.
Design Before Coding
Pure ECS demands careful data modeling. It's hard to search a massive list of systems in one file!
Before implementing:
- Design the data model (entities, components, events, systems)
- Check Bevy examples for similar patterns
- Review docs and existing code
- Create a plugin for the feature domain
See references/bevy_specific_tips.md for domain-driven design guidance.
Core Development Principles
Think in ECS Terms
Bevy is an Entity Component System (ECS) engine. Always think in terms of data (components) and transformations (systems), not objects and methods.
Separation of Concerns:
- Components = Pure data, no logic
- Systems = Pure logic, operate on components
- Messages = Buffered communication between systems (formerly "events", renamed in 0.18)
- Resources = Global state (use sparingly)
Component-Driven Design
Keep components focused:
// ✅ GOOD: Small, focused components
#[derive(Component)]
pub struct Health { pub current: f32, pub max: f32 }
#[derive(Component)]
pub struct Armor { pub defense: f32 }
// ❌ BAD: Monolithic component
#[derive(Component)]
pub struct CombatStats {
pub health: f32,
pub armor: f32,
pub strength: f32,
// ... wastes memory for entities that only have some stats
}Add helper methods via impl blocks:
impl Health {
pub fn is_alive(&self) -> bool {
self.current > 0.0
}
pub fn percentage(&self) -> f32 {
self.current / self.max
}
}For detailed component patterns, see references/ecs_patterns.md.
System Design and Ordering
Order systems by dependencies:
.add_systems(
Update,
(
// 1. Input processing
handle_input,
// 2. State changes
process_events,
update_state,
// 3. Derive properties from state
calculate_derived_values,
// 4. Visual updates
update_materials,
update_animations,
// 5. UI updates (must run last)
update_ui_displays,
),
)Use change detection to optimize:
// Only process entities where Health changed
pub fn update_health_bar(
query: Query<(&Health, &mut HealthBar), Changed<Health>>,
) {
for (health, mut bar) in query.iter_mut() {
bar.width = health.percentage() * 100.0;
}
}For detailed query patterns and system design, see references/ecs_patterns.md.
Build and Testing Workflow
Build Commands
Development (faster iteration):
cargo build --features bevy/dynamic_linking- Uses dynamic linking for faster compile times
- 2-3x faster than release builds
- Only use during development
- CRITICAL: Always use this for development builds
Quick Check:
cargo check- Fastest way to verify compilation
- Use after every significant change
Release (production):
cargo build --release- Full optimization
- Use for final testing and distribution
Build Management - CRITICAL
DO NOT delete target binaries freely! Bevy takes minutes to rebuild from scratch.
- Avoid
cargo cleanunless absolutely necessary - Each clean rebuild costs valuable development time
- Be mindful of versions, targets, and crate dependencies getting tangled
- Bevy is under active development - stick to one version per project
See references/bevy_specific_tips.md for detailed build optimization and version management.
Testing Workflow
- After component changes: Run
cargo check - After system changes: Run
cargo checkthencargo build --features bevy/dynamic_linking - Manual testing:
- Does the game launch?
- Do the new features work?
- Are console logs showing expected output?
- Do visual changes appear correctly?
Validation points - Let the user test at these milestones:
- New entity spawned
- New mechanic implemented
- Visual effects added
- Major system changes
UI Development in Bevy
Bevy uses a flexbox-like layout system. Follow the marker component pattern:
1. Create marker components:
#[derive(Component)]
pub struct HealthBar;
#[derive(Component)]
pub struct ScoreDisplay;2. Setup in Startup:
pub fn setup_ui(mut commands: Commands) {
commands.spawn((
HealthBar,
Node {
position_type: PositionType::Absolute,
left: Val::Px(10.0),
top: Val::Px(10.0),
width: Val::Px(200.0),
height: Val::Px(20.0),
..default()
},
BackgroundColor(Color::srgba(0.8, 0.2, 0.2, 0.9)),
));
}3. Update in Update:
pub fn update_health_ui(
health: Query<&Health, With<Player>>,
mut ui: Query<&mut Node, With<HealthBar>>,
) {
if let (Ok(health), Ok(mut node)) = (health.single(), ui.single_mut()) {
node.width = Val::Px(health.percentage() * 200.0);
}
}For detailed UI patterns including positioning, styling, and text updates, see references/ui_development.md.
Incremental Development Strategy
Phase-Based Development
Break features into phases:
Phase 1: Foundation - Core components and basic systems Phase 2: Content - Add entities and populate world Phase 3: Polish - UI improvements and visual effects Phase 4: Advanced Features - Complex mechanics and AI
Iteration Pattern
1. Plan → 2. Implement → 3. Build → 4. Test → 5. Refine
↑ ↓
←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←Each phase should have:
- Clear success criteria (checklist of what works)
- Manual test cases (step-by-step testing procedures)
- User validation points (when to let user test)
Performance Optimization
When to Optimize
For prototypes (7-100 entities):
- No optimization needed
- Change detection is sufficient
- Focus on features, not performance
For production (100+ entities):
- Use spatial partitioning for proximity queries
- Batch material updates
- Consider Fixed timestep for physics
- Profile before optimizing
Query Optimization Tips
- Use change detection:
Query<&Component, Changed<Component>> - Filter early:
Query<&A, (With<B>, Without<C>)>instead of filtering in loops - Check resource changes: Return early if resource hasn't changed
Common Pitfalls to Avoid
Critical mistakes and their solutions are documented in references/common_pitfalls.md. Key pitfalls include:
- Forgetting to register systems in
main.rs - Borrowing conflicts (use
get_many_mutfor multiple mutations) - Not using
Changed<T>for expensive operations - Wrong system ordering (input → state → derived → visual → UI)
- Entity queries after despawn (use
if let Ok()pattern) - Material/asset handle confusion (store handles properly)
Review references/common_pitfalls.md before implementing complex features.
Using Subagents for Complex Features
When implementing multi-step features, use the plan-implementer subagent with this structure:
Goal: [One sentence describing end state]
Current State: [What exists now]
Requirements: [Numbered list of what to build]
Implementation Steps: [Suggested approach]
Success Criteria: [How to verify it works]
Notes: [Important context, edge cases, design principles]Example:
Implement Health System
Goal: Implement a health system with damage, healing, and death mechanics.
Current State:
- Player entity exists
- No health tracking yet
Requirements:
1. Create Health component with current/max values
2. Create DamageEvent for dealing damage
3. Create system to process damage events
4. Add death detection when health reaches 0
5. Add visual health bar UI
Implementation Steps:
1. Create Health component in src/components/properties.rs
2. Create DamageEvent in src/events.rs
3. Create process_damage system in src/systems/combat.rs
4. Create check_death system
5. Create health bar UI in src/systems/ui/health_bar.rs
6. Register all systems in main.rs in correct order
Success Criteria:
- Player spawns with Health component
- Damage events reduce health
- Health bar updates when health changes
- Entity despawns when health reaches 0
- Code compiles without errorsProject Structure Reference
For details on recommended file organization, module structure, and component file patterns, see references/project_structure.md.
References
This skill includes detailed reference documentation:
references/bevy_specific_tips.md- START HERE: Registry examples, plugin structure, build optimization, version management, domain-driven design for ECSreferences/ecs_patterns.md- Component design patterns, query patterns, and common ECS design patterns (Derivation, State Machine, Threshold/Trigger, Event-Driven, Initialization)references/ui_development.md- Bevy UI hierarchy, component patterns, layout tips, positioning, styling, and text updatesreferences/common_pitfalls.md- Common mistakes and their solutions (system registration, borrowing conflicts, change detection, system ordering, entity queries, asset handles)references/project_structure.md- Recommended file organization, module structure, component file patterns, and change detection
Load these references as needed to inform implementation decisions.
Additional Resources
Bevy Documentation:
- Official Bevy Book: https://bevyengine.org/learn/book/
- Bevy Examples: https://github.com/bevyengine/bevy/tree/main/examples (also in
~/.cargo/registry/...) - Bevy Cheat Book: https://bevy-cheatbook.github.io/
- Plugin Guide: https://bevy.org/learn/quick-start/getting-started/plugins/
- System Sets: https://bevy-cheatbook.github.io/programming/system-sets.html
- Setup & Optimization: https://bevy.org/learn/quick-start/getting-started/setup/
ECS Design Principles:
- Prefer composition over inheritance
- One component = one concern
- Systems should be pure functions
- Use messages (buffered) to decouple systems; observers for immediate reactions
- Design data model before coding
- Check registry examples first
Remember: Think in terms of data (components) and transformations (systems), not objects and methods. Always consult registry examples and design your data model before diving into implementation. This is the key to effective Bevy development.
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.

