跳到正文
FunCoding

memtrace-search

Find source code with Memtrace hybrid BM25+semantic search: symbols, functions, classes, types, constants, definitions, implementations, logic, or error strings inside code. Use when the user wants to find, search, locate, or look up code or asks where code lives. Do not use Grep, Glob, rg, find, or manual file search for code discovery. If Memtrace returns 0 results, broaden the Memtrace query and diagnose/reindex; do not switch to grep.

Star
516
最近提交
2026年11月30日

plugins/memtrace-skills/skills/memtrace-search/SKILL.md

在 GitHub 上查看

Overview

Find code using hybrid BM25 + semantic search (RRF). Primary discovery tool — use before relationship or impact analysis.

Quick Reference

ToolBest For
find_codeNatural-language queries, broad searches
find_symbolExact identifier names
get_source_windowBounded source read when harness lacks Read(offset, limit)

Parameter types: Numbers must be JSON numbers — not strings.

find_code parameters

ParamRequiredDefaultNotes
queryyes—Natural language or symbol text
repo_idnoall repos
limitno20Max 100
file_pathno—Path/directory substring filter
as_ofnonowISO-8601 time-travel
include_diagnosticsnofalseSet true for id, score in results

No kind param on find_code — use find_symbol(kind=...) to filter by symbol type.

{ "query": "authentication middleware", "repo_id": "memdb", "limit": 20 }

find_symbol parameters

ParamRequiredDefaultNotes
nameyes—Symbol name to search
repo_idnoall repos
fuzzynofalseAPI field exists; currently exact-match in backend
edit_distanceno2Only when fuzzy enabled
kindno—Function, Class, Method, etc.
file_pathno—Path substring filter
limitno10Max 50
{ "name": "validateToken", "repo_id": "memdb", "file_path": "auth" }

Full parameter spec for every Memtrace tool: references/mcp-parameters.md (bundled at the memtrace-skills plugin root).

Steps

1. Choose the tool

  • Exact name → find_symbol
  • Behaviour description → find_code
  • All repos → omit repo_id

Result shape: see Output below.

3. Hand off to graph tools

Save name, scope_path, and file_path — not internal IDs:

{ "repo_id": "memdb", "symbol": "validateToken" }
{ "repo_id": "memdb", "target": "validateToken", "direction": "both" }
{ "repo_id": "memdb", "target": "validateToken", "query_type": "find_callers" }

Read source only when editing — bounded Read(offset, limit) at returned lines.

Multi-word queries

  1. Try verbatim find_code query.
  2. If weak, fan out: camelCase, snake_case, domain identifiers.
  3. Dedupe top hits by file_path:start_line.

Output

One find_code / find_symbol result entry:

{
  "name": "validateToken",
  "kind": "Function",
  "file_path": "src/auth/token.rs",
  "start_line": 42,
  "scope_path": "auth::token"
}

score (and id) appear only with include_diagnostics: true.

Common Mistakes

MistakeReality
find_code(kind=...)kind only on find_symbol
Passing symbol id to graph toolsUse name as symbol / target
Assuming fuzzy: true always worksBackend is exact-match today — try spelling variants
Skipping list_indexed_repositoriesVerify repo is indexed first

相似的 Skill

rea-analysis-optimization

MOmorluto/rea485k近 7 天新增 9,215 个 star

codebase-design

MAmattpocock/skills336k近 7 天新增 5,004 个 star

精选

diagnosing-bugs

诊断困难 bug 和性能回归,用测试或脚本构建反馈循环定位问题。

MAmattpocock/skills336k近 7 天新增 5,004 个 star

setup-ts-deep-modules

MAmattpocock/skills336k近 7 天新增 5,004 个 star

code-review

MAmattpocock/skills336k近 7 天新增 5,004 个 star

implement

MAmattpocock/skills336k近 7 天新增 5,004 个 star