browser-record

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Browser Record

浏览器记录

Primitive on which every other browser skill composes. Opens a named browser session, allocates an RVF container for it, and binds every action to a ruvector trajectory step. You do not run a browser session in this plugin without invoking this skill (or one that wraps it).
这是所有其他浏览器技能构建的基础组件。它会打开一个命名的浏览器会话,为其分配RVF容器,并将每一个操作绑定到ruvector轨迹步骤。如果不调用此技能(或封装它的技能),请勿在此插件中运行浏览器会话。

When to use

使用场景

  • Starting any browser interaction that is not a one-off throwaway probe.
  • Exploring a site interactively while preserving the trace for later replay or analysis.
  • Establishing a reusable session that downstream skills (
    browser-extract
    ,
    browser-form-fill
    ,
    browser-test
    ) will compose.
  • 启动任何非一次性的浏览器交互操作。
  • 交互式浏览网站的同时保留操作轨迹,以便后续重放或分析。
  • 建立可复用的会话,供下游技能(
    browser-extract
    browser-form-fill
    browser-test
    )调用。

Steps

操作步骤

  1. Allocate session id and RVF container:
    bash
    SID="$(date +%Y%m%d-%H%M%S)-${TASK_SLUG:-record}"
    npx -y ruvector@0.2.25 rvf create "$SID.rvf" --kind browser-session
    npx -y ruvector@0.2.25 hooks trajectory-begin --session-id "$SID" --task "$1"
  2. Open the browser via
    mcp__claude-flow__browser_open
    with the URL.
  3. Snapshot the initial state:
    browser_snapshot
    for the accessibility tree,
    browser_screenshot
    for a baseline image.
  4. For each interaction, record a trajectory step before and after:
    bash
    npx -y ruvector@0.2.25 hooks trajectory-step \
      --session-id "$SID" --action click --args '{"selector":"#login"}' --result ok
  5. End cleanly:
    bash
    npx -y ruvector@0.2.25 hooks trajectory-end --session-id "$SID" --verdict pass
    npx -y ruvector@0.2.25 rvf compact "$SID.rvf"
  6. Index in AgentDB under
    browser-sessions
    :
    bash
    npx -y @claude-flow/cli@latest memory store --namespace browser-sessions \
      --key "$SID" --value "{rvf_id:$SID,host:...,task:...,verdict:pass}"
  1. 分配会话ID和RVF容器:
    bash
    SID="$(date +%Y%m%d-%H%M%S)-${TASK_SLUG:-record}"
    npx -y ruvector@0.2.25 rvf create "$SID.rvf" --kind browser-session
    npx -y ruvector@0.2.25 hooks trajectory-begin --session-id "$SID" --task "$1"
  2. 通过
    mcp__claude-flow__browser_open
    打开浏览器
    并访问指定URL。
  3. 快照初始状态:使用
    browser_snapshot
    获取可访问性树,使用
    browser_screenshot
    获取基准截图。
  4. 针对每一次交互,在操作前后记录轨迹步骤:
    bash
    npx -y ruvector@0.2.25 hooks trajectory-step \
      --session-id "$SID" --action click --args '{"selector":"#login"}' --result ok
  5. 干净结束会话:
    bash
    npx -y ruvector@0.2.25 hooks trajectory-end --session-id "$SID" --verdict pass
    npx -y ruvector@0.2.25 rvf compact "$SID.rvf"
  6. 在AgentDB的
    browser-sessions
    命名空间下建立索引
    :
    bash
    npx -y @claude-flow/cli@latest memory store --namespace browser-sessions \
      --key "$SID" --value "{rvf_id:$SID,host:...,task:...,verdict:pass}"

Caveats

注意事项

  • Until the
    browser_session_record
    MCP tool ships (ADR-0001 §7), this skill drives the lifecycle from inside its own bash steps. Do not call
    mcp__claude-flow__browser_open
    directly without these wrappers.
  • The session id format is fixed:
    <YYYYMMDD-HHMMSS>-<task-slug>
    . Downstream
    /ruflo-browser ls
    parses this.
  • --with-dom
    is expensive (full HTML dump per nav). Off by default.
  • AIDefence gates apply at extraction time, not at navigation time.
    browser-record
    is a primitive; redaction is the responsibility of skills that read content (
    browser-extract
    ,
    browser-test
    ).
  • browser_session_record
    MCP工具发布前(参考ADR-0001 §7),此技能通过自身的bash步骤驱动生命周期。请勿绕过这些封装直接调用
    mcp__claude-flow__browser_open
  • 会话ID格式固定:
    <YYYYMMDD-HHMMSS>-<task-slug>
    。下游的
    /ruflo-browser ls
    命令会解析此格式。
  • --with-dom
    选项开销较大(每次导航都会导出完整HTML),默认关闭。
  • AIDefence防护在提取阶段生效,而非导航阶段。
    browser-record
    是基础组件;内容脱敏由读取内容的技能(
    browser-extract
    browser-test
    )负责。