$npx -y skills add HLND2T/CS2_VibeSignatures --skill create-agent-skill-fallbackCreate an Agent SKILL.md fallback for an existing find-XXXX finder that relies on a fragile discovery foundation — above all LLM_DECOMPILE (patterns C/D/E), which matches the decompiled shape of a predecessor function against a stored reference and breaks when a symbol is inlined
| 1 | # Create an Agent SKILL.md Fallback for a Finder |
| 2 | |
| 3 | Given a target `find-XXXX` finder whose preprocessor uses a fragile foundation (most often **LLM_DECOMPILE**), |
| 4 | author `.claude/skills/find-XXXX/SKILL.md` — the **Agent fallback** that `ida_analyze_bin.py` runs only when the |
| 5 | preprocessor returns failure. The preprocessor stays as-is; this skill adds a durable backstop beside it. |
| 6 | |
| 7 | This is the robustness-oriented sibling of `/convert-finder-skill-to-preprocessor-scripts` (that skill turns a |
| 8 | SKILL.md *into* a preprocessor; this one gives a preprocessor a SKILL.md *fallback*). |
| 9 | |
| 10 | ## When to Use |
| 11 | |
| 12 | - A `find-XXXX` finder failed on a new game version because a member/vfunc/function was **inlined or |
| 13 | de-inlined** relative to what its LLM_DECOMPILE reference expects (classic symptom: one target in a |
| 14 | multi-target `-decompiles` skill can no longer be found, aborting the module). |
| 15 | - You want to **pre-emptively** backstop an LLM_DECOMPILE-based finder (patterns C/D/E) whose correctness hinges |
| 16 | on a predecessor keeping a fixed decompiled shape. |
| 17 | - The recipe also applies to xref-string / found_call / index-based finders — the foundation differs, but the |
| 18 | same "self-contained, skip-existing, anchor semantically, follow the callee" method holds. |
| 19 | |
| 20 | Do **not** use this to replace a working preprocessor. The fallback is a safety net; the preprocessor remains |
| 21 | the fast path. |
| 22 | |
| 23 | ## The one constraint that drives the whole design |
| 24 | |
| 25 | When the preprocessor fails, `agent_runner.run_skill` launches the agent with a prompt of **only |
| 26 | `/{skill_name}`** (see `_build_claude_command`, profile `sig-finder`). The skill's `expected_yaml_paths` is used |
| 27 | **only** for post-run missing-file verification (`_missing_expected_outputs` / `_result_failure_reason`) — it is |
| 28 | **never** injected into the prompt, and the missing list is not fed back to the agent on retry. |
| 29 | |
| 30 | Consequence: the fallback SKILL.md you generate MUST be **fully self-contained**. It must enumerate every |
| 31 | output, gate each by platform, and tell the agent to **skip outputs whose YAML already exists** (the |
| 32 | preprocessor may have written most of them before failing; earlier fallback skills may have written others). |
| 33 | |
| 34 | ## Inputs to gather (read these before writing anything) |
| 35 | |
| 36 | For target finder `find-XXXX` in module `<module>` (`server`, `engine`, `networksystem`, …): |
| 37 | |
| 38 | 1. **Preprocessor** `ida_preprocessor_scripts/find-XXXX.py` — the source of truth for *what* to find: |
| 39 | - `TARGET_FUNCTION_NAMES`, `TARGET_STRUCT_MEMBER_NAMES`, `TARGET_GLOBALVAR_NAMES` and any |
| 40 | `*_WINDOWS` / `*_LINUX` variants → the output symbols and their **platform gating**. |
| 41 | - `LLM_DECOMPILE` (and `_WINDOWS`/`_LINUX`) → the **predecessor** reference each target is mined from |
| 42 | (`references/<module>/<predecessor>.{platform}.yaml`). |
| 43 | - `FUNC_VTABLE_RELATIONS` → which targets are vtable-related (`vtable_name`). |
| 44 | - `GENERATE_YAML_DESIRED_FIELDS` → the **exact fields and kind** for each target (this tells you whether a |
| 45 | target is a struct member, an indirect-vcall vfunc, a real vfunc, a regular func, or a global var — see the |
| 46 | kind table below). |
| 47 | - any `FUNC_XREFS` (string/gv anchors) — extra fingerprints you can reuse. |
| 48 | 2. **`configs/<GAMEVER>.yaml` skill entry** — `expected_output` / `expected_output_windows` / `expected_output_linux` |
| 49 | (authoritative output list per platform), `expected_input` (the predecessor YAML), `platform`, |
| 50 | `prerequisite`. |
| 51 | 3. **Reference YAMLs** `ida_preprocessor_scripts/references/<module>/<predecessor>.{platform}.yaml` — the |
| 52 | `disasm_code` + `procedure` carry the annotations `; 0xNN = Class::member` and |
| 53 | `; 0xNN = Class::vfunc` / `// NNNN = 0xNN = …` at each access/call site. **These annotations are the semantic |
| 54 | fingerprints** you translate into the fallback's anchors. Also collect any real-world helper or alternate |
| 55 | inline/de-inline reference YAML that materially helps locate the targets. |
| 56 | 4. **Ground-truth output YAMLs** `bin/<gamever>/<module>/<target>.{platform}.yaml` — the **authoritative** |
| 57 | offsets, vfunc indices, and signature styles th |