find-similar-functions
Installation
SKILL.md
Similar Function Finder
Use this skill before writing new JavaScript or TypeScript code that might overlap with existing helpers. The goal is to discover nearby functions, methods, constants, types, and interfaces early enough to reuse or extend them instead of creating duplicate behavior.
truffler is a fuzzy symbol search tool. Treat it as a discovery layer: it points you to likely symbols, but you still need to inspect the code before deciding whether something is reusable.
Workflow
- State the behavior you are about to implement in a few words.
- Derive 3-6 search queries from the intended behavior:
- the proposed function or class name
- domain nouns, such as
symbol,path,file,route,token, orconfig - verbs, such as
parse,normalize,discover,scan,format,rank,score,resolve, orvalidate - common abbreviations and synonyms, such as
btnforbuttonorcfgforconfig
- Run
truffleragainst the narrowest useful root first, then broaden if needed. - Inspect the top matches with normal code-reading tools before editing.
- Prefer reusing, extending, or moving existing code when the behavior substantially matches. Create new code only after the search shows there is not a suitable existing symbol.
- In your final response, briefly mention what you found and whether you reused something or intentionally added a new implementation.