spec_nav_similar_functions
Find functions that behave like a given one by comparing their calls and body vocabulary, regardless of names. Use before edits to spot copied logic; review matches, as similarity is not equivalence.
Instructions
Find functions that behave like a given one, whatever they are named, by comparing the calls they make and their body vocabulary. Subject: id, file+name, or code (a draft). Use on a draft before adding code, on a candidate to find siblings, or before changing logic that may be copied elsewhere. Ranked candidates list the calls and words they share. Similar is not interchangeable: read both.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Function id from another spec_nav tool. | |
| code | No | Source of a draft or external function to compare instead. | |
| file | No | File of the subject function, relative to the root. | |
| line | No | A line inside the subject, to disambiguate. | |
| name | No | Name of the subject function in `file`. | |
| limit | No | Candidates per page (default 10, max 100). | |
| cursor | No | The nextCursor from the previous page. Repeat the other arguments unchanged. | |
| format | No | "text" (default, compact) or "json" (structured). | |
| inFile | No | Only candidates in files whose path contains this (or matches it, with * globs). | |
| language | No | ||
| minScore | No | Lowest similarity listed (default 0.2). | |
| services | No | Services/directories relative to the root (e.g. "services/api"); "." is the root project's own files. Default: the whole repo. |