bevy-debugging-profiling
БесплатноБез исполняемых скриптовНе проверенBevy ECS skill for logs and diagnostics. Keywords: Bevy, LogPlugin, DiagnosticsPlugin, FrameTimeDiagnosticsPlugin.
от thedivergentai★ 1 019 звёзд на GitHubОб этом скилле
Bevy debugging and profiling
When to use
Load this when a running app should print logs or record frame time, entity count, or process CPU and memory.
ECS shape
- Logs:
LogPluginis part ofDefaultPlugins. Override it withDefaultPlugins.set(LogPlugin { level, filter, .. }). The page's example usesLevel::DEBUGand a filter string such aswgpu=error,bevy_render=info,bevy_ecs=trace. The same filter works asRUST_LOG. To bring your own collector, disable this plugin onDefaultPlugins. - Diagnostics core:
DiagnosticsPluginadds the core resources.DiagnosticsStoreholds the collection.Diagnosticis a timeline ofDiagnosticMeasurementvalues addressed byDiagnosticPath.RegisterDiagnosticaddsregister_diagnosticonApp. - Built-in plugins:
FrameTimeDiagnosticsPluginadds frame time, fps, and frame count.EntityCountDiagnosticsPluginadds an entity count.SystemInformationDiagnosticsPluginaddscpu_usageandmem_usagepercent.LogDiagnosticsPluginprints diagnostics to the console.FrameCount/FrameCountPlugincount frames since start. - Order: the log-diagnostics example adds these plugins after
DefaultPluginsbecause they use the time plugin for timestamps. - Schedule: built-in plugins measure on their own. Read
DiagnosticsStorewhen a HUD needs the latest sample. Register aDiagnosticonly for a value you measure yourself.
Examples
[dependencies]
bevy = "0.20"
LogPlugin ships inside DefaultPlugins. Replace its level and filter when the default info stream is too quiet or too loud.
use bevy::log::{Level, LogPlugin};
fn main() {
App::new()
.add_plugins(DefaultPlugins.set(LogPlugin {
filter: "wgpu=error,bevy_render=info,bevy_ecs=trace".into(),
level: Level::DEBUG,
..default()
}))
.run();
}
Frame time, entity count, process CPU and memory, and a console dump are four plugins. Add them after DefaultPlugins so timestamps exist.
use bevy::diagnostic::{
EntityCountDiagnosticsPlugin, FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin,
SystemInformationDiagnosticsPlugin,
};
fn main() {
App::new()
.add_plugins((
DefaultPlugins,
FrameTimeDiagnosticsPlugin::default(),
EntityCountDiagnosticsPlugin {
max_history_length: 60,
},
SystemInformationDiagnosticsPlugin,
LogDiagnosticsPlugin::default(),
))
.run();
}
A HUD reads the smoothed frame-time sample from the store. The path constants live on the plugin that recorded them.
use bevy::diagnostic::{DiagnosticsStore, FrameTimeDiagnosticsPlugin};
fn read_frame_time(store: Res<DiagnosticsStore>) {
let Some(frame) = store.get(&FrameTimeDiagnosticsPlugin::FRAME_TIME) else {
return;
};
let Some(ms) = frame.smoothed() else {
return;
};
info!("frame {ms:.2} ms");
}
A custom counter is a DiagnosticPath plus register_diagnostic. One system writes the measurement; nothing else mutates that path.
use bevy::diagnostic::{Diagnostic, DiagnosticPath, Diagnostics, RegisterDiagnostic};
const LIVE_ENEMIES: DiagnosticPath = DiagnosticPath::const_new("game/live_enemies");
#[derive(Component)]
struct Enemy;
fn install(app: &mut App) {
app.register_diagnostic(Diagnostic::new(LIVE_ENEMIES).with_max_history_length(60));
}
fn measure_enemies(mut diagnostics: Diagnostics, enemies: Query<(), With<Enemy>>) {
let count = enemies.iter().count() as f64;
diagnostics.add_measurement(&LIVE_ENEMIES, || count);
}
Scope
- Per-system flame graphs and Tracy stay outside this skill.
LogPlugincovers level and filter. - Custom measurements use
Diagnostic,DiagnosticPath, andregister_diagnosticas in the example above. - This skill does not forward diagnostics into the render app.
Expert Knowledge Delta
Target: Bevy 0.20+.
Core ECS types: Component, Resource, Query, Commands, Startup, Update, Fixed / FixedMain (bevy::time), .chain(), Plugin, DefaultPlugins, MinimalPlugins. Messages and observers are an ownership slot. See bevy-events-messaging for their APIs. Systems run in parallel unless .chain() orders the ones that conflict.
Who owns state
| Piece | Owner | Who may mutate | Schedule |
|---|---|---|---|
| Data on one entity | Component |
One system via Query |
Update or FixedMain |
| One value for the whole app | Resource |
One system | Startup to insert, then the schedule that reads it |
| Spawn | Commands |
The spawning system | Startup for the initial world; later schedules for runtime spawn |
| Order that must not race | .chain() |
The chained systems only | Same schedule |
| Plugin boundary | Plugin |
build registers systems and resources |
Before the app runs |
Borrow rule: two systems that both mutably query the sam
Установить bevy-debugging-profiling в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл bevy-debugging-profiling?
Bevy ECS skill for logs and diagnostics. Keywords: Bevy, LogPlugin, DiagnosticsPlugin, FrameTimeDiagnosticsPlugin.
Как установить скилл bevy-debugging-profiling?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bevy-debugging-profiling запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic