$npx -y skills add HLND2T/CS2_VibeSignatures --skill fix-cppheadersUse when hl2sdk_cs2 C++ headers must be repaired to match the latest vtable or record-layout YAML references. Runs run_cpp_tests.py to obtain layout diffs, maps failing cpp_tests entries to their configured headers, edits only those headers, and repeats validation until the diffe
| 1 | # Fix C++ Headers |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Repair `hl2sdk_cs2` declarations from compiler-versus-YAML layout differences. Treat |
| 6 | `run_cpp_tests.py` as the source of truth for both the initial diff and final verification. |
| 7 | |
| 8 | Resolve `GAMEVER` from the user's explicit request or `CS2VIBE_GAMEVER`; use only |
| 9 | `configs/$GAMEVER.yaml` for test definitions and fail if it is missing. |
| 10 | |
| 11 | ## Constraints |
| 12 | |
| 13 | - Edit only header paths listed in the failing `configs/<GAMEVER>.yaml` `cpp_tests` entry. |
| 14 | - Require every edited header to be under `hl2sdk_cs2/`. |
| 15 | - Preserve existing names and style when the reference exposes only a slot or offset. |
| 16 | - Keep compiler declarations for gaps in incomplete reference YAMLs unless surrounding index shifts prove removal. |
| 17 | - Name unknown virtual slots consistently with nearby declarations, such as `unk_001`; when only a known function name is |
| 18 | available, use `virtual void FunctionName() = 0;` until a reliable prototype is known. |
| 19 | - Interpret `Class_dtor` and `Class_vdtor` reference entries as virtual destructors for `Class`. |
| 20 | - Do not edit reference YAMLs, generated files under `bin/`, cpp test sources, or comparison code to hide a difference. |
| 21 | - Do not invoke an external agent runner. This SKILL owns the repair loop directly. |
| 22 | - Stop and report a blocker when the diff is ambiguous, the configured header is missing, or a required edit is outside |
| 23 | `hl2sdk_cs2/`. |
| 24 | |
| 25 | ## Workflow |
| 26 | |
| 27 | 1. Determine the game version from the user's request. If omitted, read `CS2VIBE_GAMEVER` from `.env`. |
| 28 | 2. Resolve the immutable symbol snapshot. Use a caller-provided actual candidate when available; otherwise use the |
| 29 | published historical snapshot at `gamesymbols/<gamever>.yaml`. Never read reference YAML directly from `bin`. |
| 30 | 3. Run the complete comparison with debug details: |
| 31 | |
| 32 | ```powershell |
| 33 | uv run run_cpp_tests.py -gamever <gamever> -configyaml configs/<gamever>.yaml -snapshot <snapshot> -debug |
| 34 | ``` |
| 35 | |
| 36 | 4. For each test reporting layout differences, find its `cpp_tests` entry in `configs/<GAMEVER>.yaml` and read its `symbol`, |
| 37 | `headers`, target, aliases, and reference modules. |
| 38 | 5. Read the configured headers and the complete diff sections: |
| 39 | - `Current vtable entries` versus `YAML reference vtable entries` |
| 40 | - `Current record members` versus `YAML reference struct members` |
| 41 | 6. Make the smallest declaration-only edit that aligns the header with the reference. Typical edits are reordering, |
| 42 | adding, or removing virtual declarations; correcting inheritance; and adjusting record members or padding. |
| 43 | 7. Re-run the same command with the same snapshot. If differences remain, use the new output rather than the previous |
| 44 | diff and repeat. |
| 45 | 8. Finish only when the command exits successfully with zero compile failures, invalid items, and layout differences. |
| 46 | |
| 47 | ## Failure Handling |
| 48 | |
| 49 | - If compilation fails after an edit, inspect the compiler error, repair the edited declaration, and rerun. |
| 50 | - If unrelated pre-existing failures prevent a clean full run, verify the affected test output as far as the runner permits |
| 51 | and report the unrelated failures verbatim. |
| 52 | - If `headers` is absent or empty, do not guess an edit target. Report the test name and request a config correction. |
| 53 | - If multiple headers are configured, trace the declared symbol before choosing the file; do not edit every header blindly. |
| 54 | |
| 55 | ## Completion Report |
| 56 | |
| 57 | Report the headers changed, the layout mismatches corrected, and the exact final verification command and result. |