@jarrodmedrano/claude-skills 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/.claude/skills/bevy/SKILL.md +406 -0
  2. package/.claude/skills/bevy/references/bevy_specific_tips.md +385 -0
  3. package/.claude/skills/bevy/references/common_pitfalls.md +217 -0
  4. package/.claude/skills/bevy/references/ecs_patterns.md +277 -0
  5. package/.claude/skills/bevy/references/project_structure.md +116 -0
  6. package/.claude/skills/bevy/references/ui_development.md +147 -0
  7. package/.claude/skills/domain-driven-design/SKILL.md +459 -0
  8. package/.claude/skills/domain-driven-design/references/ddd_foundations_and_patterns.md +664 -0
  9. package/.claude/skills/domain-driven-design/references/rich_hickey_principles.md +406 -0
  10. package/.claude/skills/domain-driven-design/references/visualization_examples.md +790 -0
  11. package/.claude/skills/domain-driven-design/references/wlaschin_patterns.md +639 -0
  12. package/.claude/skills/godot/SKILL.md +728 -0
  13. package/.claude/skills/godot/assets/templates/attribute_template.gd +109 -0
  14. package/.claude/skills/godot/assets/templates/component_template.gd +76 -0
  15. package/.claude/skills/godot/assets/templates/interaction_template.gd +108 -0
  16. package/.claude/skills/godot/assets/templates/item_resource.tres +11 -0
  17. package/.claude/skills/godot/assets/templates/spell_resource.tres +20 -0
  18. package/.claude/skills/godot/references/architecture-patterns.md +608 -0
  19. package/.claude/skills/godot/references/common-pitfalls.md +518 -0
  20. package/.claude/skills/godot/references/file-formats.md +491 -0
  21. package/.claude/skills/godot/references/godot4-physics-api.md +302 -0
  22. package/.claude/skills/godot/scripts/validate_tres.py +145 -0
  23. package/.claude/skills/godot/scripts/validate_tscn.py +170 -0
  24. package/.claude/skills/react-three-fiber/SKILL.md +2055 -0
  25. package/.claude/skills/react-three-fiber/scripts/build-scene.ts +171 -0
  26. package/package.json +1 -1
@@ -0,0 +1,406 @@
1
+ ---
2
+ name: bevy
3
+ description: 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.
4
+ ---
5
+
6
+ # Bevy Game Development Skill
7
+
8
+ A specialized skill for developing games and applications using the Bevy game engine, based on real-world experience building complex Bevy projects.
9
+
10
+ ## When to Use This Skill
11
+
12
+ Invoke this skill when:
13
+ - Implementing features in a Bevy game or application
14
+ - Designing component architectures for ECS
15
+ - Creating or debugging Bevy systems
16
+ - Working with Bevy's UI system
17
+ - Building and testing Bevy projects
18
+ - Troubleshooting common Bevy issues
19
+ - Organizing project structure for Bevy applications
20
+
21
+ ## Before You Start: Essential Bevy Tips
22
+
23
+ ### ⚠️ Bevy 0.17 Breaking Changes
24
+
25
+ **If working with Bevy 0.17**, be aware of significant API changes:
26
+ - Material handles now wrapped in `MeshMaterial3d<T>` (not `Handle<T>`)
27
+ - Event system replaced with observer pattern (`commands.trigger()`, `add_observer()`)
28
+ - Color arithmetic operations removed (use component extraction)
29
+
30
+ **See `references/bevy_specific_tips.md` for complete Bevy 0.17 migration guide and examples.**
31
+
32
+ ### Consult Bevy Registry Examples First
33
+
34
+ **The registry examples are your bible.** Always check them before implementing new features.
35
+
36
+ **Location:**
37
+ ```bash
38
+ ~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy-0.17.1/examples
39
+ ```
40
+
41
+ There are MANY examples covering all aspects of Bevy development. Review relevant examples to understand best practices and working patterns.
42
+
43
+ ### Use Plugin Structure
44
+
45
+ Break your app into discrete modules using plugins. This improves organization and makes code discoverable.
46
+
47
+ ```rust
48
+ pub struct CombatPlugin;
49
+
50
+ impl Plugin for CombatPlugin {
51
+ fn build(&self, app: &mut App) {
52
+ app
53
+ .add_event::<DamageEvent>()
54
+ .add_systems(Update, (process_damage, check_death));
55
+ }
56
+ }
57
+ ```
58
+
59
+ See `references/bevy_specific_tips.md` for detailed plugin patterns and examples.
60
+
61
+ ### Design Before Coding
62
+
63
+ **Pure ECS demands careful data modeling.** It's hard to search a massive list of systems in one file!
64
+
65
+ Before implementing:
66
+ 1. Design the data model (entities, components, events, systems)
67
+ 2. Check Bevy examples for similar patterns
68
+ 3. Review docs and existing code
69
+ 4. Create a plugin for the feature domain
70
+
71
+ See `references/bevy_specific_tips.md` for domain-driven design guidance.
72
+
73
+ ## Core Development Principles
74
+
75
+ ### Think in ECS Terms
76
+
77
+ Bevy is an Entity Component System (ECS) engine. Always think in terms of **data** (components) and **transformations** (systems), not objects and methods.
78
+
79
+ **Separation of Concerns:**
80
+ - **Components** = Pure data, no logic
81
+ - **Systems** = Pure logic, operate on components
82
+ - **Events** = Communication between systems
83
+ - **Resources** = Global state (use sparingly)
84
+
85
+ ### Component-Driven Design
86
+
87
+ **Keep components focused:**
88
+ ```rust
89
+ // ✅ GOOD: Small, focused components
90
+ #[derive(Component)]
91
+ pub struct Health { pub current: f32, pub max: f32 }
92
+
93
+ #[derive(Component)]
94
+ pub struct Armor { pub defense: f32 }
95
+
96
+ // ❌ BAD: Monolithic component
97
+ #[derive(Component)]
98
+ pub struct CombatStats {
99
+ pub health: f32,
100
+ pub armor: f32,
101
+ pub strength: f32,
102
+ // ... wastes memory for entities that only have some stats
103
+ }
104
+ ```
105
+
106
+ **Add helper methods via impl blocks:**
107
+ ```rust
108
+ impl Health {
109
+ pub fn is_alive(&self) -> bool {
110
+ self.current > 0.0
111
+ }
112
+
113
+ pub fn percentage(&self) -> f32 {
114
+ self.current / self.max
115
+ }
116
+ }
117
+ ```
118
+
119
+ For detailed component patterns, see `references/ecs_patterns.md`.
120
+
121
+ ### System Design and Ordering
122
+
123
+ **Order systems by dependencies:**
124
+ ```rust
125
+ .add_systems(
126
+ Update,
127
+ (
128
+ // 1. Input processing
129
+ handle_input,
130
+
131
+ // 2. State changes
132
+ process_events,
133
+ update_state,
134
+
135
+ // 3. Derive properties from state
136
+ calculate_derived_values,
137
+
138
+ // 4. Visual updates
139
+ update_materials,
140
+ update_animations,
141
+
142
+ // 5. UI updates (must run last)
143
+ update_ui_displays,
144
+ ),
145
+ )
146
+ ```
147
+
148
+ **Use change detection to optimize:**
149
+ ```rust
150
+ // Only process entities where Health changed
151
+ pub fn update_health_bar(
152
+ query: Query<(&Health, &mut HealthBar), Changed<Health>>,
153
+ ) {
154
+ for (health, mut bar) in query.iter_mut() {
155
+ bar.width = health.percentage() * 100.0;
156
+ }
157
+ }
158
+ ```
159
+
160
+ For detailed query patterns and system design, see `references/ecs_patterns.md`.
161
+
162
+ ## Build and Testing Workflow
163
+
164
+ ### Build Commands
165
+
166
+ **Development (faster iteration):**
167
+ ```bash
168
+ cargo build --features bevy/dynamic_linking
169
+ ```
170
+ - Uses dynamic linking for faster compile times
171
+ - 2-3x faster than release builds
172
+ - Only use during development
173
+ - **CRITICAL:** Always use this for development builds
174
+
175
+ **Quick Check:**
176
+ ```bash
177
+ cargo check
178
+ ```
179
+ - Fastest way to verify compilation
180
+ - Use after every significant change
181
+
182
+ **Release (production):**
183
+ ```bash
184
+ cargo build --release
185
+ ```
186
+ - Full optimization
187
+ - Use for final testing and distribution
188
+
189
+ ### Build Management - CRITICAL
190
+
191
+ **DO NOT delete target binaries freely!** Bevy takes minutes to rebuild from scratch.
192
+
193
+ - Avoid `cargo clean` unless absolutely necessary
194
+ - Each clean rebuild costs valuable development time
195
+ - Be mindful of versions, targets, and crate dependencies getting tangled
196
+ - Bevy is under active development - stick to one version per project
197
+
198
+ See `references/bevy_specific_tips.md` for detailed build optimization and version management.
199
+
200
+ ### Testing Workflow
201
+
202
+ 1. **After component changes:** Run `cargo check`
203
+ 2. **After system changes:** Run `cargo check` then `cargo build --features bevy/dynamic_linking`
204
+ 3. **Manual testing:**
205
+ - Does the game launch?
206
+ - Do the new features work?
207
+ - Are console logs showing expected output?
208
+ - Do visual changes appear correctly?
209
+
210
+ **Validation points** - Let the user test at these milestones:
211
+ - New entity spawned
212
+ - New mechanic implemented
213
+ - Visual effects added
214
+ - Major system changes
215
+
216
+ ## UI Development in Bevy
217
+
218
+ Bevy uses a flexbox-like layout system. Follow the marker component pattern:
219
+
220
+ **1. Create marker components:**
221
+ ```rust
222
+ #[derive(Component)]
223
+ pub struct HealthBar;
224
+
225
+ #[derive(Component)]
226
+ pub struct ScoreDisplay;
227
+ ```
228
+
229
+ **2. Setup in Startup:**
230
+ ```rust
231
+ pub fn setup_ui(mut commands: Commands) {
232
+ commands.spawn((
233
+ HealthBar,
234
+ Node {
235
+ position_type: PositionType::Absolute,
236
+ left: Val::Px(10.0),
237
+ top: Val::Px(10.0),
238
+ width: Val::Px(200.0),
239
+ height: Val::Px(20.0),
240
+ ..default()
241
+ },
242
+ BackgroundColor(Color::srgba(0.8, 0.2, 0.2, 0.9)),
243
+ ));
244
+ }
245
+ ```
246
+
247
+ **3. Update in Update:**
248
+ ```rust
249
+ pub fn update_health_ui(
250
+ health: Query<&Health, With<Player>>,
251
+ mut ui: Query<&mut Node, With<HealthBar>>,
252
+ ) {
253
+ if let (Ok(health), Ok(mut node)) = (health.get_single(), ui.get_single_mut()) {
254
+ node.width = Val::Px(health.percentage() * 200.0);
255
+ }
256
+ }
257
+ ```
258
+
259
+ For detailed UI patterns including positioning, styling, and text updates, see `references/ui_development.md`.
260
+
261
+ ## Incremental Development Strategy
262
+
263
+ ### Phase-Based Development
264
+
265
+ Break features into phases:
266
+
267
+ **Phase 1: Foundation** - Core components and basic systems
268
+ **Phase 2: Content** - Add entities and populate world
269
+ **Phase 3: Polish** - UI improvements and visual effects
270
+ **Phase 4: Advanced Features** - Complex mechanics and AI
271
+
272
+ ### Iteration Pattern
273
+
274
+ ```
275
+ 1. Plan → 2. Implement → 3. Build → 4. Test → 5. Refine
276
+ ↑ ↓
277
+ ←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
278
+ ```
279
+
280
+ **Each phase should have:**
281
+ 1. Clear success criteria (checklist of what works)
282
+ 2. Manual test cases (step-by-step testing procedures)
283
+ 3. User validation points (when to let user test)
284
+
285
+ ## Performance Optimization
286
+
287
+ ### When to Optimize
288
+
289
+ **For prototypes (7-100 entities):**
290
+ - No optimization needed
291
+ - Change detection is sufficient
292
+ - Focus on features, not performance
293
+
294
+ **For production (100+ entities):**
295
+ - Use spatial partitioning for proximity queries
296
+ - Batch material updates
297
+ - Consider Fixed timestep for physics
298
+ - Profile before optimizing
299
+
300
+ ### Query Optimization Tips
301
+
302
+ 1. **Use change detection:** `Query<&Component, Changed<Component>>`
303
+ 2. **Filter early:** `Query<&A, (With<B>, Without<C>)>` instead of filtering in loops
304
+ 3. **Check resource changes:** Return early if resource hasn't changed
305
+
306
+ ## Common Pitfalls to Avoid
307
+
308
+ **Critical mistakes and their solutions are documented in `references/common_pitfalls.md`. Key pitfalls include:**
309
+
310
+ 1. Forgetting to register systems in `main.rs`
311
+ 2. Borrowing conflicts (use `get_many_mut` for multiple mutations)
312
+ 3. Not using `Changed<T>` for expensive operations
313
+ 4. Wrong system ordering (input → state → derived → visual → UI)
314
+ 5. Entity queries after despawn (use `if let Ok()` pattern)
315
+ 6. Material/asset handle confusion (store handles properly)
316
+
317
+ Review `references/common_pitfalls.md` before implementing complex features.
318
+
319
+ ## Using Subagents for Complex Features
320
+
321
+ When implementing multi-step features, use the plan-implementer subagent with this structure:
322
+
323
+ ```
324
+ Goal: [One sentence describing end state]
325
+
326
+ Current State: [What exists now]
327
+
328
+ Requirements: [Numbered list of what to build]
329
+
330
+ Implementation Steps: [Suggested approach]
331
+
332
+ Success Criteria: [How to verify it works]
333
+
334
+ Notes: [Important context, edge cases, design principles]
335
+ ```
336
+
337
+ **Example:**
338
+ ```
339
+ Implement Health System
340
+
341
+ Goal: Implement a health system with damage, healing, and death mechanics.
342
+
343
+ Current State:
344
+ - Player entity exists
345
+ - No health tracking yet
346
+
347
+ Requirements:
348
+ 1. Create Health component with current/max values
349
+ 2. Create DamageEvent for dealing damage
350
+ 3. Create system to process damage events
351
+ 4. Add death detection when health reaches 0
352
+ 5. Add visual health bar UI
353
+
354
+ Implementation Steps:
355
+ 1. Create Health component in src/components/properties.rs
356
+ 2. Create DamageEvent in src/events.rs
357
+ 3. Create process_damage system in src/systems/combat.rs
358
+ 4. Create check_death system
359
+ 5. Create health bar UI in src/systems/ui/health_bar.rs
360
+ 6. Register all systems in main.rs in correct order
361
+
362
+ Success Criteria:
363
+ - Player spawns with Health component
364
+ - Damage events reduce health
365
+ - Health bar updates when health changes
366
+ - Entity despawns when health reaches 0
367
+ - Code compiles without errors
368
+ ```
369
+
370
+ ## Project Structure Reference
371
+
372
+ For details on recommended file organization, module structure, and component file patterns, see `references/project_structure.md`.
373
+
374
+ ## References
375
+
376
+ This skill includes detailed reference documentation:
377
+
378
+ - `references/bevy_specific_tips.md` - **START HERE:** Registry examples, plugin structure, build optimization, version management, domain-driven design for ECS
379
+ - `references/ecs_patterns.md` - Component design patterns, query patterns, and common ECS design patterns (Derivation, State Machine, Threshold/Trigger, Event-Driven, Initialization)
380
+ - `references/ui_development.md` - Bevy UI hierarchy, component patterns, layout tips, positioning, styling, and text updates
381
+ - `references/common_pitfalls.md` - Common mistakes and their solutions (system registration, borrowing conflicts, change detection, system ordering, entity queries, asset handles)
382
+ - `references/project_structure.md` - Recommended file organization, module structure, component file patterns, and change detection
383
+
384
+ Load these references as needed to inform implementation decisions.
385
+
386
+ ## Additional Resources
387
+
388
+ **Bevy Documentation:**
389
+ - Official Bevy Book: https://bevyengine.org/learn/book/
390
+ - Bevy Examples: https://github.com/bevyengine/bevy/tree/main/examples (also in `~/.cargo/registry/...`)
391
+ - Bevy Cheat Book: https://bevy-cheatbook.github.io/
392
+ - Plugin Guide: https://bevy.org/learn/quick-start/getting-started/plugins/
393
+ - System Sets: https://bevy-cheatbook.github.io/programming/system-sets.html
394
+ - Setup & Optimization: https://bevy.org/learn/quick-start/getting-started/setup/
395
+
396
+ **ECS Design Principles:**
397
+ - Prefer composition over inheritance
398
+ - One component = one concern
399
+ - Systems should be pure functions
400
+ - Use events to decouple systems
401
+ - **Design data model before coding**
402
+ - **Check registry examples first**
403
+
404
+ ---
405
+
406
+ **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.