kg-traverse
它能做什么
这项技能从一个起点出发,沿着知识图谱中的联系进行查找,显示其连接关系和最相关的路径。适合做影响分析或追踪依赖的开发者。
适用场景
- ✓当你想知道哪些部分依赖某个特定的类或模块时。
- ✓当你想查看从某一项出发的依赖链时。
- ✓当你需要判断修改代码某一部分的影响时。
技能链接
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-knowledge-graph/skills/kg-traverse/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“如果我修改账单模块,会影响到哪些地方?请沿着代码地图的联系查找。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能在图中找到起点,将其联系展开到设定的深度,并按相关性为每条路径打分。它会去掉较弱的路径,并返回排名靠前的结果。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
KG Traverse
Perform pathfinder graph traversal starting from a seed entity. Expands outward through the graph's edges, scores paths by relevance, and prunes low-scoring branches.
When to use
When you need to explore the knowledge graph starting from a specific entity -- finding what depends on it, what it depends on, or discovering indirect relationships. Useful for impact analysis, dependency chains, and understanding code structure.
Steps
- Seed -- call
mcp__plugin_ruflo-core_ruflo__agentdb_hierarchical-recallto look up the target entity by name (one word is the most reliable query: the recall matches the whole query as a substring). Graph node ids are domain-prefixed, for exampleentity:router-account. - Expand -- call
mcp__plugin_ruflo-core_ruflo__agentdb_graph-querywith{ nodeId: "entity:NAME", mode: "k-hop", depth: N }(default depth 3, the SQL path applies at most 3 and reportsappliedDepthandtruncated; addrelationto filter by relation type).agentdb_causal-edgeonly records an edge, never use it to read one. - Score and rank -- call
mcp__plugin_ruflo-core_ruflo__agentdb_graph-pathfinderwith{ seedNodeId: "entity:NAME", query: "<what the user wants to know>", depth: N, threshold: 0.3, topK: 10 }. It expands from the seed, scores each path by cumulative relevance, drops paths under the threshold and returns the top paths. If it returns nothing useful, score the k-hop neighbours yourself withmcp__plugin_ruflo-core_ruflo__agentdb_pattern-searchon entity names and relation types (thesemanticRoutercontroller isenabled: falsein current AgentDB builds; see ruvnet/ruflo#2049). - Synthesize -- write the summary yourself from the returned paths. Do not call
agentdb_context-synthesize: it summarizes validated task episodes and answersno-eligible-episodesfor entity records written bykg-extract. - Report -- display the top 10 paths with: path (entity chain), relation types, cumulative score, and your summary.
When the graph cannot be read
With CLAUDE_FLOW_ENCRYPT_AT_REST=1 the graph read tools answer graph_edges DB is encrypted at rest (RFE1) (#2889, #4135): edges recorded by kg-extract are stored but cannot be read back yet. Say so in the report. Your data is intact: do not run memory init. Fall back to the entity records only (agentdb_hierarchical-recall) and tell the user that relations are unavailable. An agentdb_causal-edge result with readable: false already warns about this at write time.
CLI alternative
npx @claude-flow/cli@latest memory search --query "relations for ENTITY_NAME" --namespace knowledge-graph
常见问题
它沿联系查找多远?
默认深度为三步,即使你要求更多,查询也会在三步处停止。
我能按联系类型筛选吗?
可以。你可以把遍历限制在某一种关系类型上。
它会修改图吗?
不会。该技能只读取关系,不会添加新的边。
详情
热度
- GitHub 星标
- 81k
- 排名
- #1640
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-adaptive-coordinator
81k帮你的智能体在工作量变化时拆分和重新平衡一组 AI 智能体,并选择适合任务的分工方式。
agent-agent
81k教你的智能体把一个大目标拆成有顺序的行动计划,并在情况变化时重新规划。
agent-agentic-payments
81k帮你的智能体管理 AI 购物的消费授权,包括消费上限、时间窗口、商户规则和签名审批。
agent-analyze-code-quality
81k帮你的智能体检查代码质量,找出代码异味、技术债务和重构建议,且不改动文件。