# Bevy Ability System

Bevy ECS skill for abilities.

- Repository: https://github.com/thedivergentai/Game-Dev-Agentic-Skills (917 stars)
- Category: Engineering
- License: LGPL-3.0
- Last updated: 2026-10-16
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-ability-system -g -a claude-code -y`
Codex: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-ability-system -g -a codex -y`
Cursor: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-ability-system -g -a cursor -y`
Gemini CLI: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-ability-system -g -a gemini-cli -y`

## Description

Bevy ECS skill for abilities. Keywords: Bevy, ability, cooldown, ECS, gameplay.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Bevy ability system

## When to use

Load this when an actor grants, cools down, or spends an ability. Combat resolution stays on bevy-combat-system.

## ECS shape

- **Components:** ability id, charges, and cooldown remaining on the caster.
- **Resources:** run-wide tables live in a resource (bevy-data-resources).
- **Systems:** mutate those components on `Update` or the fixed timestep. Use `.chain()` when damage must land before death.
- **Messages:** one-shot facts (hit, pickup, quest advance) go through bevy-events-messaging. This file does not add a new event type name.

## Ability choices

| Need | Bevy idiom |
| --- | --- |
| Ability definition | A `Resource` catalog plus a component row on the caster. |
| Cooldown | `remaining` stepped with `Time<Fixed>::delta_secs` in `FixedUpdate`. |
| Cast | `MessageWriter<CastAccepted>` after the cooldown and charge gates pass. |

## Scope

- Cooldowns, charges, and catalogs are components and resources. Combat damage stays on bevy-combat-system.
- Stacking status effects is a component list you tick on `FixedUpdate`.

## Examples

```toml
[package]
name = "abilities"
version = "0.1.0"
edition = "2021"

[dependencies]
bevy = "0.20"
```

Cooldown and charges share the caster. Tick, then accept the cast, on `FixedUpdate`.

```rust
#[derive(Component)]
struct Cooldown {
    remaining: f32,
    duration: f32,
}

#[derive(Component)]
struct Charges {
    current: u32,
    max: u32,
}

#[derive(Message)]
struct CastAccepted {
    caster: Entity,
}

fn tick_cooldowns(time: Res<Time<Fixed>>, mut query: Query<&mut Cooldown>) {
    let dt = time.delta_secs();
    for mut cooldown in &mut query {
        cooldown.remaining = (cooldown.remaining - dt).max(0.0);
    }
}

The rest: https://github.com/thedivergentai/Game-Dev-Agentic-Skills/blob/HEAD/skills/bevy-ability-system/SKILL.md
