# mengyangx/praclab architecture

> Architecture diagram of the GitHub repository mengyangx/praclab, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mengyangx/praclab
- Repository: https://github.com/mengyangx/praclab

## Overview

PracLab is a Counter-Strike 2 practice plugin whose player-facing workflow is issuing practice commands and receiving in-game training or replay results. Its documented capabilities span map and practice controls, grenade search and rethrows, spawn tools, bots, dry-run configuration, and a real-time HUD. An optional Metamod C++ replay engine records movement and plays it back through bots. The excerpts show HUD calculations and parts of replay internals; links between unsampled subsystems are limited to README-documented relationships or omitted where call ownership is unclear.

Main entry points: [`PracLab.cs`](https://github.com/mengyangx/praclab/blob/main/PracLab.cs) (Plugin Core), [`Commands/PracticeHud/PracticeHudSession.cs`](https://github.com/mengyangx/praclab/blob/main/Commands/PracticeHud/PracticeHudSession.cs) (HUD Session), [`Commands/Replay/ReplayCommands.cs`](https://github.com/mengyangx/praclab/blob/main/Commands/Replay/ReplayCommands.cs) (Replay Commands), [`Commands/PracticeHud/CustomHudManager.cs`](https://github.com/mengyangx/praclab/blob/main/Commands/PracticeHud/CustomHudManager.cs) (HUD Display)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["Practice Commands"]
  node_praclab["Plugin Core<br/>[PracLab.cs]"]
  node_practice["Practice Controls"]
  node_dryrun["Dry-run Mode<br/>[DryRunCommands.cs]"]
  node_bot_tools["Bot Commands<br/>[BotCommands.cs]"]
end

subgraph group_nade_spawn["Grenade And Spawn"]
  node_grenade["Grenade Tools<br/>[GrenadeCommands.cs]"]
  node_nade_search["Grenade Search"]
  node_nade_draw["Grenade Visualization"]
  node_spawn["Spawn Tools<br/>[SpawnCommands.cs]"]
  node_spawn_marker["Spawn Markers"]
end

subgraph group_hud["Practice HUD"]
  node_hud_commands["HUD Commands"]
  node_hud_session["HUD Session"]
  node_hud_manager["HUD Display"]
  node_strafe["Counter-strafe"]
  node_shot["Shot Stability"]
  node_sync["Air Sync<br/>[AirSyncEngine.cs]"]
  node_recoil["Spray Trace"]
  node_hud_config["HUD Configuration"]
end

subgraph group_replay["Replay Engine"]
  node_replay_commands["Replay Commands<br/>[ReplayCommands.cs]"]
  node_motion["Motion Recorder<br/>[MotionRecorder.cpp]"]
  node_bot_controller["Bot Controller<br/>[BotController.cpp]"]
  node_buy_controller["Bot Buy Control<br/>[BuyController.cpp]"]
  node_replay_plugin["Metamod Plugin<br/>[plugin.cpp]"]
end

node_player(("Player"))

node_player -->|"issues commands"| node_praclab
node_praclab -->|"offers practice tools"| node_practice
node_praclab -->|"offers dry-run"| node_dryrun
node_praclab -->|"offers bot tools"| node_bot_tools
node_praclab -->|"offers rethrows"| node_grenade
node_praclab -->|"offers inverse search"| node_nade_search
node_praclab -->|"offers teleports"| node_spawn
node_praclab -->|"offers visualization"| node_spawn_marker
node_player -->|"requests feedback"| node_hud_commands
node_hud_session -->|"uses evaluator"| node_strafe
node_hud_session -->|"uses evaluator"| node_shot
node_hud_session -->|"uses evaluator"| node_sync
node_hud_session -->|"uses evaluator"| node_recoil
node_hud_manager -->|"manages sessions"| node_hud_session
node_player -->|"requests playback"| node_replay_commands
node_replay_commands -.->|"uses optional engine"| node_replay_plugin
node_motion -.->|"coordinates playback"| node_bot_controller

click node_praclab "https://github.com/mengyangx/praclab/blob/main/PracLab.cs"
click node_practice "https://github.com/mengyangx/praclab/blob/main/Commands/PracticeCommands.cs"
click node_dryrun "https://github.com/mengyangx/praclab/blob/main/Commands/DryRunCommands.cs"
click node_bot_tools "https://github.com/mengyangx/praclab/blob/main/Commands/Bots/BotCommands.cs"
click node_grenade "https://github.com/mengyangx/praclab/blob/main/Commands/Nade/GrenadeCommands.cs"
click node_nade_search "https://github.com/mengyangx/praclab/blob/main/Commands/Nade/NadeSearchCommands.cs"
click node_nade_draw "https://github.com/mengyangx/praclab/blob/main/Commands/Nade/NadeDrawCommands.cs"
click node_spawn "https://github.com/mengyangx/praclab/blob/main/Commands/Spawns/SpawnCommands.cs"
click node_spawn_marker "https://github.com/mengyangx/praclab/blob/main/Commands/Spawns/SpawnMarkerCommands.cs"
click node_hud_commands "https://github.com/mengyangx/praclab/blob/main/Commands/PracticeHud/PracticeHudCommands.cs"
click node_hud_session "https://github.com/mengyangx/praclab/blob/main/Commands/PracticeHud/PracticeHudSession.cs"
click node_hud_manager "https://github.com/mengyangx/praclab/blob/main/Commands/PracticeHud/CustomHudManager.cs"
click node_strafe "https://github.com/mengyangx/praclab/blob/main/Commands/PracticeHud/CounterStrafeEngine.cs"
click node_shot "https://github.com/mengyangx/praclab/blob/main/Commands/PracticeHud/ShotStabilityEngine.cs"
click node_sync "https://github.com/mengyangx/praclab/blob/main/Commands/PracticeHud/AirSyncEngine.cs"
click node_recoil "https://github.com/mengyangx/praclab/blob/main/Commands/PracticeHud/RecoilTraceEngine.cs"
click node_hud_config "https://github.com/mengyangx/praclab/blob/main/Commands/PracticeHud/PracticeHudConfig.cs"
click node_replay_commands "https://github.com/mengyangx/praclab/blob/main/Commands/Replay/ReplayCommands.cs"
click node_motion "https://github.com/mengyangx/praclab/blob/main/replay-engine/src/features/recorder/MotionRecorder.cpp"
click node_bot_controller "https://github.com/mengyangx/praclab/blob/main/replay-engine/src/features/controller/BotController.cpp"
click node_buy_controller "https://github.com/mengyangx/praclab/blob/main/replay-engine/src/features/buy/BuyController.cpp"
click node_replay_plugin "https://github.com/mengyangx/praclab/blob/main/replay-engine/src/plugin.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_praclab,node_practice,node_dryrun,node_bot_tools toneBlue
class node_grenade,node_nade_search,node_nade_draw,node_spawn,node_spawn_marker toneAmber
class node_hud_commands,node_hud_session,node_hud_manager,node_strafe,node_shot,node_sync,node_recoil,node_hud_config toneMint
class node_replay_commands,node_motion,node_bot_controller,node_buy_controller,node_replay_plugin toneRose
class node_player toneIndigo
```

## Components

### Practice Commands

- [Plugin Core](https://github.com/mengyangx/praclab/blob/main/PracLab.cs): `PracLab.cs`
- [Practice Controls](https://github.com/mengyangx/praclab/blob/main/Commands/PracticeCommands.cs): `Commands/PracticeCommands.cs`
- [Dry-run Mode](https://github.com/mengyangx/praclab/blob/main/Commands/DryRunCommands.cs): `Commands/DryRunCommands.cs`
- [Bot Commands](https://github.com/mengyangx/praclab/blob/main/Commands/Bots/BotCommands.cs): `Commands/Bots/BotCommands.cs`

### Grenade And Spawn

- [Grenade Tools](https://github.com/mengyangx/praclab/blob/main/Commands/Nade/GrenadeCommands.cs): `Commands/Nade/GrenadeCommands.cs`
- [Grenade Search](https://github.com/mengyangx/praclab/blob/main/Commands/Nade/NadeSearchCommands.cs): `Commands/Nade/NadeSearchCommands.cs`
- [Grenade Visualization](https://github.com/mengyangx/praclab/blob/main/Commands/Nade/NadeDrawCommands.cs): `Commands/Nade/NadeDrawCommands.cs`
- [Spawn Tools](https://github.com/mengyangx/praclab/blob/main/Commands/Spawns/SpawnCommands.cs): `Commands/Spawns/SpawnCommands.cs`
- [Spawn Markers](https://github.com/mengyangx/praclab/blob/main/Commands/Spawns/SpawnMarkerCommands.cs): `Commands/Spawns/SpawnMarkerCommands.cs`

### Practice HUD

- [HUD Commands](https://github.com/mengyangx/praclab/blob/main/Commands/PracticeHud/PracticeHudCommands.cs): `Commands/PracticeHud/PracticeHudCommands.cs`
- [HUD Session](https://github.com/mengyangx/praclab/blob/main/Commands/PracticeHud/PracticeHudSession.cs): `Commands/PracticeHud/PracticeHudSession.cs`
- [HUD Display](https://github.com/mengyangx/praclab/blob/main/Commands/PracticeHud/CustomHudManager.cs): `Commands/PracticeHud/CustomHudManager.cs`
- [Counter-strafe](https://github.com/mengyangx/praclab/blob/main/Commands/PracticeHud/CounterStrafeEngine.cs): `Commands/PracticeHud/CounterStrafeEngine.cs`
- [Shot Stability](https://github.com/mengyangx/praclab/blob/main/Commands/PracticeHud/ShotStabilityEngine.cs): `Commands/PracticeHud/ShotStabilityEngine.cs`
- [Air Sync](https://github.com/mengyangx/praclab/blob/main/Commands/PracticeHud/AirSyncEngine.cs): `Commands/PracticeHud/AirSyncEngine.cs`
- [Spray Trace](https://github.com/mengyangx/praclab/blob/main/Commands/PracticeHud/RecoilTraceEngine.cs): `Commands/PracticeHud/RecoilTraceEngine.cs`
- [HUD Configuration](https://github.com/mengyangx/praclab/blob/main/Commands/PracticeHud/PracticeHudConfig.cs): `Commands/PracticeHud/PracticeHudConfig.cs`

### Replay Engine

- [Replay Commands](https://github.com/mengyangx/praclab/blob/main/Commands/Replay/ReplayCommands.cs): `Commands/Replay/ReplayCommands.cs`
- [Motion Recorder](https://github.com/mengyangx/praclab/blob/main/replay-engine/src/features/recorder/MotionRecorder.cpp): `replay-engine/src/features/recorder/MotionRecorder.cpp`
- [Bot Controller](https://github.com/mengyangx/praclab/blob/main/replay-engine/src/features/controller/BotController.cpp): `replay-engine/src/features/controller/BotController.cpp`
- [Bot Buy Control](https://github.com/mengyangx/praclab/blob/main/replay-engine/src/features/buy/BuyController.cpp): `replay-engine/src/features/buy/BuyController.cpp`
- [Metamod Plugin](https://github.com/mengyangx/praclab/blob/main/replay-engine/src/plugin.cpp): `replay-engine/src/plugin.cpp`

### Other components

- **Player**

## Connections

- Player → Plugin Core: issues commands (evidence: `README.md`)
- Plugin Core → Practice Controls: offers practice tools (evidence: `README.md`)
- Plugin Core → Dry-run Mode: offers dry-run (evidence: `README.md`)
- Plugin Core → Bot Commands: offers bot tools (evidence: `README.md`)
- Plugin Core → Grenade Tools: offers rethrows (evidence: `README.md`)
- Plugin Core → Grenade Search: offers inverse search (evidence: `README.md`)
- Plugin Core → Spawn Tools: offers teleports (evidence: `README.md`)
- Plugin Core → Spawn Markers: offers visualization (evidence: `README.md`)
- Player → HUD Commands: requests feedback (evidence: `README.md`)
- HUD Session → Counter-strafe: uses evaluator (evidence: `Commands/PracticeHud/PracticeHudSession.cs`)
- HUD Session → Shot Stability: uses evaluator (evidence: `Commands/PracticeHud/PracticeHudSession.cs`)
- HUD Session → Air Sync: uses evaluator (evidence: `Commands/PracticeHud/PracticeHudSession.cs`)
- HUD Session → Spray Trace: uses evaluator (evidence: `Commands/PracticeHud/PracticeHudSession.cs`)
- HUD Display → HUD Session: manages sessions (evidence: `Commands/PracticeHud/CustomHudManager.cs`)
- Player → Replay Commands: requests playback (evidence: `README.md`)
- Replay Commands → Metamod Plugin: uses optional engine (evidence: `README.md`)
- Motion Recorder → Bot Controller: coordinates playback
