| name | rename-preprocessor-scripts |
| description | Rename 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 finder into an inline/noinline fallback chain because a helper
de-inlined and the target's YAML stopped being produced on some gamever/platform.
|
| disable-model-invocation | true |
Rename Preprocessor Scripts
Rename a symbol from OldName to NewName across all files in the preprocessor pipeline:
the Python script, configs/<GAMEVER>.yaml, and every per-gamever YAML output file under bin/.
Resolve GAMEVER from the user's explicit request or CS2VIBE_GAMEVER; edit only
configs/$GAMEVER.yaml and stop if it is missing.
When to Use
- A symbol's name changes (e.g. class renamed from
ILoopType to CLoopTypeBase)
- A naming-convention fix applies to one or more existing preprocessor scripts
- Deinline-fix: a single
find-X finder must be split into an inline/noinline chain
because a helper that used to be inlined became a separate function (de-inlined) on some
build. This skill covers the find-X-inlined rename step (Step 1–3 below); the full
3-skill chain recipe lives in
create-preprocessor-scripts Pattern M
Inputs
| Field | Description | Example |
|---|
| Old name | Current symbol name to replace | ILoopType_EngineLoop |
| New name | New symbol name | CLoopTypeBase_EngineLoop |
| Old class (optional) | Old vtable class name, if applicable | ILoopType |
| New class (optional) | New vtable class name, if applicable | CLoopTypeBase |
If only the symbol suffix changes (e.g. Foo_Bar → Foo_Baz) and the vtable class stays
the same, skip the class rename steps below.
Multiple renames at once: run all steps for every symbol in a single pass — batch the
sed calls with multiple -e flags rather than doing separate passes per symbol.
Step 1: Find All Affected Files
Search for every occurrence of the old name across the entire repo:
grep -r "OldName" --include="*.py" --include="*.yaml" -l
Expected hits fall into these categories:
| File type | Path pattern | What changes |
|---|
| Preprocessor script | ida_preprocessor_scripts/find-OldName.py | File renamed + content updated |
| configs/.yaml | configs/<GAMEVER>.yaml | Skill name, expected_output, skip_if_exists, symbol name + alias |
| Output YAMLs | bin/*/client|engine/OldName.{platform}.yaml | File renamed + func_name / vtable_name fields |
| Reference YAMLs | ida_preprocessor_scripts/references/**/*.yaml | File renamed (if named after symbol) or comment strings updated |
| Test files | tests/*.py | Fixture data, assertions, class/method names updated |
Also check whether any other scripts list OldName.{platform}.yaml as an expected_input
(i.e. downstream dependents). If found, those scripts' INHERIT_VFUNCS / LLM_DECOMPILE /
FUNC_XREFS constants and their configs/<GAMEVER>.yaml expected_input entries must be updated too.
Step 2: Rename the Preprocessor Script
Use git mv to preserve history:
git mv ida_preprocessor_scripts/find-OldName.py \
ida_preprocessor_scripts/find-NewName.py
Compound script names: scripts may bundle multiple symbols with -AND- separators
(e.g. find-IGameSystemFactory_Allocate-AND-IGameSystemFactory_DoesGameSystemReallocate-AND-IGameSystem_SetName.py)
or have an -impl suffix. Only rename the part that changed — leave unrelated symbol names
and suffixes intact.
Step 3: Update the Script Contents
In the renamed .py file, replace every occurrence of the old symbol name and old class name:
| Location | Old value | New value |
|---|
| Module docstring | find-OldName skill | find-NewName skill |
INHERIT_VFUNCS tuple (1st element) | "OldName" | "NewName" |
INHERIT_VFUNCS tuple (2nd element, vtable class) | "OldClass" | "NewClass" |
GENERATE_YAML_DESIRED_FIELDS key | "OldName" | "NewName" |
FUNC_XREFS func_name field | "OldName" | "NewName" |
FUNC_VTABLE_RELATIONS tuple (1st element) | "OldName" | "NewName" |
FUNC_VTABLE_RELATIONS tuple (2nd element, vtable class) | "OldClass" | "NewClass" |
LLM_DECOMPILE target name field | "OldName" | "NewName" |
TARGET_FUNCTION_NAMES / TARGET_STRUCT_MEMBER_NAMES | "OldName" | "NewName" |
Only touch fields that are actually present in the script; skip inapplicable rows.
Step 4: Update configs/.yaml
Four locations may need editing. Use a single sed invocation with multiple -e flags to
handle both the _ symbol name and the :: alias form in one pass:
sed -i \
-e 's/OldName/NewName/g' \
-e 's/OldClass::OldMethodSuffix/NewClass::NewMethodSuffix/g' \
configs/<GAMEVER>.yaml
The alias field uses :: notation (IGameSystemFactory::Allocate), which a plain
s/OldName/NewName/ will not match because the symbol name uses _ separators.
Always add a separate -e expression for the alias form when the method suffix changes.
4a. Skill entry (under skills:)
- name: find-OldName
expected_output:
- OldName.{platform}.yaml
- name: find-NewName
expected_output:
- NewName.{platform}.yaml
expected_input entries are only changed if they reference OldName.{platform}.yaml directly.
4b. Symbol entry (under symbols:)
- name: OldName
category: vfunc
alias:
- OldClass::OldMethodSuffix
- name: NewName
category: vfunc
alias:
- NewClass::NewMethodSuffix
4c. Downstream expected_input entries (if any)
If any other skill lists OldName.{platform}.yaml as an expected_input, update those entries
to NewName.{platform}.yaml.
4d. skip_if_exists entries (if any)
If any skill has skip_if_exists: - OldName.{platform}.yaml, update to NewName.{platform}.yaml.
Step 5: Rename and Update Output YAML Files
The output YAMLs under bin/ are not tracked by git, so use regular mv.
Adjust the subdirectory (client or engine) to match the module:
for dir in bin/*/client; do
for platform in windows linux; do
old="${dir}/OldName.${platform}.yaml"
new="${dir}/NewName.${platform}.yaml"
[ -f "$old" ] || continue
mv "$old" "$new"
sed -i "s/func_name: OldName/func_name: NewName/" "$new"
sed -i "s/vtable_name: OldClass/vtable_name: NewClass/" "$new"
done
done
Other YAML fields (vfunc_offset, vfunc_index, func_sig, func_va, etc.) are
binary-derived values and must not be changed.
Step 6: Update Reference YAMLs (if any)
Reference YAMLs under ida_preprocessor_scripts/references/ may need two kinds of treatment:
A. Reference YAML named after the symbol (e.g. references/client/OldName.windows.yaml):
rename the file and update its contents:
mv ida_preprocessor_scripts/references/client/OldName.windows.yaml \
ida_preprocessor_scripts/references/client/NewName.windows.yaml
mv ida_preprocessor_scripts/references/client/OldName.linux.yaml \
ida_preprocessor_scripts/references/client/NewName.linux.yaml
sed -i "s/OldName/NewName/g" \
ida_preprocessor_scripts/references/client/NewName.windows.yaml \
ida_preprocessor_scripts/references/client/NewName.linux.yaml
B. Reference YAML named after a different symbol (e.g. references/client/IGameSystem_AddByName.windows.yaml
contains inline comments referencing OldName): update contents only:
sed -i "s/OldName/NewName/g" \
ida_preprocessor_scripts/references/client/SomeFile.windows.yaml \
ida_preprocessor_scripts/references/client/SomeFile.linux.yaml
Step 7: Update Test Files (if any)
Test files under tests/ may reference OldName in fixture data, skill-name strings,
file-name strings, func_vtable_relations assertions, and test class / method names.
If the Step 1 grep found any test files, do a bulk replace first:
sed -i "s/OldName/NewName/g" tests/test_ida_analyze_bin.py tests/test_ida_preprocessor_scripts.py
Then check for remaining stale vtable-class references in func_vtable_relations assertions
(the bulk replace will have renamed the symbol but not the class):
grep -n "func_vtable_relations.*OldClass" tests/test_ida_preprocessor_scripts.py
Fix any hits manually: ("NewName", "OldClass") → ("NewName", "NewClass").
Step 8: Update Downstream Script Contents (if any)
If any other preprocessor scripts reference OldName (e.g. in INHERIT_VFUNCS as the
base_vfunc_name, or in LLM_DECOMPILE as a predecessor), update those references to
NewName in their .py source and in their configs/<GAMEVER>.yaml expected_input entries.
INHERIT_VFUNCS base_vfunc_name gotcha: the 3rd element of the tuple is a path like
"../client/OldName" (without .yaml). A grep on the full symbol name will find it, but
a sed that only matches OldName.{platform}.yaml will not. Make sure the plain
s/OldName/NewName/g pass covers it.
Step 9: Verify
Run a final grep to confirm no stale references remain:
grep -r "OldName" --include="*.py" --include="*.yaml"
The only acceptable remaining hits are comments or documentation that explicitly reference
the old name for historical context.
Step 10: Run Post-Change Gates
Run the repository update and validation skills in this exact order before committing:
- ALWAYS Use SKILL
/post-change-update with phase=before-validation and
gamever=<gamever> from .env -> CS2VIBE_GAMEVER.
- ALWAYS Use SKILL
/post-change-validation with the same gamever.
- Only after validation succeeds, ALWAYS Use SKILL
/post-change-update with
phase=after-validation and the same gamever.
These calls replace any direct format_repo_files.py, update_gamedata.py, run_cpp_tests.py, or
gamesymbol_snapshot.py pack commands. If any gate fails, stop the entire rename task and do not commit.
Step 11: Commit
Review git status --short, then explicitly stage all task-related tracked changes, including gamedata and the
snapshot generated by the gates. Never use git add -A:
git add <all modified/renamed tracked files>
git add <changed-dist-gamedata-files> gamesymbols/<gamever>.yaml
git commit -m "refactor(preprocessor): rename OldName to NewName" -m "Co-Authored-By: Codex (GPT-5.x)"
The bin/ output YAMLs are untracked — they will not appear in the commit, which is expected.
Checklist
Real-World Examples
Simple (no reference YAMLs or tests)
User says: Rename ILoopType_EngineLoop to CLoopTypeBase_EngineLoop.
Affected files found:
ida_preprocessor_scripts/find-ILoopType_EngineLoop.py
configs/<GAMEVER>.yaml (skill entry, symbol entry)
bin/14141c/engine/ILoopType_EngineLoop.{windows,linux}.yaml
bin/14150d/engine/ILoopType_EngineLoop.{windows,linux}.yaml
bin/14151/engine/ILoopType_EngineLoop.{windows,linux}.yaml
bin/14152/engine/ILoopType_EngineLoop.{windows,linux}.yaml
No downstream dependents, no reference YAMLs, no test files hit.
Changes made:
git mv find-ILoopType_EngineLoop.py find-CLoopTypeBase_EngineLoop.py
- In the renamed script:
- Docstring:
find-ILoopType_EngineLoop → find-CLoopTypeBase_EngineLoop
INHERIT_VFUNCS: ("ILoopType_EngineLoop", "ILoopType", ...) → ("CLoopTypeBase_EngineLoop", "CLoopTypeBase", ...)
GENERATE_YAML_DESIRED_FIELDS key: "ILoopType_EngineLoop" → "CLoopTypeBase_EngineLoop"
configs/<GAMEVER>.yaml skill: find-ILoopType_EngineLoop / ILoopType_EngineLoop.{platform}.yaml → new names
configs/<GAMEVER>.yaml symbol: name: ILoopType_EngineLoop, alias: ILoopType::EngineLoop → new names
mv all 8 YAML files; sed -i updated func_name and vtable_name in each
Complex (reference YAMLs, test files, skip_if_exists)
User says: Rename ILoopType_DeallocateLoopMode to CLoopTypeBase_DeallocateLoopMode.
Affected files found:
ida_preprocessor_scripts/find-ILoopType_DeallocateLoopMode.py
configs/<GAMEVER>.yaml (skip_if_exists in find-CEngineServiceMgr_DeactivateLoop, skill entry, symbol entry)
bin/14141c/engine/ILoopType_DeallocateLoopMode.{windows,linux}.yaml (and 3 more gamevers)
ida_preprocessor_scripts/references/engine/CEngineServiceMgr_DeactivateLoop.{windows,linux}.yaml
tests/test_ida_analyze_bin.py
tests/test_ida_preprocessor_scripts.py
Changes made:
git mv find-ILoopType_DeallocateLoopMode.py find-CLoopTypeBase_DeallocateLoopMode.py
- In the renamed script (bulk replace then fix vtable class):
- All
ILoopType_DeallocateLoopMode → CLoopTypeBase_DeallocateLoopMode
FUNC_VTABLE_RELATIONS: ("CLoopTypeBase_DeallocateLoopMode", "ILoopType") → (..., "CLoopTypeBase")
configs/<GAMEVER>.yaml: skip_if_exists entry + skill entry + symbol entry all updated
mv all 8 YAML files; sed -i updated func_name and vtable_name in each
sed -i on both reference YAML files (comments in IDA disassembly snippets)
sed -i bulk replace across both test files; then manually fixed func_vtable_relations
assertion: ("CLoopTypeBase_DeallocateLoopMode", "ILoopType") → (..., "CLoopTypeBase")
Batch (two renames at once, compound script name, downstream INHERIT_VFUNCS, reference YAML rename)
User says: Rename IGameSystemFactory_Allocate → IGameSystemFactory_CreateGameSystem
and IGameSystemFactory_Deallocate → IGameSystemFactory_DestroyGameSystem.
Affected files found (both symbols combined):
ida_preprocessor_scripts/find-IGameSystemFactory_Allocate-AND-IGameSystemFactory_DoesGameSystemReallocate-AND-IGameSystem_SetName.py
ida_preprocessor_scripts/find-IGameSystem_GetName-AND-IGameSystemFactory_Deallocate.py
configs/<GAMEVER>.yaml (2 skill entries, 2 symbol entries, 1 downstream expected_input)
bin/*/client/IGameSystemFactory_Allocate.{platform}.yaml (34 files)
bin/*/client/IGameSystemFactory_Deallocate.{platform}.yaml (34 files)
ida_preprocessor_scripts/references/client/IGameSystem_AddByName.{windows,linux}.yaml (content only)
ida_preprocessor_scripts/references/client/IGameSystem_DestroyAllGameSystems.{windows,linux}.yaml (content only)
ida_preprocessor_scripts/find-CGameSystemReallocatingFactory_CSpawnGroupMgrGameSystem_DestroyGameSystem-impl.py
(downstream: INHERIT_VFUNCS base_vfunc_name = "../client/IGameSystemFactory_Deallocate")
tests/test_ida_preprocessor_scripts.py
Key observations:
Deinline-Fix Variant (see create-preprocessor-scripts Pattern M)
When a helper that used to be inlined into a target de-inlines on some build, its anchor (the
debug string it owns, or the call the target made into it) leaves the target, so the single
find-X finder stops producing X.{platform}.yaml there and the fail-fast run aborts the module.
The fix is a 3-skill inline/noinline fallback chain: the original finder is renamed to
find-X-inlined using this skill's Step 1–3 git mv + content-update mechanics, and a helper
finder plus a find-X-noinline finder are added around it (optional_output / prerequisite /
skip_if_exists wiring).
The de-inline fix is fundamentally a script-creation pattern -- only the -inlined rename step
belongs to this skill. The full recipe (script templates, the configs/<GAMEVER>.yaml chain, the func_sig
keep/drop rule, validation on both inline states, the CNetworkGameServer_DirectUpdate worked
example, and the inverted string-less-wrapper variant) lives in
create-preprocessor-scripts Pattern M.