packages/thinking-framework-skills/skills/retrieve-topic/SKILL.md
# Retrieve Topic Node ## Goal Locate the most relevant topic directory in the knowledge tree based on the user's request. Following the progressive disclosure principle, traversal starts from the vault root and descends layer by layer, with user confirmation at each proposed match. ## Runtime Environment 本 Skill 由主 Agent 调用,dispatch 一个 **general-purpose subagent** 来执行实际的检索操作。 - 主 Agent 负责任务分发和结果聚合 - Subagent 执行目录遍历和关键词匹配 - Subagent 仅返回检索结果,不做决策 ## Input - Vault root path (resolved from con
npx skillsauth add edisonlzy/ai-codemons packages/thinking-framework-skills/skills/retrieve-topicInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Locate the most relevant topic directory in the knowledge tree based on the user's request. Following the progressive disclosure principle, traversal starts from the vault root and descends layer by layer, with user confirmation at each proposed match.
本 Skill 由主 Agent 调用,dispatch 一个 general-purpose subagent 来执行实际的检索操作。
obsidian_vault_path)flowchart TD
A[Start: vault root, depth=1] --> B[Read current README.md]
B --> C[Scan subdirectories]
C --> D{Any subdirs match query?}
D -->|No match| E{depth >= 6?}
E -->|Yes| F[Report: no matching topic found]
E -->|No| G[Inform user: no match at this level\nAsk if they want to specify a path manually]
G -->|User provides path| H[Jump to that path]
G -->|User gives up| F
H --> B
D -->|Matches found| I[Rank candidates by keyword relevance]
I --> J[Present top candidates to user via AskUser]
J --> K{User confirms a candidate?}
K -->|Yes| L[✅ Return confirmed topic path]
K -->|No / drill deeper| M{depth >= 6?}
M -->|Yes| F
M -->|No| N[Move into selected subdirectory, depth++]
N --> B
Use the configured obsidian_vault_path as the starting directory (depth = 1).
For the current directory:
README.md (if it exists) to understand the scope of this node.README.md (first 30–50 lines is sufficient) and extract:
Match the user's query keywords against each subdirectory's README content using the following priority:
| Priority | Match Location | |----------|---------------| | High | Keyword in title or definition sentence | | Medium | Keyword in boundary / includes / scope | | Low | Keyword appears elsewhere in the file | | No match | Keyword not found |
Keep only subdirectories with at least a Low match. If none qualify, proceed to step 5 (no match).
Present the ranked candidates using the AskUser tool:
Found the following matching topics for "[query]":
1. /vault/programming/frontend/ — "Frontend development concepts including HTML, CSS, JavaScript frameworks"
2. /vault/programming/ — "Software programming knowledge base"
Which topic are you looking for? Select a number to confirm, or "more" to drill deeper into a candidate, or "none" to indicate no match.
If no candidates were found or the user rejected all candidates:
depth < 6: inform the user that no match was found at this level, and ask if they want to manually specify a subdirectory path to continue searching. If they provide a path, jump there and continue. If not, stop.depth >= 6: report that the topic was not found within 6 layers and stop.⚠️ No matching topic found within 6 layers of the knowledge tree.
You may try:
- Rephrasing your query
- Manually browsing the vault with: tree -L 6 -d <vault_path>
- Creating a new topic with the "create topic" skill
On success, output the confirmed topic path clearly:
✅ Topic located: /vault/programming/frontend/
README.md summary:
> Frontend development covers HTML, CSS, and JavaScript frameworks...
ls -d /path/to/dir/*/tree -L 2 -d <path>development
Apply Obsidian-flavoured formatting to a topic node's README.md, FAQ.md, and content knowledge-point files using standard templates.
development
Locate the most relevant topic directory in the Obsidian knowledge tree based on a search query.
development
Divide a large topic into smaller, well-defined sub-topic nodes through web research and user collaboration.
testing
Conduct deep, comprehensive research on a specified topic and produce authoritative knowledge-point Markdown files.