$npx -y skills add HLND2T/CS2_VibeSignatures --skill convert-finder-skill-to-preprocessor-scriptsConvert an existing find-XXXX SKILL.md into a preprocessor Python script, updating configs/<GAMEVER>.yaml and removing the old SKILL.md. Covers xref-string-based and LLM_DECOMPILE-based discovery patterns.
| 1 | # Convert Finder SKILL.md to Preprocessor Script |
| 2 | |
| 3 | Port an existing `.claude/skills/find-XXXX/SKILL.md` into an `ida_preprocessor_scripts/find-XXXX.py` |
| 4 | preprocessor script, update `configs/<GAMEVER>.yaml` entries, and delete the old SKILL.md. |
| 5 | |
| 6 | ## When to Use |
| 7 | |
| 8 | - A `find-XXXX` SKILL.md exists in `.claude/skills/` and needs to be converted to a preprocessor script |
| 9 | - The SKILL.md uses either **xref-string search** (`find_regex` / `xrefs_to`) or **decompile-based vtable analysis** to discover functions |
| 10 | |
| 11 | ## Overview |
| 12 | |
| 13 | Eight preprocessor patterns exist. The SKILL.md's discovery method and target type determine which to use: |
| 14 | |
| 15 | | Pattern | Discovery Method | Has FUNC_XREFS | Has LLM_DECOMPILE | Has INHERIT_VFUNCS | Has FUNC_VTABLE_RELATIONS | preprocess_skill has llm_config | |
| 16 | |---------|-----------------|-----------------|---------------------|--------------------|---------------------------|-------------------------------| |
| 17 | | **A** — Regular function via xref strings | `find_regex` + `xrefs_to` on debug strings | Yes | No | No | No | No | |
| 18 | | **B** — Virtual function via xref strings | Same as A, but function is in a vtable | Yes | No | No | Yes | No | |
| 19 | | **C** — Virtual function via LLM_DECOMPILE | Decompile a known predecessor function, identify vfunc call offsets | No | Yes | No | Yes | Yes | |
| 20 | | **D** — Regular function via LLM_DECOMPILE | Decompile a known predecessor function, identify direct call targets | No | Yes | No | No | Yes | |
| 21 | | **E** — Struct member offset via LLM_DECOMPILE | Decompile a known predecessor function, identify struct field access offsets | No | Yes | No | No | Yes | |
| 22 | | **F** — Virtual function via INHERIT_VFUNCS | Inherit vtable slot index from a known base-class vfunc, look up same slot in derived-class vtable | No | No | Yes | No | No | |
| 23 | | **G** — ConCommand handler function | Find the handler callback registered via `RegisterConCommand` by matching command name and help string | No (uses COMMAND_NAME/HELP_STRING) | No | No | No | No | |
| 24 | | **H** — Secondary (ordinal) vtable | Locate a class's secondary vtable via mangled symbol (Windows) or offset-to-top (Linux) | No | No | No | No | No | |
| 25 | |
| 26 | Additionally, **struct member offsets** can be mixed into any pattern as a secondary target (see "Struct Member Mixin" section below). |
| 27 | |
| 28 | --- |
| 29 | |
| 30 | ## Step 1: Read and Analyze the SKILL.md |
| 31 | |
| 32 | Read the target `.claude/skills/find-XXXX/SKILL.md`. |
| 33 | |
| 34 | Extract: |
| 35 | 1. **Target function names** — all functions the skill identifies (may be 1 or many) |
| 36 | 2. **Target struct member names** — all struct member offsets the skill identifies (e.g. `CCheckTransmitInfo_m_nPlayerSlot`) |
| 37 | 3. **Discovery method** for each target: |
| 38 | - Does it use `find_regex` / `xrefs_to` with debug strings? → **xref-string based** (Patterns A/B) |
| 39 | - Does it search for a ConCommand registration (command name + help string) and extract the handler callback? → **ConCommand handler** (Pattern G) |
| 40 | - Does it load a predecessor YAML, decompile that function, and extract vfunc offsets / struct offsets from code patterns? → **LLM_DECOMPILE based** (Patterns C/D/E) |
| 41 | - Is the target a derived-class override of a known base-class vfunc (same vtable slot, different class)? → **INHERIT_VFUNCS based** (Pattern F) |
| 42 | - Does the SKILL.md locate a secondary vtable using a mangled symbol name (Windows `@@6B@_0`) or offset-to-top (Linux)? → **ordinal vtable** (Pattern H) |
| 43 | 4. **Function category** — `func` (regular), `vfunc` (virtual, has vtable slot), `structmember`, or `vtable` |
| 44 | 5. **VTable class name** — if virtual, e.g. `CBaseEntity`, `CBasePlayerPawn`, `INetworkMessages` |
| 45 | 6. **Xref strings** — debug strings used in `find_regex` patterns (for xref-string patterns). **Check if these differ between Windows and Linux** — if so, you need platform-specific `FUNC_XREFS_WINDOWS` / `FUNC_XREFS_LINUX`. Use the `FULLMATCH:` prefix (e.g. `"FULLMATCH:Precache"`) when you need exact-string matching instead of substring matching — this prevents false positives when the target string is short or generic (e.g. `"Precache"`, `"userid"`, `"team"`). |
| 46 | 7. **Predecessor function** — the function whose decompiled code reveals the target (for LLM_DECOMPILE patterns) |
| 47 | 8. **Base vfunc for inheritance** — if the target is a derived-class override of a known base-class vfunc, the base vfunc name (for INHERIT_VFUNCS pattern) |
| 48 | 9. **Dependencies** — which existing YAMLs are needed as inputs (vtable YAMLs, predecessor function YAMLs, base vfunc YAMLs) |
| 49 | |
| 50 | ## Step 2: Plan the Split |
| 51 | |
| 52 | If the SKILL.md discovers multiple functions using **different methods** or from **different starting points**, split them into separate preprocessor scripts. Each script handles one "discovery unit" — a group of functions findable |