The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
docs(i18n): zh-Hans skill pages follow the browser_exec rewrite
Tekniume75b30a98631
diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/bundled/creative/creative-popular-web-designs.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/bundled/creative/creative-popular-web-designs.mdindex 39eae5a594d..892a8bb48bc 100644--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/bundled/creative/creative-popular-web-designs.md+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/bundled/creative/creative-popular-web-designs.md@@ -46,7 +46,7 @@ description: "54 个真实设计系统(Stripe、Linear、Vercel)的 HTML/CSS每个模板顶部都包含一个 **Hermes 实现说明** 块,内容包括:- CDN 字体替代方案及 Google Fonts `<link>` 标签(可直接粘贴)- 主字体和等宽字体的 CSS font-family 栈-- 提醒使用 `write_file` 创建 HTML 文件,使用 `browser_vision` 进行验证+- 提醒使用 `write_file` 创建 HTML 文件,使用 `browser_exec`(`capture_screenshot()`)进行验证## HTML 生成模式@@ -84,7 +84,7 @@ description: "54 个真实设计系统(Stripe、Linear、Vercel)的 HTML/CSS</html>```-使用 `write_file` 写入文件,通过 `generative-widgets` 工作流(cloudflared tunnel)提供服务,并使用 `browser_vision` 验证结果以确认视觉准确性。+使用 `write_file` 写入文件,通过 `generative-widgets` 工作流(cloudflared tunnel)提供服务,并使用 `browser_exec` 验证结果:打开页面,执行 `capture_screenshot()`,查看截图以确认视觉准确性。## 字体替代参考diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/bundled/productivity/productivity-airtable.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/bundled/productivity/productivity-airtable.mdindex f1832338428..824542b80fb 100644--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/bundled/productivity/productivity-airtable.md+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/bundled/productivity/productivity-airtable.md@@ -235,7 +235,7 @@ done## Hermes 重要说明-- **始终使用 `terminal` 工具配合 `curl`。** 不要使用 `web_extract`(无法发送认证头)或 `browser_navigate`(需要 UI 认证且速度慢)。+- **始终使用 `terminal` 工具配合 `curl`。** 不要使用 `web_extract`(无法发送认证头)或 `browser_exec`(需要 UI 认证且速度慢)。- **`AIRTABLE_API_KEY` 会在此 skill 加载时自动从 `~/.hermes/.env` 注入到子进程环境中**——每次 `curl` 调用前无需重新导出。- **在公式中谨慎转义花括号。** 在 heredoc 请求体中,`{Status}` 是字面量。在 shell 参数中,`{Status}` 在 `{...}` 大括号展开上下文之外是安全的——但在拼接到 URL 之前,动态字符串应通过 `python3 urllib.parse.quote` 处理。- **使用 `python3 -m json.tool` 格式化输出**(始终可用),而非 `jq`(可选)。仅在需要过滤/投影时才使用 `jq`。diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/bundled/software-development/software-development-dogfood.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/bundled/software-development/software-development-dogfood.mdindex 2809c0ab109..cfcc210ea45 100644--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/bundled/software-development/software-development-dogfood.md+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/bundled/software-development/software-development-dogfood.md@@ -30,11 +30,11 @@ description: "网页应用探索性 QA:发现缺陷、收集证据、生成报## 概述-本 skill 指导你使用浏览器工具集对网页应用进行系统化探索性 QA 测试。你将浏览应用、与元素交互、收集问题证据,并生成结构化缺陷报告。+本 skill 指导你使用 `browser_exec` 对网页应用进行系统化探索性 QA 测试。你将浏览应用、与元素交互、收集问题证据,并生成结构化缺陷报告。## 前提条件-- 浏览器工具集必须可用(`browser_navigate`、`browser_snapshot`、`browser_click`、`browser_type`、`browser_vision`、`browser_console`、`browser_scroll`、`browser_back`、`browser_press`)+- 必须启用 `browser` 工具集(`browser_exec`)。`browser_exec` 运行 Python,并预先导入了辅助函数(`new_tab`、`goto_url`、`wait_for_load`、`page_info`、`js`、`fill_input`、`click_at_xy`、`capture_screenshot`、`cdp`);浏览器状态在多次调用之间保留,Python 变量则不保留。- 用户提供目标 URL 和测试范围## 输入@@ -68,52 +68,55 @@ description: "网页应用探索性 QA:发现缺陷、收集证据、生成报### 阶段 2:探索-针对计划中的每个页面或功能:--1. **导航**至该页面:+将每一步的操作合并到一次 `browser_exec` 调用中。针对计划中的每个页面或功能:++1. **安装控制台钩子后再导航。** 在导航前先在标签页上注册钩子,这样页面加载期间抛出的错误也能被捕获:+ ```python+ # Open page with console-error capture+ HOOK = """window.__qa_errors = [];+ const _e = console.error;+ console.error = (...a) => { window.__qa_errors.push(a.map(String).join(' ')); _e(...a); };+ addEventListener('error', e => window.__qa_errors.push('uncaught: ' + e.message));+ addEventListener('unhandledrejection', e => window.__qa_errors.push('rejection: ' + String(e.reason)));"""+ new_tab('about:blank') # first call only: the hook binds to the current tab+ cdp('Page.addScriptToEvaluateOnNewDocument', source=HOOK)+ goto_url("https://example.com/page")+ wait_for_load()+ print(page_info())+ print(js('window.__qa_errors || []'))```- browser_navigate(url="https://example.com/page")+ 之后任何会导航的调用,都要在开头重新注册钩子。静默 JS 错误是高价值发现。++2. **读取页面结构** — 列出可见的交互元素及其视口中心坐标(需要角色/名称时,使用 `cdp('Accessibility.getFullAXTree')` 并在 Python 中过滤):+ ```python+ # List interactive elements+ print(js("""(() => [...document.querySelectorAll('a,button,input,select,textarea,[role=button]')]+ .filter(e => e.offsetParent).slice(0, 80).map((e, i) => { const r = e.getBoundingClientRect();+ return {i, tag: e.tagName, text: (e.innerText || e.value || e.getAttribute('aria-label') || '').trim().slice(0, 60),+ id: e.id, name: e.name, x: Math.round(r.x + r.width / 2), y: Math.round(r.y + r.height / 2)}; }))()"""))```-2. **获取快照**以了解 DOM 结构:- ```- browser_snapshot()- ```+3. **直观评估页面**:调用 `capture_screenshot()`,查看附带的图片,检查布局问题、损坏的元素或无障碍问题。如果你的模型无法查看图片,请将打印出的路径传给 `vision_analyze`。-3. **检查控制台**中的 JavaScript 错误:- ```- browser_console(clear=true)- ```- 每次导航后及每次重要交互后都应执行此操作。静默 JS 错误是高价值发现。--4. **获取带标注的截图**,以直观评估页面并识别交互元素:- ```- browser_vision(question="Describe the page layout, identify any visual issues, broken elements, or accessibility concerns", annotate=true)- ```- `annotate=true` 标志会在交互元素上叠加编号标签 `[N]`。每个 `[N]` 对应后续浏览器命令中的引用 `@eN`。--5. **系统化测试交互元素**:- - 点击按钮和链接:`browser_click(ref="@eN")`- - 填写表单:`browser_type(ref="@eN", text="test input")`- - 测试键盘导航:`browser_press(key="Tab")`、`browser_press(key="Enter")`- - 滚动内容:`browser_scroll(direction="down")`+4. **系统化测试交互元素**:+ - 点击按钮和链接:`js("document.querySelector('#submit').click()")`,或使用第 2 步得到的中心坐标调用 `click_at_xy(x, y)`+ - 填写表单:`fill_input('input[name=email]', 'test input')`+ - 测试键盘导航:`cdp('Input.dispatchKeyEvent', type='keyDown', key='Tab', code='Tab', windowsVirtualKeyCode=9)`,随后发送对应的 `keyUp`,再用 `js('document.activeElement.outerHTML.slice(0, 200)')` 查看焦点落在何处;`key='Enter'`、`code='Enter'`、`windowsVirtualKeyCode=13` 同理+ - 滚动内容:`js('window.scrollBy(0, 800)')`+ - 后退:`js('history.back()')`,然后 `wait_for_load()`- 使用无效输入测试表单验证- 测试空提交-6. **每次交互后**,检查:- - 控制台错误:`browser_console()`- - 视觉变化:`browser_vision(question="What changed after the interaction?")`- - 预期行为与实际行为+5. **每次交互后**,在同一次调用中检查:+ - 控制台错误:`print(js('window.__qa_errors || []'))`+ - 视觉变化:`capture_screenshot()` 并与上一张截图对比+ - 预期行为与实际行为(`page_info()`,或用 `js()` 读取相关元素)### 阶段 3:收集证据对于发现的每个问题:-1. **截图**以记录问题:- ```- browser_vision(question="Capture and describe the issue visible on this page", annotate=false)- ```- 保存响应中的 `screenshot_path` — 将在报告中引用它。+1. **截图**以记录问题:`capture_screenshot()` 会打印保存路径。将其复制到 `{output_dir}/screenshots/` 并使用描述性文件名(例如 `issue-03-broken-login.png`)— 将在报告中引用它。2. **记录详情**:- 问题发生的 URL@@ -157,22 +160,26 @@ description: "网页应用探索性 QA:发现缺陷、收集证据、生成报## 工具参考-| 工具 | 用途 |+以上所有浏览器操作都是 `browser_exec` 调用;下表列出上文用到的辅助函数和惯用写法。++| 操作 | `browser_exec` 惯用写法 ||------|---------|-| `browser_navigate` | 跳转至指定 URL |-| `browser_snapshot` | 获取 DOM 文本快照(无障碍树) |-| `browser_click` | 通过引用(`@eN`)或文本点击元素 |-| `browser_type` | 在输入框中输入文字 |-| `browser_scroll` | 在页面上向上/向下滚动 |-| `browser_back` | 在浏览器历史中后退 |-| `browser_press` | 按下键盘按键 |-| `browser_vision` | 截图 + AI 分析;使用 `annotate=true` 显示元素标签 |-| `browser_console` | 获取 JS 控制台输出和错误 |+| 跳转至指定 URL | 先调用一次 `new_tab(url)`(或在注册钩子前调用 `new_tab('about:blank')`),之后用 `goto_url(url)`;随后调用 `wait_for_load()` |+| 页面状态 | `page_info()` |+| DOM / 无障碍树 | 用 `js(...)` 提取,或 `cdp('Accessibility.getFullAXTree')` 并在 Python 中过滤 |+| 点击 | `js("document.querySelector(sel).click()")` 或 `click_at_xy(x, y)` |+| 在输入框中输入文字 | `fill_input(selector, text)` |+| 滚动 | `js('window.scrollBy(0, 800)')` |+| 后退 | `js('history.back()')` |+| 按下按键 | `cdp('Input.dispatchKeyEvent', type='keyDown', key=..., code=..., windowsVirtualKeyCode=...)` + `keyUp` |+| 截图 | `capture_screenshot()`(图片附在结果中;纯文本模型对该路径使用 `vision_analyze`) |+| JS 控制台错误 | 通过 `cdp('Page.addScriptToEvaluateOnNewDocument', source=HOOK)` 挂钩,用 `js('window.__qa_errors || []')` 读取 |## 使用技巧-- **每次导航后及重要交互后,务必执行 `browser_console()`。** 静默 JS 错误是最有价值的发现之一。-- **在需要推断交互元素位置或快照引用不清晰时,对 `browser_vision` 使用 `annotate=true`。**+- **每次导航后及重要交互后,务必读取 `window.__qa_errors`。** 静默 JS 错误是最有价值的发现之一。+- **将每个子流程合并到一次 `browser_exec` 调用中**(导航、等待、提取、操作、检查错误)— 减少往返次数,且钩子保持有效。+- **需要推断元素位置或 DOM 提取结果不明确时,执行 `capture_screenshot()`**;`click_at_xy` 使用元素列表中的中心坐标。- **使用有效和无效输入分别测试** — 表单验证缺陷十分常见。- **滚动浏览长页面** — 折叠线以下的内容可能存在渲染问题。- **测试导航流程** — 端到端点击多步骤流程。diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-3-statement-model.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-3-statement-model.mdindex 72ec76c9196..55e20310bae 100644--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-3-statement-model.md+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-3-statement-model.md@@ -442,7 +442,7 @@ description: "在 Excel 中构建完整集成的三表模型(利润表、资- **否则**,回退至:- 针对 SEC EDGAR(`https://www.sec.gov/cgi-bin/browse-edgar`)使用 `web_search` / `web_extract` 获取美国申报文件- 公司投资者关系页面获取新闻稿、业绩演示文稿- - `browser_navigate` 访问交互式数据门户+ - `browser_exec` 访问交互式数据门户- 用户提供的数据(当上下文中没有时,明确询问)- **绝不捏造数据**。如果某个倍数、前例或申报数字无法溯源,将该单元格标记为 `[UNSOURCED]` 并向用户说明。diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-comps-analysis.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-comps-analysis.mdindex 4f4e2052cf5..392bc41904e 100644--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-comps-analysis.md+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-comps-analysis.md@@ -673,7 +673,7 @@ ROA = 净利润 / 总资产- **否则**,回退到:- 针对 SEC EDGAR(`https://www.sec.gov/cgi-bin/browse-edgar`)使用 `web_search` / `web_extract` 获取美国文件- 公司投资者关系页面获取新闻稿、财报演示文稿- - 使用 `browser_navigate` 访问交互式数据门户+ - 使用 `browser_exec` 访问交互式数据门户- 用户提供的数据(当上下文中没有时,明确询问)- **绝不捏造数据**。如果某个倍数、先例或文件数字无法溯源,将该单元格标记为 `[UNSOURCED]` 并向用户说明。diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-dcf-model.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-dcf-model.mdindex c55c9d79e24..1539ff29cb5 100644--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-dcf-model.md+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-dcf-model.md@@ -1279,7 +1279,7 @@ WACC = (Cost of Equity × Equity Weight) + (After-tax Cost of Debt × Debt Weigh- **否则**,回退到:- 针对 SEC EDGAR(`https://www.sec.gov/cgi-bin/browse-edgar`)使用 `web_search` / `web_extract` 获取美国文件- 公司 IR 页面获取新闻稿、财报演示文稿- - `browser_navigate` 用于交互式数据门户+ - `browser_exec` 用于交互式数据门户- 用户提供的数据(当上下文中没有时明确询问)- **绝不捏造数据**。如果某个倍数、先例或文件数字无法获取来源,将该单元格标记为 `[UNSOURCED]` 并向用户说明。diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-lbo-model.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-lbo-model.mdindex 2caee766a3d..04acddac95f 100644--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-lbo-model.md+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-lbo-model.md@@ -300,7 +300,7 @@ python /path/to/excel-author/scripts/recalc.py model.xlsx- **否则**,回退到:- 针对 SEC EDGAR(`https://www.sec.gov/cgi-bin/browse-edgar`)使用 `web_search` / `web_extract` 获取美国文件- 公司 IR 页面获取新闻稿、财报演示文稿- - 使用 `browser_navigate` 访问交互式数据门户+ - 使用 `browser_exec` 访问交互式数据门户- 用户提供的数据(当上下文中没有时,明确询问)- **绝不捏造数据**。如果某个倍数、前例或文件数字无法溯源,将该单元格标记为 `[UNSOURCED]` 并向用户说明。diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-merger-model.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-merger-model.mdindex f54c29a9a4b..80cf6e804e1 100644--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-merger-model.md+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/finance/finance-merger-model.md@@ -153,7 +153,7 @@ description: "在 Excel 中构建增厚/摊薄(并购)模型 — 备考损- **否则**,回退至:- 针对 SEC EDGAR(`https://www.sec.gov/cgi-bin/browse-edgar`)使用 `web_search` / `web_extract` 获取美国文件- 公司投资者关系页面获取新闻稿、财报材料- - 使用 `browser_navigate` 访问交互式数据门户+ - 使用 `browser_exec` 访问交互式数据门户- 用户提供的数据(当上下文中没有时,明确向用户询问)- **严禁捏造数据**。如果某个倍数、前例交易或文件数字无法溯源,将该单元格标记为 `[UNSOURCED]` 并告知用户。diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/web-development/web-development-page-agent.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/web-development/web-development-page-agent.mdindex f2a50bf4b79..752d5480a70 100644--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/web-development/web-development-page-agent.md+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/user-guide/skills/optional/web-development/web-development-page-agent.md@@ -44,7 +44,7 @@ alibaba/page-agent(https://github.com/alibaba/page-agent,17k+ stars,MIT)## 何时不应使用此 skill-- 用户希望 **Hermes 本身驱动浏览器** → 使用 Hermes 内置的浏览器工具(Browserbase / Camofox)。page-agent 是*相反*的方向。+- 用户希望 **Hermes 本身驱动浏览器** → 使用 Hermes 内置的 `browser_exec` 工具(本地 Chromium 或云端浏览器)。page-agent 是*相反*的方向。- 用户希望**在不嵌入的情况下实现跨标签页自动化** → 使用 Playwright、browser-use 或 page-agent Chrome 扩展- 用户需要**视觉定位 / 截图** → page-agent 仅支持文本 DOM;请改用多模态浏览器 agent