AgentSkillsCN

wikilink-graph-bfs

对通过维基链接相连的笔记进行 BFS(广度优先搜索)图遍历。适用于探索笔记间的关系、在 N 跳范围内发现关联知识、绘制知识图谱、从起始点出发寻找相关笔记,或深入理解某一概念周围的链接结构。

SKILL.md
--- frontmatter
name: wikilink-graph-bfs
description: Perform BFS (breadth-first search) graph traversal on notes connected via wikilinks. Use when exploring note relationships, discovering connected knowledge within N hops, mapping knowledge graphs, finding related notes from a starting point, or understanding the link structure around a concept.

Wikilink Graph BFS Traversal

Traverse Obsidian notes as a graph using breadth-first search, starting from any note and discovering connected notes within N hops via wikilinks.

Quick Start

bash
# BFS traversal from a note for N hops
uv run python .claude/skills/wikilink-graph-bfs/scripts/bfs_traversal.py traverse "Note Name" 2

# With specific directory
uv run python .claude/skills/wikilink-graph-bfs/scripts/bfs_traversal.py traverse "Note Name" 2 "02-SlipBox"

Choosing N Hops

NUse Case
1Direct relationships only
2Secondary connections (recommended default)
3Broader context
4+Comprehensive exploration

Commands

CommandPurpose
traverse <note> <n> [dir]BFS from note for n hops
graph [dir]Full graph structure
neighbors <note> [dir]Direct connections of a note

Examples

bash
# Explore 2 hops from Machine Learning
uv run python .claude/skills/wikilink-graph-bfs/scripts/bfs_traversal.py traverse "Machine Learning" 2

# View vault graph structure
uv run python .claude/skills/wikilink-graph-bfs/scripts/bfs_traversal.py graph "."

# Find all neighbors of a note
uv run python .claude/skills/wikilink-graph-bfs/scripts/bfs_traversal.py neighbors "Python"

Reference

For output formats, wikilink parsing details, and behavior notes, see REFERENCE.md.