跳到正文
FunCoding

memtrace-graph

Map source-code architecture with graph algorithms — PageRank centrality, bridge symbols, Louvain communities, dependency paths, and execution flows over the AST graph. Use when the user asks about source-code architecture, important symbols, centrality, PageRank, bridge functions, communities, logical modules, chokepoints, service boundaries, or dependency path questions. Do not use Glob, find, tree, or directory browsing to infer architecture; Memtrace runs graph algorithms over the AST graph.

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

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

在 GitHub 上查看

Overview

Graph algorithms over the knowledge graph — communities (Louvain), PageRank centrality, bridge symbols (articulation points), shortest paths, and execution flows.

Quick Reference

ToolRequired paramsKey optional
find_central_symbolsrepo_idlimit (def 25), kinds[]
find_bridge_symbolsrepo_idlimit
find_dependency_pathrepo_id, source, targetmax_depth (def 20), edge_type
list_communitiesrepo_idmin_size, limit
list_processesrepo_idlimit
get_process_flowrepo_id, processbranch

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

Steps

1. Understand the architecture

list_communities — natural module partitions.

2. Find critical infrastructure

find_central_symbols runs PageRank internally. There is no method param (no degree-centrality switch).

{ "repo_id": "memdb", "limit": 25, "kinds": ["Function", "Method"] }

3. Find chokepoints

{ "repo_id": "memdb", "limit": 15 }

4. Path between two symbols

{
  "repo_id": "memdb",
  "source": "handleLogin",
  "target": "DatabaseClient.query",
  "max_depth": 20
}

Params are source and target (symbol names) — not from/to.

5. Execution flows

{ "repo_id": "memdb" }
{ "repo_id": "memdb", "process": "POST /login" }

Output

find_central_symbols — each result carries the PageRank score plus degree counts:

[
  { "name": "DatabaseClient.query", "score": 0.0142, "in_degree": 38, "out_degree": 5 },
  { "name": "handleLogin", "score": 0.0097, "in_degree": 21, "out_degree": 9 }
]

find_dependency_path returns the ordered symbol chain from source to target; list_communities returns module partitions with their member symbols.

Common Mistakes

MistakeReality
find_central_symbols(method: "degree")No method param — always PageRank
find_dependency_path(from=..., to=...)Use source and target

相似的 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