Agent skill

Bevy Queries

by nolantait in nolantait/bevy-starter

Reference for writing Bevy ECS queries — Query<D, F, Single, filters, component access, iteration patterns, lenses, disjointed access, and testing.

MITAuto-check passed

Install Bevy Queries

skills CLI
$ npx skills add nolantait/bevy-starter --skill bevy-queries -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install nolantait/bevy-starter bevy-queries --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/nolantait/bevy-starter.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/bevy-queries .claude/skills/bevy-queries && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
bevy-queries
GitHub stars
132
Token cost
~1.7k tokens
SKILL.md length
451 words
Files
1
Skills in repo
24
Repo updated
First seen
Licence
MIT

At a glance

Reference for writing Bevy ECS queries — Query<D, F, Single, filters, component access, iteration patterns, lenses, disjointed access, and testing.

  • SKILL.md covers Basics, Component mutability, Tuple = AND logic and Alternative query parameters, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Bevy Queries is an agent skill from nolantait/bevy-starter. Reference for writing Bevy ECS queries — Query<D, F, Single, filters, component access, iteration patterns, lenses, disjointed access, and testing.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: A minimalist starter for bevy and rust. The licence is MIT.

Example prompts

  • “/bevy-queries”

What it can do on your machine

Read from SKILL.md and the folder at commit dd6f56b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are rust).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bevy Queries loads about 1.7k tokens when it runs. Until then it costs about 40 tokens; SKILL.md has 451 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~40
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from nolantait/bevy-starter at commit dd6f56b, republished under its MIT licence (© nolantait). 451 words, ~1,661 tokens.

Download SKILL.mdSave it as .claude/skills/bevy-queries/SKILL.md (or your agent's skills folder).
name
bevy-queries
description
Reference for writing Bevy ECS queries — Query<D, F>, Single, filters, component access, iteration patterns, lenses, disjointed access, and testing.
metadata.crate
bevy_ecs
metadata.bevy
0.19

Basics

Query<D, F> is a system parameter. D = query data (what to fetch), F = query filter (conditions). Data is only fetched when iterated.

rust
fn system(query: Query<&Transform>) {
  for transform in &query { }
}

Component mutability

SyntaxMeaning
Query<&T>Readonly borrow — parallel-friendly
Query<&mut T>Mutable borrow — blocks parallel access to same component
Query<Option<&T>>Optional component — entity may or may not have it

Tuple = AND logic

Each generic parameter in Query<D, F> can be a tuple. All types must match.

rust
Query<(&Ball, &Player)>                // entities with both Ball AND Player
Query<&Transform, (With<Player>, With<Living>)>  // Transform on entities with Player AND Living

Alternative query parameters

ParameterBehavior
Single<D, F>Exactly one match, or system skipped
Option<Single<D, F>>Zero or one match; yields None if there are none or more than one
Populated<D, F>One or more matches, skips if none
rust
fn move(mut t: Single<&mut Transform, With<Player>>) {
  t.translation.x += 1.;
}
fn destructure(s: Single<(&mut Pos, &Vel), With<Player>>) {
  let (mut pos, vel) = s.into_inner();
}

QueryData (D parameter)

TypeDescription
&T / &mut TRead or write component
Option<T>Component or None
AnyOf<T>Fetch entities matching any of the tuple types
Ref<T>Readonly with change detection methods
Has<T>Returns bool if entity has component
EntityThe entity ID
SpawnDetailsWhen paired with the Spawned filter, gives access to when and where an entity was spawned
AnyOf
rust
Query<AnyOf<(&Player, &Rocket, &mut Astroid)>>
// Expands to: Query<(Option<&P>, Option<&R>, Option<&mut A>), Or<(With<P>, With<R>, With<A>)>>
Ref (change detection)
rust
fn check(q: Query<Ref<Player>>) {
  for p in &q {
    if p.is_added() { }
    if p.is_changed() { }
    // p.last_changed()
  }
}
Entity ID
rust
fn with_id(q: Query<(Entity, &Transform)>) {
  for (entity, transform) in &q { }
}
fn lookup(players: Query<Entity, With<Player>>, transforms: Query<&Transform>) {
  for e in &players {
    let t = transforms.get(e).unwrap();
  }
}

QueryFilter (F parameter)

FilterDescription
With<T>Only entities with component T
Without<T>Only entities without component T
Or<F>Checks if any filters in the tuple F apply
Changed<T>Components of type T that changed since the system last ran
Added<T>Components of type T that were added since the system last ran
SpawnedOnly entities that were spawned since the system last ran
rust
Query<&Transform, (With<Player>, Without<Dead>)>
Query<Player, Added<Player>>  // equivalent to Ref<Player> + is_added check
Query<(&Player, SpawnDetails), Spawned>  // newly spawned entities
Show full SKILL.md (217 more words)Show less

Retrieval methods

MethodDescription
iter / iter_mutIterator over all matches
iter_many / iter_many_mutIterate over only the items matching a list of entities
iter_combinations / iter_combinations_mutAll K-combinations of matches
contiguous_iter / contiguous_iter_mutReceives whole table slices at once, enabling SIMD optimizations
par_iter / par_iter_mutParallel iterator
get / get_mutFetch a single entity's components by Entity
get_many / get_many_mutFetch items for each entity in a fixed-size array
single / single_mutThe only query item as a Result, Err unless there is exactly one
is_emptyCheck if query has matches
containsCheck if query contains a specific entity

Every method that returns query items has a *_mut variant; the *_mut methods require a mutable Query parameter.

rust
// Iteration
for mut t in &mut query { }
query.iter_mut().for_each(|mut t| { });

// Specific entity
if let Ok(t) = query.get(entity) { }

// Combinations
for [a, b] in query.iter_combinations() { }

// Many entities
let mut iter = query.iter_many_mut(&entities);
while let Some(mut h) = iter.fetch_next() { }

Query lenses

Share common query logic without duplicating system parameters.

rust
fn print_health(lens: &mut QueryLens<&Health>) {
  for h in &mut lens.query() {
    if h.0 > 50.0 { info!("healthy"); }
  }
}
fn player_system(mut q: Query<(&Health, &Player)>) {
  print_health(&mut q.transmute_lens::<&Health>());
}
fn enemy_system(mut q: Query<(&Health, &Enemy, &Transform)>) {
  print_health(&mut q.transmute_lens::<&Health>());
}
  • transmute_lens — narrow query data
  • transmute_lens_filtered — include filter
  • join / join_filtered — combine queries

Disjointed queries & ParamSet

Two queries with mutable access to overlapping component sets: use Without to disambiguate, or use ParamSet (which serializes access at runtime).

rust
// Will panic at runtime — ambiguous borrows
fn bad(p: Query<&mut Player, With<Rocket>>, e: Query<&mut Player, With<Invincibility>>) { }

// Safe: serialized access
fn ok(p: ParamSet<(Query<&mut Player, With<Rocket>>, Query<&mut Player, With<Invincibility>>)>) { }

// Or with disjoint archetypes (Bevy 0.12+):
fn disjoint(t: Query<EntityMut, With<Transform>>, e: Query<EntityMut, Without<Transform>>) { }

Performance notes

  • Table storage iterates faster than SparseSet
  • Two systems with conflicting mutable access to the same component type cannot run in parallel
  • for_each is generally faster than iter on worlds with high archetype fragmentation
  • Prefer iter over for_each unless profiling shows a need
  • Accessing entity.get_components_mut::<(&mut A, &mut B)>() has quadratic cost over number of components

Testing

Use app.world_mut().run_system_once(fn) or access app.world_mut().query::<T>():

rust
#[cfg(test)]
mod tests {
  use super::*;

  fn setup_app() -> App {
    let mut app = App::new();
    app.add_plugins((MinimalPlugins, plugin));
    app
  }

  fn check_ship(query: Query<&Ship>) {
    assert_eq!(query.iter().count(), 1);
  }

  #[test]
  fn test_spawn() {
    let mut app = setup_app();
    app.update();
    app.world_mut().run_system_once(check_ship).unwrap();
  }
}

© nolantait, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/bevy-queries of nolantait/bevy-starter.

Open the folder on GitHubat commit dd6f56b

Compare with similar skills

Bevy Queries next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Bevy Queries compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bevy Queries this skillnolantait/bevy-starter132—~1.7kAutomated safety check: PassMIT
Bevy Ecsgamedev-skills/awesome-gamedev-agent-skills1.4k—~2.5kAutomated safety check: PassApache-2.0
ClickHouse Query Performance Validationcomet-ml/opik22k—~2.1kAutomated safety check: PassApache-2.0
Analyzing Experiment Query PerformancePostHog/posthog40k—~3.7kAutomated safety check: PassCustom licence
Bevy Ecs Expertaiskillstore/marketplace4333 repos~924Automated safety check: PassNone
Frontend Query Mutationlangflow-ai/langflow155k—~979Automated safety check: PassMIT

Similar skills

  • Bevy Ecs

    gamedev-skills/awesome-gamedev-agent-skills

    Structure a Bevy app around its Entity Component System: build the App with plugins, define Component/Resource types, write systems with Query/Res/Commands, filter and order systems, and use the…

    1.4k GitHub stars~2.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Measures what a ClickHouse query change actually costs, turning a suspicion that a query is slow into numbers a reviewer can act on before it merges.

    22k GitHub stars~2.1k tokensUpdated today
    DatabasesAuto-check passed
  • Pull and interpret production experiment query-performance data from the staff-only /api/debugchqueries endpoints backing the /experiments/staff scene: slowest experiment queries, precompute…

    40k GitHub stars~3.7k tokensUpdated today
    DatabasesAuto-check passed
  • Bevy Ecs Expert

    aiskillstore/marketplace

    Master Bevy's Entity Component System (ECS) in Rust, covering Systems, Queries, Resources, and parallel scheduling.

    433 GitHub starsUsed in 3 repos~924 tokens
    Auto-check passed
  • Frontend Query Mutation

    langflow-ai/langflow

    Guide for implementing Langflow frontend query and mutation patterns with Axios and TanStack React Query v5.

    155k GitHub stars~979 tokensUpdated today
    Frontend & DesignAuto-check passed
  • Studio Queries

    supabase/supabase

    Official

    React Query conventions for data fetching in Supabase Studio.

    111k GitHub stars~1.3k tokensUpdated today
    Backend & APIsAuto-check passed

More from nolantait/bevy-starter

All 24 skills in this repo
  • Bevy Events

    nolantait/bevy-starter

    Reference for events, messages, and observers in Bevy — Message/MessageReader/MessageWriter, Event/EntityEvent, triggers, observers, and propagation.

    132 GitHub stars~867 tokensUpdated yesterday
    Auto-check passed
  • Avian

    nolantait/bevy-starter

    Reference for Avian physics engine — rigid bodies, colliders, joints, spatial queries, collision events, character controllers, and debug rendering.

    132 GitHub stars~3k tokensUpdated yesterday
    Auto-check passed
  • Bevy Assets

    nolantait/bevy-starter

    Reference for loading, managing, and tracking assets in Bevy — AssetServer, handles, loading states, events, custom loaders, and hot reloading.

    132 GitHub stars~871 tokensUpdated yesterday
    Auto-check passed
  • Bevy Audio

    nolantait/bevy-starter

    Reference for playing and controlling audio in Bevy — AudioPlayer, AudioSink, spatial audio, volume, and playback settings.

    132 GitHub stars~713 tokensUpdated yesterday
    Auto-check passed
  • Bevy Bsn

    nolantait/bevy-starter

    Reference for Bevy Scene Notation (BSN) — the bsn!. An agent skill from nolantait/bevy-starter.

    132 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Bevy Cameras

    nolantait/bevy-starter

    Reference for cameras in Bevy — Camera2d, Camera3d, viewports, projection, render layers, mouse-to-world, and free camera controllers.

    132 GitHub stars~976 tokensUpdated yesterday
    Auto-check passed

Questions about Bevy Queries

What does Bevy Queries do?

Reference for writing Bevy ECS queries — Query<D, F, Single, filters, component access, iteration patterns, lenses, disjointed access, and testing. Bevy Queries is an agent skill from nolantait/bevy-starter. Reference for writing Bevy ECS queries — Query<D, F, Single, filters, component access, iteration patterns, lenses, disjointed access, and testing.

How do I install Bevy Queries in Claude Code?

Run `npx skills add nolantait/bevy-starter --skill bevy-queries -a claude-code`. Or copy the skill folder (.agents/skills/bevy-queries in nolantait/bevy-starter) into .claude/skills/bevy-queries in your project. Claude Code loads it when a task matches its description.

How do I install Bevy Queries in Codex?

Run `npx skills add nolantait/bevy-starter --skill bevy-queries -a codex`. Or copy the skill folder (.agents/skills/bevy-queries in nolantait/bevy-starter) into .agents/skills/bevy-queries in your project. Codex loads it when a task matches its description.

Can I use Bevy Queries in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add nolantait/bevy-starter --skill bevy-queries -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bevy-queries, .gemini/skills/bevy-queries, .github/skills/bevy-queries and .opencode/skills/bevy-queries in your project.

What does Bevy Queries need to run?

SKILL.md names no scripts, command-line tools or credentials: Bevy Queries is instructions for the agent only.

Does Bevy Queries access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Bevy Queries safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Bevy Queries use?

Bevy Queries is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bevy Queries use?

About 1.7k tokens (SKILL.md is roughly 6.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Bevy Queries?

Skills that share tags, products or a category with Bevy Queries: Bevy Ecs (gamedev-skills/awesome-gamedev-agent-skills, 1.4k stars), ClickHouse Query Performance Validation (comet-ml/opik, 22k stars), Analyzing Experiment Query Performance (PostHog/posthog, 40k stars) and Bevy Ecs Expert (aiskillstore/marketplace, 433 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bevy Queries?

nolantait (a GitHub user) maintains it in nolantait/bevy-starter, which has 132 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on October 8, 2026.

Source: nolantait/bevy-starter on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.