Skip to content

docs(skill): 补全 bb-browser skill 文档,新增 site/fetch/network/adapter 参考文档#25

Merged
yan5xu merged 1 commit intoepiral:mainfrom
aquaqu-v246:feat/update-skill-docs
Mar 22, 2026
Merged

docs(skill): 补全 bb-browser skill 文档,新增 site/fetch/network/adapter 参考文档#25
yan5xu merged 1 commit intoepiral:mainfrom
aquaqu-v246:feat/update-skill-docs

Conversation

@aquaqu-v246
Copy link
Copy Markdown
Contributor

变更内容

bb-browser 的 skill 文档之前只覆盖了基础浏览器操作,缺少 site 系统、fetch、network 高级功能、adapter 开发等核心特性的说明。本 PR 补全这些内容。

修改文件

skills/bb-browser/SKILL.md(更新)

  • 新增 Site 系统章节:快速示例、命令速查,链接到详细参考文档
  • 新增 fetch 命令章节:带登录态的 curl,基本用法示例
  • 补充 snapshot 高级选项:-c(紧凑)、-d(深度)、-s(选择器)
  • 补充全局 --tab 选项说明
  • 新增 MCP 集成章节:启动方式和配置示例
  • 补充 network 高级功能:请求拦截、mock、API 逆向工程
  • description 更新,涵盖 site 系统和高级功能

skills/bb-browser/references/site-system.md(新增)

  • 35 平台完整列表(搜索引擎、社交媒体、技术开发、视频、财经等)
  • 命令速查、参数传递格式
  • Adapter 目录结构与优先级
  • 自动 tab 管理机制
  • 错误处理与登录提示

skills/bb-browser/references/fetch-and-network.md(新增)

  • fetch 完整选项和自动域名路由机制
  • network requests/route/unroute/clear 详解
  • API 逆向工程工作流(fetch + network 组合用法)

skills/bb-browser/references/adapter-development.md(新增)

  • 开发流程:逆向 API → 测试 fetch → 编写 adapter → 测试 → 贡献社区
  • 三层复杂度示例:Tier 1(Cookie)、Tier 2(Bearer+CSRF)、Tier 3(Webpack 注入)
  • 元数据格式(/* @meta */ 块)详细说明
  • 错误处理规范

设计原则

遵循 skill 渐进式披露模式:

  • SKILL.md 控制在 360 行以内,只放核心用法和快速参考
  • 详细内容拆分到 4 个 references 文件,按需加载
  • 所有文档中的结论均有源码证据链支持(注释标注了对应的源文件和行号)

- 更新 SKILL.md:新增 site 系统、fetch 命令、snapshot 高级选项、全局 --tab、MCP 集成、network 高级功能
- 新增 references/site-system.md:35 平台完整列表、自动 tab 管理、参数传递、错误处理
- 新增 references/fetch-and-network.md:带登录态 fetch、域名路由、请求拦截与 mock、API 逆向工程工作流
- 新增 references/adapter-development.md:三层复杂度指南、元数据格式、测试与贡献流程

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yan5xu
Copy link
Copy Markdown
Collaborator

yan5xu commented Mar 15, 2026

Review

整体质量很好,文档结构清晰,三个 reference 文档拆分合理。几个需要更新的点:

需要修改

  1. 数据过时:SKILL.md description 和 site-system.md 引用了 "35 平台 97 命令",v0.5.0 已更新为 36 平台 103 命令(新增了雪球 xueqiu 6 个 adapter)

  2. 缺少 v0.5.0 新功能

    • site recommend — 基于浏览历史推荐 adapter(核心 onboarding 命令)
    • site info <name> — 查看 adapter 详情(参数、示例、域名)
    • --jq <expr> — 内联 JSON 过滤(如 --jq '.items[].name'
    • history search/domains — 查询浏览历史

    这些应该加到 SKILL.md 的 site 系统部分和全局选项中。特别是 --jq,它对 Agent 很有用。

  3. site-system.md 财经分类缺少雪球

    | Xueqiu | `site xueqiu/stock SH600519` | 股票行情 |
    | Xueqiu | `site xueqiu/hot-stock` | 人气榜 |
    
  4. SKILL.md 应该引导 Agent 优先用 site 命令:当前 "快速开始" 直接教 open + snapshot。建议在前面加一段:

    ## 快速开始(优先使用 site 命令)
    
    大多数数据获取任务无需手动操作浏览器:
    bb-browser site recommend     # 看看有哪些可用
    bb-browser site zhihu/hot     # 直接获取数据
    bb-browser site info <name>   # 查看具体用法
    

可选优化

  1. <!-- 证据来源 --> 注释很好,但行号可能随代码变动而失效。建议改为函数名引用(如 parseSiteMeta())而非行号

  2. adapter-development.md 的错误处理部分可以加上 v0.5.0 的三字段规范:error + hint + action(参见 AGENTS.md)

其他内容很扎实,fetch/network 文档特别全面。更新以上几点后可以 merge。

@yan5xu
Copy link
Copy Markdown
Collaborator

yan5xu commented Mar 18, 2026

Great work on the documentation — the structure is well-organized and the source code evidence annotations show thorough research. A few things to fix before merging:

Accuracy issues

  1. fetch --json appears to be dead code — in fetch.ts, the options.json parameter is never actually used in the function body. Please verify and either remove from docs or fix the code.

  2. Missing global options — the "全局选项" section only lists --json, --tab, --mcp, but --port, --openclaw, and --jq are also global options (see index.ts lines 93-99). Especially --jq is very useful for AI agent workflows.

  3. Missing commands:

    • site info and site recommend subcommands are in the code but not in SKILL.md's site section
    • history search and history domains commands are completely absent from the docs
  4. snapshot-refs.md not updated — SKILL.md adds -c, -d, -s snapshot options but the reference doc wasn't updated to match.

Content concerns

  1. "无需提供密码或 Cookie" was removed — this security-relevant information was compressed out of the core value proposition. Please restore it.

  2. No mention of CDP direct mode — v0.8.x introduced --port CDP direct connection as a major architectural change. The docs should at least briefly mention both connection modes (extension vs CDP direct).

Minor suggestions

  1. Source code line numbers in HTML comments (<!-- site.ts:56-118 -->) will go stale quickly. Consider referencing only function/module names instead.

  2. Some warning-level content lost its **bold** formatting — please keep emphasis on safety-critical notes like "操作完成后必须关闭自己打开的 tab".

Thanks for the thorough work! Looking forward to the revision.

@yan5xu yan5xu merged commit d65f3c3 into epiral:main Mar 22, 2026
yan5xu added a commit that referenced this pull request Mar 22, 2026
- #82: extract EXEC_TIMEOUT_BUFFER_MS constant for magic number 5000
- #91: remove failed tabs from sessionOpenedTabs to prevent stale entries
- #25: update platform/command counts from 35/97 to 36/103

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants