bb-search-protocol

SkillSearch

Searches protocol knowledge in wiki/protocols/ (UART/AXI4-Lite/UCIe, etc.) and returns matching document paths with summaries. Trigger scenarios: (1) when bba-architect needs protocol specs while writing PRD/MAS; (2) explicit /bb-search-protocol.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the bb-search-protocol skill

What this skill tells your AI

The instructions your AI receives, as published by amoslee2026/babel in .claude/skills/bb-search-protocol/SKILL.md and read by ahel’s review.

职责

在项目 wiki/protocols/ 目录里按关键词搜索协议文档,返回匹配文件、行号、片段,供 bba-architect 用 Read 工具读取细节。

  • 调用者:bba-architect
  • 禁止使用:Task / Agent / Skill

Input Args

argtyperequired默认说明
patternstringtrue关键词(uart / axi4 / ucie
fieldstringfalse限定字段(baud / timing
max_resultsintfalse20最多返回条数

Output Contract

field
artifact_path— (inline 返回,不写文件)
matches[{file:path, line:int, snippet:str}]
countint
validbool

4-Phase 执行

Phase 1 — render_search_cmd

scripts/render_search.py 生成 rg 命令:

rg -i "<pattern>" wiki/protocols/ --include="*.md" -n -A 2 --max-count=<max_results>

如指定 field,叠加 && rg "<field>" 二次过滤。

Phase 2 — run_search

scripts/run_search.py

  1. timeout 30 bash -c "<cmd>" > /tmp/protocol_search_<stamp>.txt 2>&1
  2. 解析 rg file:line:content 三段格式

Phase 3 — parse_results

scripts/parse_results.py

  • 每行 <file>:<line>:<content> → 一条 match
  • 聚合相邻行作为 snippet
  • 统计 count

Phase 4 — return

返回 JSON。调用方 (bba-architect) 据 file 列表 Read 详细内容补充 PRD。

收敛 / 失败

状态行动
count>0有结果
count==0调用方放宽 pattern 重试;超 3 次记录 gap: <pattern> 入 MAS
rg 不可用退到 grep -r

MVP 覆盖

wiki/protocols/
├── uart.md
├── axi4-lite.md
└── ucie-overview.md  (planned, not yet available)

资源索引

  • scripts/render_search.pyscripts/run_search.pyscripts/parse_results.py
  • references/protocol_index.md — 已知协议清单

Signals

GitHub stars
42
Forks
10
Last commit
Aug 2026
Advanced
Catalog kind
skill
Gateway key
bb-search-protocol
Source
github.com/amoslee2026/babel