$npx -y skills add HLND2T/CS2_VibeSignatures --skill rename-preprocessor-scriptsRename a symbol (function, vfunc, vtable, struct member, global variable) across all preprocessor scripts, configs/<GAMEVER>.yaml entries, and existing YAML output files. Use when a symbol's name changes (class rename, naming-convention fix, etc.), or when splitting a single find
| 1 | # Rename Preprocessor Scripts |
| 2 | |
| 3 | Rename a symbol from `OldName` to `NewName` across all files in the preprocessor pipeline: |
| 4 | the Python script, `configs/<GAMEVER>.yaml`, and every per-gamever YAML output file under `bin/`. |
| 5 | |
| 6 | Resolve `GAMEVER` from the user's explicit request or `CS2VIBE_GAMEVER`; edit only |
| 7 | `configs/$GAMEVER.yaml` and stop if it is missing. |
| 8 | |
| 9 | ## When to Use |
| 10 | |
| 11 | - A symbol's name changes (e.g. class renamed from `ILoopType` to `CLoopTypeBase`) |
| 12 | - A naming-convention fix applies to one or more existing preprocessor scripts |
| 13 | - **Deinline-fix:** a single `find-X` finder must be split into an inline/noinline chain |
| 14 | because a helper that used to be inlined became a separate function (de-inlined) on some |
| 15 | build. This skill covers the `find-X-inlined` rename step (Step 1–3 below); the full |
| 16 | 3-skill chain recipe lives in |
| 17 | [create-preprocessor-scripts Pattern M](../create-preprocessor-scripts/references/pattern-M.md) |
| 18 | |
| 19 | ## Inputs |
| 20 | |
| 21 | | Field | Description | Example | |
| 22 | |-------|-------------|---------| |
| 23 | | **Old name** | Current symbol name to replace | `ILoopType_EngineLoop` | |
| 24 | | **New name** | New symbol name | `CLoopTypeBase_EngineLoop` | |
| 25 | | **Old class** (optional) | Old vtable class name, if applicable | `ILoopType` | |
| 26 | | **New class** (optional) | New vtable class name, if applicable | `CLoopTypeBase` | |
| 27 | |
| 28 | > If only the symbol suffix changes (e.g. `Foo_Bar` → `Foo_Baz`) and the vtable class stays |
| 29 | > the same, skip the class rename steps below. |
| 30 | |
| 31 | > **Multiple renames at once:** run all steps for every symbol in a single pass — batch the |
| 32 | > `sed` calls with multiple `-e` flags rather than doing separate passes per symbol. |
| 33 | |
| 34 | --- |
| 35 | |
| 36 | ## Step 1: Find All Affected Files |
| 37 | |
| 38 | Search for every occurrence of the old name across the entire repo: |
| 39 | |
| 40 | ```bash |
| 41 | grep -r "OldName" --include="*.py" --include="*.yaml" -l |
| 42 | ``` |
| 43 | |
| 44 | Expected hits fall into these categories: |
| 45 | |
| 46 | | File type | Path pattern | What changes | |
| 47 | |-----------|-------------|--------------| |
| 48 | | Preprocessor script | `ida_preprocessor_scripts/find-OldName.py` | File renamed + content updated | |
| 49 | | configs/<GAMEVER>.yaml | `configs/<GAMEVER>.yaml` | Skill name, `expected_output`, `skip_if_exists`, symbol `name` + `alias` | |
| 50 | | Output YAMLs | `bin/*/client\|engine/OldName.{platform}.yaml` | File renamed + `func_name` / `vtable_name` fields | |
| 51 | | Reference YAMLs | `ida_preprocessor_scripts/references/**/*.yaml` | File renamed (if named after symbol) or comment strings updated | |
| 52 | | Test files | `tests/*.py` | Fixture data, assertions, class/method names updated | |
| 53 | |
| 54 | Also check whether any **other** scripts list `OldName.{platform}.yaml` as an `expected_input` |
| 55 | (i.e. downstream dependents). If found, those scripts' `INHERIT_VFUNCS` / `LLM_DECOMPILE` / |
| 56 | `FUNC_XREFS` constants and their `configs/<GAMEVER>.yaml` `expected_input` entries must be updated too. |
| 57 | |
| 58 | --- |
| 59 | |
| 60 | ## Step 2: Rename the Preprocessor Script |
| 61 | |
| 62 | Use `git mv` to preserve history: |
| 63 | |
| 64 | ```bash |
| 65 | git mv ida_preprocessor_scripts/find-OldName.py \ |
| 66 | ida_preprocessor_scripts/find-NewName.py |
| 67 | ``` |
| 68 | |
| 69 | > **Compound script names:** scripts may bundle multiple symbols with `-AND-` separators |
| 70 | > (e.g. `find-IGameSystemFactory_Allocate-AND-IGameSystemFactory_DoesGameSystemReallocate-AND-IGameSystem_SetName.py`) |
| 71 | > or have an `-impl` suffix. Only rename the part that changed — leave unrelated symbol names |
| 72 | > and suffixes intact. |
| 73 | |
| 74 | --- |
| 75 | |
| 76 | ## Step 3: Update the Script Contents |
| 77 | |
| 78 | In the renamed `.py` file, replace every occurrence of the old symbol name and old class name: |
| 79 | |
| 80 | | Location | Old value | New value | |
| 81 | |----------|-----------|-----------| |
| 82 | | Module docstring | `find-OldName skill` | `find-NewName skill` | |
| 83 | | `INHERIT_VFUNCS` tuple (1st element) | `"OldName"` | `"NewName"` | |
| 84 | | `INHERIT_VFUNCS` tuple (2nd element, vtable class) | `"OldClass"` | `"NewClass"` | |
| 85 | | `GENERATE_YAML_DESIRED_FIELDS` key | `"OldName"` | `"NewName"` | |
| 86 | | `FUNC_XREFS` `func_name` field | `"OldName"` | `"NewName"` | |
| 87 | | `FUNC_VTABLE_RELATIONS` tuple (1st element) | `"OldName"` | `"NewName"` | |
| 88 | | `FUNC_VTABLE_RELATIONS` tuple (2nd element, vtable class) | `"OldClass"` | `"NewClass"` | |
| 89 | | `LLM_DECOMPILE` target `name` field | `"OldName"` | `"NewName"` | |
| 90 | | `TARGET_FUNCTION_NAMES` / `TARGET_STRUCT_MEMBER_NAMES` | `"OldName"` | `"NewName"` | |
| 91 | |
| 92 | Only touch fields that are actually present in the script; skip inapplicable rows. |
| 93 | |
| 94 | --- |
| 95 | |
| 96 | ## Step 4: Update configs/<GAMEVER>.yaml |
| 97 | |
| 98 | Four locations may need editing. Use a single `sed` invocation with multiple `-e` flags to |
| 99 | handle both the `_` symbol name and th |