bb-get-interface-template

SkillSearch

Reads the specified CBB / protocol wiki file, parses its ## Interface / ## Ports section, and returns a structured port table + parameter table. Used by bba-architect to fill in MAS module interfaces. Trigger scenarios: (1) fetching detailed interfaces after a bb-search-cbb hit; (2) explicit /bb-get

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-get-interface-template skill

What this skill tells your AI

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

职责

template_namewiki/cbb/wiki/protocols/ 中对应 .md,提取 ## Interface / ## Ports 表格 → JSON。

  • 调用者:bba-architect
  • 上游:bb-search-cbb / bb-search-protocol
  • 禁止使用:Task / Agent / Skill

Input Args

argtyperequired默认说明
template_namestringtrueCBB 或协议名(sync-fifo/uart/axi4-lite
sectionstringfalseinterfaceinterface | ports | parameters

Output Contract

field
artifact_path
template_namestr
source_filepath
ports[{name,direction,width,description}]
parameters[{name,default}]
validbool
errorstring|null

4-Phase 执行

Phase 1 — locate_template

scripts/locate_template.py:优先 wiki/cbb/<name>.md,其次 wiki/protocols/<name>.md;都不存在 → error="template not found: <name>"

Phase 2 — read_md

Python 直接读取目标文件全文(无需 shell)。

Phase 3 — parse_md_tables

scripts/parse_md_tables.py

  • 用 markdown 解析定位 ## Interface / ## Ports / ## Parameters 标题
  • 之后第一张表格按列名 name / direction / width / description 解析为 list[dict]
  • 类似处理 Parameters 表

Phase 4 — return

返回 JSON。bba-architectports 写到 MAS 对应模块的 interface.ports

收敛 / 失败

状态行动
valid=true写入 MAS
文件不存在error="template not found"
Section 找不到error="section <name> not found"
表格格式错error="malformed table";fallback:返回原始 markdown

资源索引

  • scripts/locate_template.pyscripts/parse_md_tables.py
  • references/wiki_section_conventions.md — wiki markdown 标题/表头约定

Signals

GitHub stars
44
Forks
10
Last commit
Aug 2026
Advanced
Catalog kind
skill
Gateway key
bb-get-interface-template
Source
github.com/amoslee2026/babel