#11·skills

refactor: remove resolve-model.ts and search-models.ts — LLM agents are better fuzzy matchers than bigram dice

Author: perry-the-pr-reviewer[bot]Created Apr 13, 2026Updated Apr 13, 2026

Problem

resolve-model.ts implements a custom fuzzy matching algorithm (bigram dice coefficient + token overlap scoring) to map informal model names like "nano banana 2" to exact OpenRouter model IDs. search-models.ts does substring/modality filtering over the models list.

Both scripts are solving a cognition problem — and the agents running these skills are LLMs that are significantly better at this kind of reasoning than a bigram dice algorithm. The scripts don't save an API call either: they still fetch GET /models (300+ entries) before running their weaker algorithm on top.

This creates complexity without adding capability. When a script wraps something an LLM can already do natively, it's overhead:

  • An extra npm install step + tsx runner
  • A bespoke algorithm that underperforms the agent's built-in reasoning
  • More surface area to maintain and keep in sync

What to do instead

For model name resolution and search, the skill doc should instruct the agent to call GET /models and reason about the result directly. The agent already knows what "nano banana" means — it doesn't need a script to tell it.

The decision tree in openrouter-models/SKILL.md covering these scripts should be simplified to: fetch the models list, pick the right one.

Scripts with clear value (not affected)

Scripts that do things agents mechanically can't do should stay:

  • get-endpoints.ts — fetches real-time latency/uptime data
  • list-models.ts / compare-models.ts — reformats and sorts data into structured CLI output
  • generate.ts / edit.ts — handles base64 image saving, filesystem I/O

Reviewed by Perry