$npx -y skills add thedivergentai/GD-Agentic-Skills --skill godot-genre-sportsExpert blueprint for sports games (FIFA, NBA 2K, Rocket League, Tony Hawk) covering physics-based ball interaction, team AI formations, contextual input, and broadcast camera systems. Use when building soccer, basketball, hockey, racing sports, or arcade sports games. Keywords ba
| 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: Sports |
| 8 | |
| 9 | ## NEVER Do (Expert Anti-Patterns) |
| 10 | |
| 11 | ### Physics & Ball Interaction |
| 12 | - NEVER parent the ball directly to a player Transform; strictly keep it a standalone `RigidBody3D` and use `apply_central_impulse()` for **realistic dribble physics**. |
| 13 | - NEVER allow the ball to "Tunnel" through goals; strictly enable **Continuous CD** (`continuous_cd = true`) on the ball's properties for high-velocity validation. |
| 14 | - NEVER scale a `CollisionShape3D` non-uniformly; strictly adjust the resource radius to preserve the internal **moment of inertia**. |
| 15 | - NEVER apply impulses in `_process()`; strictly use `_physics_process()` or `_integrate_forces()` to prevent visual jitter. |
| 16 | - NEVER use a single collision shape for characters; strictly use **layered shapes** for Head, Torso, and Legs to enable headers and chest-traps. |
| 17 | |
| 18 | ### Match & Team AI |
| 19 | - NEVER allow all AI to chase the ball ("Kindergarten Soccer"); strictly implement **Formation Slots** (Defense/Attack) where only the closest 1-2 players engage. |
| 20 | - NEVER use perfect goalkeeper reflexes; strictly add a **Reaction Delay** (0.2s-0.5s) and an "Error Rate" based on shot angle and velocity. |
| 21 | - NEVER ignore **Root Motion** for movement; strictly use `AnimationTree` with root motion to ensure momentum and turns are visually grounded. |
| 22 | - NEVER trust client-side goal validations; strictly require the **Authoritative Server** to validate physics and score logic. |
| 23 | |
| 24 | ### Implementation & Sync |
| 25 | - NEVER rely on the default physics tick rate (60 TPS) for fast-moving ballistics; strictly increase **physics_ticks_per_second** (e.g., to 120 or 240) to prevent tunneling. |
| 26 | - NEVER leave **Physics Interpolation** disabled if you want broadcast-quality smoothness; enable it in Project Settings to smooth ball transforms between ticks on high-refresh monitors. |
| 27 | - NEVER parent the ball directly to a player Transform; strictly keep it a standalone `RigidBody3D` and use `apply_central_impulse()` for **realistic dribble physics**. |
| 28 | - NEVER skip **vector normalization** on joystick input; strictly normalize to prevent diagonal movement from being 1.4x faster. |
| 29 | - NEVER handle contextual buttons with `is_action_pressed()`; strictly use a **ContextManager** to determine if Button A means "Pass", "Tackle", or "Switch". |
| 30 | - NEVER evaluate an `Area3D` goal trigger immediately; strictly `await get_tree().physics_frame` to allow the Physics Server to sync. |
| 31 | |
| 32 | --- |
| 33 | |
| 34 | ## 🛠 Expert Components (scripts/) |
| 35 | |
| 36 | ### Original Expert Patterns |
| 37 | - [sports_ball_physics.gd](scripts/sports_ball_physics.gd) - High-fidelity Magnus effect and air drag model for ball-centric sports. |
| 38 | - [team_manager.gd](scripts/team_manager.gd) - Macro-behavior manager implementing Formation Slots and team strategy switching. |
| 39 | |
| 40 | ### Modular Components |
| 41 | - [sports_patterns.gd](scripts/sports_patterns.gd) - Collection of utilities for physics-safe impulses and authoritative scoring. |
| 42 | |
| 43 | --- |
| 44 | |
| 45 | ## Skill Chain |
| 46 | |
| 47 | | Phase | Skills | Purpose | |
| 48 | |-------|--------|---------| |
| 49 | | 1. Physics | `physics-bodies`, `vehicle-wheel-3d` | Ball bounce, friction, player collisions | |
| 50 | | 2. AI | `steering-behaviors`, `godot-state-machine-advanced` | Formations, marking, flocking | |
| 51 | | 3. Anim | `godot-animation-tree-mastery` | Blended running, shooting, tackling | |
| 52 | | 4. Input | `input-mapping` | Contextual buttons (Pass/Tackle share button) | |
| 53 | | 5. Camera | `godot-camera-systems` | Dynamic broadcast view, zooming on action | |
| 54 | |
| 55 | ## Architecture Overview |
| 56 | |
| 57 | ### 1. The Ball (Physics Core) |
| 58 | The most important object. Must feel right. |
| 59 | |
| 60 | ```gdscript |
| 61 | # ball.gd |
| 62 | extends RigidBody3D |
| 63 | |
| 64 | @export var drag_coefficient: float = 0.5 |
| 65 | @export var magnus_effect_strength: float = 2.0 |
| 66 | |
| 67 | func _integrate_forces(state: PhysicsDirectBodyState3D) -> void: |
| 68 | # Apply Air Drag |
| 69 | var velocity = state.linear_velocity |
| 70 | var speed = velocity.length() |
| 71 | var drag_force = -velocity.normalized() * (drag_coefficient * speed * speed) |
| 72 | state.apply_central_force(drag_force) |
| 73 | |
| 74 | # Magnus Effect (Curve) |
| 75 | var spin = state.angular_velocity |
| 76 | var magnus_force = spin.cross(velocity) * magnus_effect_strength |
| 77 | state.apply_central_force(magnus_force) |
| 78 | ``` |
| 79 | |
| 80 | ### 2. Team AI (Formations) |
| 81 | AI players don't just run at the ball. They r |