$npx -y skills add thedivergentai/GD-Agentic-Skills --skill godot-genre-rhythmExpert blueprint for rhythm games including audio synchronization (BPM conductor, latency compensation with AudioServer.get_time_since_last_mix), note highways (scroll speed, timing windows), judgment systems (Perfect/Great/Good/Bad/Miss), scoring with combo multipliers, input pr
| 1 | ## Godot 4.7 Baseline |
| 2 | |
| 3 | - Expert patterns in this skill target **Godot 4.7+** (stable, 2026-06-18). |
| 4 | - Consult the [Godot 4.7 migration guide](https://docs.godotengine.org/en/4.7/tutorials/migrating/upgrading_to_godot_4.7.html) when upgrading projects from 4.6. |
| 5 | - **NEVER** assume 4.6 defaults (stretch mode, audio area_mask, RichTextLabel percent flags) without checking 4.7 migration notes. |
| 6 | |
| 7 | # Genre: Rhythm |
| 8 | |
| 9 | Expert blueprint for rhythm games emphasizing audio-visual synchronization and flow state. |
| 10 | |
| 11 | ## NEVER Do (Expert Anti-Patterns) |
| 12 | |
| 13 | ### Audio Sync & Logic |
| 14 | - NEVER use `Time.get_ticks_msec()` for rhythm sync; strictly use **`AudioServer.get_time_since_last_mix()`** combined with latency offsets for sub-frame accuracy. |
| 15 | - NEVER process song logic in `_process()`; strictly use **`_physics_process()`** or a conductor loop to ensure deterministic timing regardless of render frames. |
| 16 | - NEVER use `_process()` to capture hit inputs; strictly use **`_input(event)`** to record the exact timestamp of the button press event. |
| 17 | - NEVER scale engine time_scale for song speed; strictly use **`AudioStreamPlayer.pitch_scale`** to adjust speed and avoid globally breaking physics logic. |
| 18 | - NEVER neglect **Audio Latency** calibration; strictly provide a tool for players to adjust for hardware/Bluetooth delays (~30-100ms) to prevent "unplayable" sync issues. |
| 19 | - NEVER use standard `_process` delta for note-to-audio sync; strictly use the **Hardware Clock** via `AudioServer.get_playback_position() + AudioServer.get_time_since_last_mix()` for sub-frame accuracy. |
| 20 | - NEVER move thousands of note sprites on the CPU; strictly use a **Shader-Based Highway** (UV scrolling) to offload track movement to the GPU. |
| 21 | - NEVER use `yield` or `await` for beat timing; strictly use a sample-accurate **Delta Accumulator** tied to the audio clock. |
| 22 | - NEVER assume a constant BPM; strictly build your conductor to handle a **Tempo Map** for complex track changes. |
| 23 | |
| 24 | ### Feedback & Performance |
| 25 | - NEVER judge inputs based on world position (pixels); strictly judge against the **Song's Elapsed Time (ms)** to ensure consistency across resolutions. |
| 26 | - NEVER play hit sounds with static pitch; strictly add **±5% Random Pitch Variation** to hit sounds to avoid the "machine gun" effect. |
| 27 | - NEVER use tight timing windows (e.g., <25ms) for all players; strictly use **Wider Windows for Beginners** to prevent immediate frustration. |
| 28 | - NEVER instantiate note nodes every beat; strictly use **Object Pooling** to recycle note instances and prevent GC spikes during dense tracks. |
| 29 | - NEVER use standard Area2D signals for rhythmic hits; strictly **Poll Inputs** in the conductor loop to compare against target timestamps. |
| 30 | - NEVER calculate FFT for visualization on the main thread; strictly use **AudioEffectSpectrumAnalyzerInstance** for optimized engine-side analysis. |
| 31 | - NEVER allow note spamming/mashing; strictly penalize misses or break combos to maintain the game's integrity. |
| 32 | - NEVER use `load()` dynamically during gameplay; strictly use **ResourceLoader.load_threaded_request()** to avoid thread stalling. |
| 33 | - NEVER forget to pause the conductor/ highway; strictly sync with the audio player's pause state to prevent notes from scrolling while the music is stopped. |
| 34 | |
| 35 | --- |
| 36 | |
| 37 | ## 🛠 Expert Components (scripts/) |
| 38 | |
| 39 | ### Original Expert Patterns |
| 40 | - [rhythm_conductor.gd](scripts/rhythm_conductor.gd) - High-precision BPM/beat tracker with latency compensation logic. |
| 41 | |
| 42 | ### Modular Components |
| 43 | - [input_judge_logic.gd](scripts/input_judge_logic.gd) - Hit-window validation (Perfect/Good/Miss). |
| 44 | - [latency_calibrator.gd](scripts/latency_calibrator.gd) - A/V offset measurement utility. |
| 45 | - [note_object_pool.gd](scripts/note_object_pool.gd) - High-frequency recycling for dense highways. |
| 46 | - [audio_spectrum_analyzer.gd](scripts/audio_spectrum_analyzer.gd) - Optimized engine-side frequency extraction. |
| 47 | - [dynamic_bpm_handler.gd](scripts/dynamic_bpm_handler.gd) - Tempo map and fractional beat support. |
| 48 | - [note_lane_manager.gd](scripts/note_lane_manager.gd) - Spawning routes and variable scroll speed control. |
| 49 | |
| 50 | --- |
| 51 | |
| 52 | ## Core Loop |
| 53 | |
| 54 | `Music Plays → Notes Appear → Player Inputs → Timing Judged → Score/Feedback → Combo Builds` |
| 55 | |
| 56 | ## Skill Chain |
| 57 | |
| 58 | `godot-project-foundations`, `godot-input-handling`, `sound-manager`, `animation`, `ui-framework` |
| 59 | |
| 60 | --- |
| 61 | |
| 62 | ## Audio Synchronization |
| 63 | |
| 64 | **THE most critical aspect** - notes MUST align perfectly with audio. |
| 65 | |
| 66 | ### Music Time System |
| 67 | |
| 68 | ```gdscript |
| 69 | class_na |