{"id":"1c5965f3-c962-4bc6-9482-11d4d42e4e72","shortId":"3Jsg4S","kind":"skill","title":"bevy-ecs-expert","tagline":"Master Bevy's Entity Component System (ECS) in Rust, covering Systems, Queries, Resources, and parallel scheduling.","description":"# Bevy ECS Expert\n\n## Overview\n\nA guide to building high-performance game logic using Bevy's data-oriented ECS architecture. Learn how to structure systems, optimize queries, manage resources, and leverage parallel execution.\n\n## When to Use This Skill\n\n- Use when developing games with the Bevy engine in Rust.\n- Use when designing game systems that need to run in parallel.\n- Use when optimizing game performance by minimizing cache misses.\n- Use when refactoring object-oriented logic into data-oriented ECS patterns.\n\n## Step-by-Step Guide\n\n### 1. Defining Components\n\nUse simple structs for data. Derive `Component` and `Reflect`.\n\n```rust\n#[derive(Component, Reflect, Default)]\n#[reflect(Component)]\nstruct Velocity {\n    x: f32,\n    y: f32,\n}\n\n#[derive(Component)]\nstruct Player;\n```\n\n### 2. Writing Systems\n\nSystems are regular Rust functions that query components.\n\n```rust\nfn movement_system(\n    time: Res<Time>,\n    mut query: Query<(&mut Transform, &Velocity), With<Player>>,\n) {\n    for (mut transform, velocity) in &mut query {\n        transform.translation.x += velocity.x * time.delta_seconds();\n        transform.translation.y += velocity.y * time.delta_seconds();\n    }\n}\n```\n\n### 3. Managing Resources\n\nUse `Resource` for global data (score, game state).\n\n```rust\n#[derive(Resource)]\nstruct GameState {\n    score: u32,\n}\n\nfn score_system(mut game_state: ResMut<GameState>) {\n    game_state.score += 10;\n}\n```\n\n### 4. Scheduling Systems\n\nAdd systems to the `App` builder, defining execution order if needed.\n\n```rust\nfn main() {\n    App::new()\n        .add_plugins(DefaultPlugins)\n        .init_resource::<GameState>()\n        .add_systems(Update, (movement_system, score_system).chain())\n        .run();\n}\n```\n\n## Examples\n\n### Example 1: Spawning Entities with Require Component\n\n```rust\nuse bevy::prelude::*;\n\n#[derive(Component, Reflect, Default)]\n#[require(Velocity, Sprite)]\nstruct Player;\n\n#[derive(Component, Default)]\nstruct Velocity {\n    x: f32,\n    y: f32,\n}\n\nfn setup(mut commands: Commands, asset_server: Res<AssetServer>) {\n    commands.spawn((\n        Player,\n        Velocity { x: 10.0, y: 0.0 },\n        Sprite::from_image(asset_server.load(\"player.png\")), \n    ));\n}\n```\n\n### Example 2: Query Filters\n\nUse `With` and `Without` to filter entities efficiently.\n\n```rust\nfn enemy_behavior(\n    query: Query<&Transform, (With<Enemy>, Without<Dead>)>,\n) {\n    for transform in &query {\n        // Only active enemies processed here\n    }\n}\n```\n\n## Best Practices\n\n- ✅ **Do:** Use `Query` filters (`With`, `Without`, `Changed`) to reduce iteration count.\n- ✅ **Do:** Prefer `Res` over `ResMut` when read-only access is sufficient to allow parallel execution.\n- ✅ **Do:** Use `Bundle` to spawn complex entities atomically.\n- ❌ **Don't:** Store heavy logic inside Components; keep them as pure data.\n- ❌ **Don't:** Use `RefCell` or interior mutability inside components; let the ECS handle borrowing.\n\n## Troubleshooting\n\n**Problem:** System panic with \"Conflict\" error.\n**Solution:** You are likely trying to access the same component mutably in two systems running in parallel. Use `.chain()` to order them or split the logic.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.","tags":["bevy","ecs","expert","antigravity","awesome","skills","sickn33","agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding"],"capabilities":["skill","source-sickn33","skill-bevy-ecs-expert","topic-agent-skills","topic-agentic-skills","topic-ai-agent-skills","topic-ai-agents","topic-ai-coding","topic-ai-workflows","topic-antigravity","topic-antigravity-skills","topic-claude-code","topic-claude-code-skills","topic-codex-cli","topic-codex-skills"],"categories":["antigravity-awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/bevy-ecs-expert","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add sickn33/antigravity-awesome-skills","source_repo":"https://github.com/sickn33/antigravity-awesome-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 34928 github stars · SKILL.md body (3,477 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-24T18:50:36.146Z","embedding":null,"createdAt":"2026-04-18T21:33:32.480Z","updatedAt":"2026-04-24T18:50:36.146Z","lastSeenAt":"2026-04-24T18:50:36.146Z","tsv":"'0.0':282 '1':108,240 '10':204 '10.0':280 '2':137,289 '3':178 '4':205 'access':340,394 'activ':314 'add':208,224,229 'allow':344 'app':212,222 'architectur':41 'ask':447 'asset':273 'asset_server.load':286 'atom':354 'behavior':303 'best':318 'bevi':2,6,21,35,66,248 'bevy-ecs-expert':1 'borrow':380 'boundari':455 'build':28 'builder':213 'bundl':349 'cach':88 'chain':236,406 'chang':326 'clarif':449 'clear':422 'command':271,272 'commands.spawn':276 'complex':352 'compon':9,110,117,122,126,134,147,245,251,260,361,375,397 'conflict':386 'count':330 'cover':14 'criteria':458 'data':38,99,115,185,366 'data-ori':37,98 'default':124,253,261 'defaultplugin':226 'defin':109,214 'deriv':116,121,133,190,250,259 'describ':426 'design':72 'develop':62 'ec':3,11,22,40,101,378 'effici':299 'enemi':302,315 'engin':67 'entiti':8,242,298,353 'environ':438 'environment-specif':437 'error':387 'exampl':238,239,288 'execut':54,215,346 'expert':4,23,443 'f32':130,132,265,267 'filter':291,297,323 'fn':149,196,220,268,301 'function':144 'game':32,63,73,84,187,200 'game_state.score':203 'gamest':193 'global':184 'guid':26,107 'handl':379 'heavi':358 'high':30 'high-perform':29 'imag':285 'init':227 'input':452 'insid':360,374 'interior':372 'iter':329 'keep':362 'learn':42 'let':376 'leverag':52 'like':391 'limit':414 'logic':33,96,359,413 'main':221 'manag':49,179 'master':5 'match':423 'minim':87 'miss':89,460 'movement':150,232 'mut':154,157,162,166,199,270 'mutabl':373,398 'need':76,218 'new':223 'object':94 'object-ori':93 'optim':47,83 'order':216,408 'orient':39,95,100 'output':432 'overview':24 'panic':384 'parallel':19,53,80,345,404 'pattern':102 'perform':31,85 'permiss':453 'player':136,258,277 'player.png':287 'plugin':225 'practic':319 'prefer':332 'prelud':249 'problem':382 'process':316 'pure':365 'queri':16,48,146,155,156,167,290,304,305,312,322 'read':338 'read-on':337 'reduc':328 'refactor':92 'refcel':370 'reflect':119,123,125,252 'regular':142 'requir':244,254,451 'res':153,275,333 'resmut':202,335 'resourc':17,50,180,182,191,228 'review':444 'run':78,237,402 'rust':13,69,120,143,148,189,219,246,300 'safeti':454 'schedul':20,206 'scope':425 'score':186,194,197,234 'second':172,177 'server':274 'setup':269 'simpl':112 'skill':59,417 'skill-bevy-ecs-expert' 'solut':388 'source-sickn33' 'spawn':241,351 'specif':439 'split':411 'sprite':256,283 'state':188,201 'step':104,106 'step-by-step':103 'stop':445 'store':357 'struct':113,127,135,192,257,262 'structur':45 'substitut':435 'success':457 'suffici':342 'system':10,15,46,74,139,140,151,198,207,209,230,233,235,383,401 'task':421 'test':441 'time':152 'time.delta':171,176 'topic-agent-skills' 'topic-agentic-skills' 'topic-ai-agent-skills' 'topic-ai-agents' 'topic-ai-coding' 'topic-ai-workflows' 'topic-antigravity' 'topic-antigravity-skills' 'topic-claude-code' 'topic-claude-code-skills' 'topic-codex-cli' 'topic-codex-skills' 'transform':158,163,306,310 'transform.translation':168,173 'treat':430 'tri':392 'troubleshoot':381 'two':400 'u32':195 'updat':231 'use':34,57,60,70,81,90,111,181,247,292,321,348,369,405,415 'valid':440 'veloc':128,159,164,255,263,278 'velocity.x':170 'velocity.y':175 'without':295,308,325 'write':138 'x':129,169,264,279 'y':131,174,266,281","prices":[{"id":"cb1f0be1-20f7-4aed-8948-19cc09f8f912","listingId":"1c5965f3-c962-4bc6-9482-11d4d42e4e72","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sickn33","category":"antigravity-awesome-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T21:33:32.480Z"}],"sources":[{"listingId":"1c5965f3-c962-4bc6-9482-11d4d42e4e72","source":"github","sourceId":"sickn33/antigravity-awesome-skills/bevy-ecs-expert","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/bevy-ecs-expert","isPrimary":false,"firstSeenAt":"2026-04-18T21:33:32.480Z","lastSeenAt":"2026-04-24T18:50:36.146Z"}],"details":{"listingId":"1c5965f3-c962-4bc6-9482-11d4d42e4e72","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"bevy-ecs-expert","github":{"repo":"sickn33/antigravity-awesome-skills","stars":34928,"topics":["agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity","antigravity-skills","claude-code","claude-code-skills","codex-cli","codex-skills","cursor","cursor-skills","developer-tools","gemini-cli","gemini-skills","kiro","mcp","skill-library"],"license":"mit","html_url":"https://github.com/sickn33/antigravity-awesome-skills","pushed_at":"2026-04-24T06:41:17Z","description":"Installable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.","skill_md_sha":"e6183fb976250a53d9552b89038e14e50a456b8c","skill_md_path":"skills/bevy-ecs-expert/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/bevy-ecs-expert"},"layout":"multi","source":"github","category":"antigravity-awesome-skills","frontmatter":{"name":"bevy-ecs-expert","description":"Master Bevy's Entity Component System (ECS) in Rust, covering Systems, Queries, Resources, and parallel scheduling."},"skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/bevy-ecs-expert"},"updatedAt":"2026-04-24T18:50:36.146Z"}}