xlb-topic-index
SKILL.md
Topic Index Command
Overview
Resolve xlb query phrases into a title command for the local API, then return Markdown index content.
When to Use
- User input contains
xlbas a query trigger. - User gives
>.../command directly and expects passthrough. - User asks for topic index/navigation instead of narrative explanation.
- User wants direct Markdown output from the knowledge source.
Interaction Rule
- If input matches any trigger pattern below, execute directly without extra questions.
- If input mentions
xlbbut no topic can be extracted, ask:请发送你要查询的指令,例如:xlb >Vibe Coding/AI超元域 或 xlb ??Vibe Coding
Trigger Mapping
xlb >vibe coding/vib->title=>vibe coding/vib(stripxlb, payload passthrough)xlb ??vibe coding->title=??vibe coding(stripxlb, payload passthrough)xlb ->vibe coding/:->title=->vibe coding/:(stripxlb, payload passthrough to API)xlb >vibe coding/searchin:->title=>vibe coding/searchin:(related-topic edges only)xlb >vibe coding/command:->title=>vibe coding/command:(executable command edges only)查询xlb vibe coding主题->title=>vibe coding/>AI Model/->title=>AI Model/(direct passthrough)
Execute
Run:
skills/xlb-topic-index/scripts/fetch-topic-index.sh "xlb ??Vibe Coding"
The script performs:
POST http://localhost:5000/getPluginInfo- form fields:
title=<resolved command>url=markdown=
Output Rule
- Return API response Markdown directly.
- Do not paraphrase unless the user asks for analysis.
Local URL Opening (built-in, no external dependency)
- This project has native URL-open capability for local apps, no dependency on
/Users/wowdd1/App/*.sh. - Single URL:
skills/xlb-topic-index/scripts/xlb-open-url.sh "https://example.com" chromepython3 skills/xlb-topic-index/scripts/xlb_rag_pipeline.py open-url --url "https://example.com" --app chromepython3 skills/xlb-topic-index/scripts/xlb_rag_pipeline.py open-url --url "https://example.com" --app diapython3 skills/xlb-topic-index/scripts/xlb_rag_pipeline.py open-url --url "https://example.com" --app atlas
- Open links from search result JSON:
python3 skills/xlb-topic-index/scripts/xlb_rag_pipeline.py open-hits --hits-json-file /tmp/xlb-search.json --app chrome --limit 3
- Optional integration with retrieve script:
XLB_OPEN_HITS=1 XLB_OPEN_APP=chrome XLB_OPEN_LIMIT=2 skills/xlb-topic-index/scripts/retrieve-topic-index.sh "xlb >vibe coding/:" "codex cli"
Capability Routing Rule (for network content)
- Before fetching external URL content, discover capabilities each run:
python3 skills/xlb-topic-index/scripts/xlb_rag_pipeline.py discover
- If discover result contains suitable network skills or MCP tools, use them first.
- If no suitable skill/MCP capability exists, fallback to this skill's local scripts.
- Fallback policy: this skill must always remain runnable standalone (no hard dependency on external skills).
- Optional external route hook:
- Set
XLB_EXTERNAL_ROUTE_CMD=/path/to/command - Command contract:
cmd "<input>" "<retrieval_query>"and prints final output when it handles the request. - If external command exits non-zero or prints empty, fallback to local pipeline.
- Set
Code Retrieval Mode (efficient)
- Use code-based retrieval instead of full markdown dump when user asks to search/analyze:
skills/xlb-topic-index/scripts/retrieve-topic-index.sh "xlb >vibe coding/coding" "codex cli"
- This mode does:
- Cache raw markdown
- Incremental update: if raw hash unchanged, skip re-ingest
- Parse markdown to virtual file tree
- Build sqlite index
- Optional concurrent prefetch of top-k URLs (
XLB_PREFETCH_ARTIFACTS=1)- HTML links are converted to
markdown/textartifacts (not stored as raw HTML) - External HTML converter is optional and preferred when configured
- HTML links are converted to
- Return top-k hits by query, or iterative rounds with stop strategy (
XLB_ITERATIVE_SEARCH=1)
Performance Flags
XLB_FORCE_REFRESH=1force refresh markdown from APIXLB_RAW_CACHE_TTL_SEC=300raw cache TTL value used only whenXLB_AUTO_REFRESH_ON_QUERY=1XLB_AUTO_REFRESH_ON_QUERY=0(default) do not auto refresh by TTL; only user explicit refresh (XLB_FORCE_REFRESH=1) or cache miss will fetchXLB_STORAGE_PROFILE=minimal(default) keep compact cache (raw + db + jsonl/topics), no large VFS treeXLB_STORAGE_PROFILE=fullenable VFS folder/file materialization for folder-style browsingXLB_OUTPUT=jsonforce JSON output for no-query mode (returns raw file reference instead of full markdown text)XLB_FORCE_REINDEX=1force re-ingest even when cache hash unchangedXLB_PREFETCH_ARTIFACTS=1enable concurrent URL artifact prefetchXLB_MAX_WORKERS=6control prefetch concurrencyXLB_TOPK=8control returned hit countXLB_HTML_MODE=markdown|textchoose HTML conversion output formatXLB_HTML_CONVERTER_BIN=/path/to/scriptoptional external converter commandXLB_HTML_CONVERTER_TOOL_ID=url-to-markdowntool id passed to external converterXLB_HTML_CONVERT_TIMEOUT_SEC=20timeout for external converter executionXLB_ITERATIVE_SEARCH=1enable iterative retrieval summary outputXLB_MAX_ITER=5max iterative roundsXLB_GAIN_THRESHOLD=0.05low-gain thresholdXLB_LOW_GAIN_ROUNDS=3consecutive low-gain rounds before stopXLB_DISCOVER_CACHE_TTL_SEC=30capability discovery cache TTL (seconds)XLB_OPEN_HITS=1open top hit URLs after retrieval (local app automation)XLB_OPEN_APP=chrome|dia|atlas|defaulttarget app for opened URLsXLB_OPEN_LIMIT=1number of URLs to openXLB_OPEN_DRY_RUN=1print open plan only, do not trigger app actions
?? Multi-Topic Behavior
- For inputs like
xlb ??vibe coding(without retrieval query), the script returns a topic suggestion JSON. - Each topic item includes:
topic,count,samplesentry_query(for example>Vibe Coding/)entry_input(for examplexlb >Vibe Coding/)
- If multiple topics are returned, pick one
entry_inputand run it for focused retrieval.
Network Confirmation Policy
- Default is confirmation-required for expensive network expansion steps.
XLB_REQUIRE_NETWORK_CONFIRMATION=1(default): external route + prefetch disabled unless confirmed.XLB_NETWORK_CONFIRMED=1: allow network-expensive actions for current command.XLB_SHOW_CONFIRM_TEMPLATE=1(default): print standardized confirmation template to stderr when network expansion is blocked.- Default behavior without confirmation: only local index search + URL metadata output.
Example:
XLB_PREFETCH_ARTIFACTS=1 \
XLB_HTML_MODE=markdown \
XLB_HTML_CONVERTER_BIN=/path/to/url-convert.sh \
XLB_HTML_CONVERTER_TOOL_ID=url-to-markdown \
skills/xlb-topic-index/scripts/retrieve-topic-index.sh "xlb >vibe coding/coding" "agent skills"
Benchmark (before/after)
python3 skills/xlb-topic-index/bench/run_benchmark.py \
--queries-file skills/xlb-topic-index/bench/queries.txt \
--runs 3 \
--topk 8
Interop for Other Skills
- Cache contract reference:
skills/xlb-topic-index/references/cache-interop.md - Resolve user input to stable cache key:
python3 skills/xlb-topic-index/scripts/xlb_rag_pipeline.py resolve-input --input "xlb >vibe coding/coding"
- Export cache usage guide from meta:
python3 skills/xlb-topic-index/scripts/xlb_rag_pipeline.py describe-cache --meta-path "skills/xlb-topic-index/cache/index/<HASH>.meta.json" --format markdown
- Program-first data files:
skills/xlb-topic-index/cache/dataset/snap-<HASH>.nodes.jsonlskills/xlb-topic-index/cache/dataset/snap-<HASH>.topics.jsonskills/xlb-topic-index/cache/dataset/snap-<HASH>.navigation.json
Query Edge Semantics (for auto exploration)
searchinsection ->topic_navigationedges:- usually “related topics”, for example
>AI Model-> normalized executable>AI Model/
- usually “related topics”, for example
commandsection ->knowledge_searchedges:- executable knowledge-search commands, including bracket style like
search(>vibe coding/vibe)-> executable>vibe coding/vibe
- executable knowledge-search commands, including bracket style like
- External skill can choose either:
- follow
topic_navigationto jump to another topic - run
knowledge_searchto deepen inside current domain
- follow
- Prefer section-specific commands for efficient edge collection:
>topic/searchin:for topic-to-topic traversal>topic/command:for command/deep-search traversal
Auto Explore Command
- Use:
python3 skills/xlb-topic-index/scripts/xlb_rag_pipeline.py explore-next --meta-path "skills/xlb-topic-index/cache/index/<HASH>.meta.json" --strategy topic_first --dry-run
- Remove
--dry-runto execute next hop directly. - Useful flags:
--strategy topic_first|search_first|mixed--visited-file <path> --update-visitedto avoid repeated edges--include-other-queriesto allow??...style fallback edges
Explore Loop (dedupe + budget + priority)
- Use:
python3 skills/xlb-topic-index/scripts/xlb_rag_pipeline.py explore-loop --seed-input "xlb >vibe coding/:" --edge-strategy searchin_command_backlink --max-steps 12 --max-depth 4 --max-seconds 90 --visited-file /tmp/xlb-visited.json --visited-topics-file /tmp/xlb-visited-topics.json --update-visited
- Behavior:
- Auto uses
>topic/searchin:and>topic/command:to collect next edges. - Applies visited dedupe (
visited-file+visited-topics-file) to avoid loops. - Stops by budget (
max-steps/max-depth/max-seconds). - Edge priority default is
searchin -> command -> backlink.
- Auto uses
One-Click Wrapper
- Use:
skills/xlb-topic-index/scripts/xlb-auto-explore.sh "vibe coding"skills/xlb-topic-index/scripts/xlb-auto-explore.sh "xlb >vibe coding/:"skills/xlb-topic-index/scripts/xlb-auto-explore.sh "xlb auto vibe coding"
- Wrapper defaults:
- persistent visited files under
skills/xlb-topic-index/cache/ - strategy
searchin_command_backlink - budget
12 steps / depth 4 / 90s
- persistent visited files under
- Override with env vars:
XLB_AUTO_MAX_STEPS,XLB_AUTO_MAX_DEPTH,XLB_AUTO_MAX_SECONDSXLB_AUTO_EDGE_STRATEGY,XLB_AUTO_INCLUDE_BACKLINKS,XLB_AUTO_UPDATE_VISITED
Graph Backlink Query (->)
- Input:
xlb ->vibe coding/:
- Meaning:
- This is a server-side command and is passed through as
title=->vibe coding/:. retrieve-topic-index.shshould not local-intercept this command.
- This is a server-side command and is passed through as
- Local graph helper (explicit, optional):
python3 skills/xlb-topic-index/scripts/xlb_rag_pipeline.py graph-neighbors --index-dir skills/xlb-topic-index/cache/index --target-title "->vibe coding/:"- Used only when you explicitly want cache-based local graph exploration.
Error Handling
- API unreachable: report connection failure and suggest checking local service on port
5000. - Empty response: return a short warning and ask whether to retry with a broader command (for example
>Vibe Coding/). - Empty input only: ask user to provide any non-empty title command.
Weekly Installs
5
Repository
hhsw2015/xlb-skillFirst Seen
Feb 7, 2026
Security Audits
Installed on
opencode5
gemini-cli5
github-copilot5
codex5
amp5
kimi-cli5