openclaw-rpa — Locale router (read this first)
GitHub: https://github.com/laziobird/openclaw-rpa — source, README, install, sample scripts under rpa/.
What this skill does
openclaw-rpa is an LLM-based RPA Agent framework. You describe a task in plain language; the AI executes it step by step in a real browser, on your computer, or via API services — with screenshot proof at every step — then compiles everything into a standalone Playwright Python script. Replay runs that script directly — no model call, no token burn, no hallucination risk — faster and cheaper than having the AI click every time.
Why this matters
- 1. Saves compute and money — Having a large model drive the browser on every run can cost roughly single-digit to tens of US dollars per heavy session (tokens, tools, long context). After you record once, repeat work does not call the model—replay is much faster and near-zero LLM cost for those steps.
- Verify once, run the same way every time — During recording you confirm the flow works; later, replay executes the saved steps deterministically. You avoid asking the AI to “do it again” on every run, which hurts consistency and raises hallucination risk.
What you can automate (record once, replay many times — follow each site’s terms and local law):
| Category | Examples |
|---|
| Browser | Login, navigate, click, fill forms, extract text, sort / filter tables |
| HTTP API |
GET /
POST any REST endpoint, save JSON, embed API keys directly in the script (
#rpa-api) |
|
Excel (.xlsx) | Create / update workbooks, multiple sheets, headers, freeze panes, dynamic rows from JSON or another file |
|
Word (.docx) | Generate reports with paragraphs and tables — no Microsoft Office required |
|
Auto-login | Save cookies once with
#rpa-login, auto-inject on every recording and replay — skip OTP / CAPTCHA / QR-code flows |
|
Mixed flows | Any combination above in a single recorded task (e.g. API + Excel + Word, or browser + login + extract) |
Recorded example scripts (under rpa/): onlineshoppingv1.py e-commerce · yahoonew.py Yahoo Finance news · apiv3.py Alpha Vantage API (NVDA daily JSON, no browser) · reconciliationv2.py / 会计记账v2.py AP reconciliation (GET → Excel match → Word table report) — full write-up: EN · CN.
When to use
| You want to… | Send |
|---|
| Start recording a new flow | INLINECODE13 , #RPA, #rpa, or mention Playwright automation |
| See saved tasks you can run |
#rpa-list |
|
Run a saved task (e.g. new chat) |
#rpa-run:{task name} |
|
Run in this chat |
run:{task name} (
zh-CN:
#run:{task-name}) |
Quick start (after install)
CODEBLOCK0
Full protocol, state machine, two-line signup (task name + capability A–G/N), deps-check / deps-install, record-step JSON, progressive probing, and selector strength (composite CSS — container + tag / attributes / :has(); avoid bare h3) live in the locale file below.
Output
Generated file is ordinary Python (rpa/*.py) — runs standalone with python3, editable, no OpenClaw dependency at replay time.
Scope
Browser — goto, click, fill, select_option, scroll, wait, snapshot, extract_text, dom_inspect.
HTTP API — api_call (httpx GET/POST, key embedding, save_response_to); independent of the browser page.
Local files — merge_files (concatenate Desktop files); extract_text writes to disk; patch rpa/*.py for folder / file ops after recording.
Excel / Word — excel_write (openpyxl, multi-sheet, dynamic rows from JSON or another file); word_write (python-docx, paragraphs + tables); no Microsoft apps required.
Computed logic — python_snippet injects arbitrary Python into the generated script; executed and validated at record time.
Out of scope — large ETL, databases, heavy OS automation.
Recommended sites
Good fits — predictable structure, works well out of the box:
| Category | Examples |
|---|
| Finance / data | Yahoo Finance, investing.com |
| E-commerce |
Sauce Demo (
saucedemo.com), AliExpress, eBay |
| News / media | BBC News, Reuters, Hacker News, Reddit listing pages |
| Reference | Wikipedia, GitHub public repo / issues pages |
Not recommended — likely to break or require manual intervention:
| Situation | Why | Workaround |
|---|
| Highly dynamic SPAs (heavy client-side routing) | Selectors shift between renders; snapshots may miss content | Use dom_inspect + scroll to locate stable selectors |
| CAPTCHA / bot-detection (reCAPTCHA, hCaptcha) |
Automation blocked; human verification required | — |
| Login-gated flows (password / SMS OTP / slider / QR code) | Credentials and 2FA must be handled manually |
Use #rpa-login to log in once manually → cookies saved automatically → #rpa-autologin injects them on every future recording and replay, skipping the login flow entirely |
Tip: on a new site, start with goto + snapshot to confirm the page structure is readable before building a full flow.
Mandatory: load the correct instruction file
- 1. Read
config.json in this skill directory. If it does not exist, read config.example.json (same shape; default locale is en-US). - Read the
"locale" field. Allowed values: zh-CN and en-US (repository default in config.example.json: en-US). - Immediately use the Read tool to load the full skill body:
-
zh-CN →
SKILL.zh-CN.md
-
en-US →
SKILL.en-US.md
- 4. Follow only that file for state machine, triggers,
record-step JSON, onboarding text, and user-facing replies.
- 5. Reply to the user in the active locale’s language:
-
zh-CN → Simplified Chinese for agent messages (user may still type English).
-
en-US → English for agent messages (user may still type Chinese).
Changing language
- - Copy
config.example.json → config.json if needed (python3 scripts/bootstrap_config.py), then edit "locale", or - Run:
python3 scripts/set_locale.py en-US / python3 scripts/set_locale.py zh-CN (creates config.json from the example when missing).
After a locale change, the agent should re-read the matching SKILL.*.md in a new turn or session. See README.md in this directory for the full workflow.
ClawHub / discovery
- - SKILL.md (this file): short router + when to use + quick start for listings like ClawHub.
- SKILL.zh-CN.md / SKILL.en-US.md: full onboarding, recording, RUN/LIST, and anti-timeout rules.
- Scenario doc: articles/scenario-ap-reconciliation.en-US.md · CN — AP reconciliation (GET-only mock API, local Excel, Word table output).
Relative paths
When the loaded file references playwright-templates.md, synthesis-prompt.md, or rpa_manager.py, resolve paths relative to this skill directory (parent of SKILL.md).
openclaw-rpa — 区域路由(请先阅读此文件)
GitHub: https://github.com/laziobird/openclaw-rpa — 源代码、README、安装说明、示例脚本位于 rpa/ 目录下。
此技能的功能
openclaw-rpa 是一个基于大语言模型的RPA代理框架。您用自然语言描述任务;AI在真实浏览器、您的计算机或通过API服务上逐步执行任务——每一步都附带截图证明——然后将所有内容编译成一个独立的Playwright Python脚本。回放时直接运行该脚本——无需调用模型、不消耗Token、无幻觉风险——比每次让AI点击更快、更便宜。
为何重要
- 1. 节省计算资源和费用——让大模型在每次运行时驱动浏览器,每次重度会话(Token、工具、长上下文)可能花费约个位数到数十美元。录制一次后,重复工作不再调用模型——回放快得多,且这些步骤的LLM成本接近零。
- 一次验证,每次运行一致——录制时您确认流程有效;之后回放确定性地执行保存的步骤。您避免了每次运行时让AI“再做一次”,这损害一致性并增加幻觉风险。
您可以自动化的内容(录制一次,多次回放——请遵守各网站条款和当地法律):
| 类别 | 示例 |
|---|
| 浏览器 | 登录、导航、点击、填写表单、提取文本、排序/筛选表格 |
| HTTP API |
对任意REST端点执行GET/POST、保存JSON、直接在脚本中嵌入API密钥(#rpa-api) |
|
Excel(.xlsx) | 创建/更新工作簿、多工作表、表头、冻结窗格、从JSON或其他文件动态生成行 |
|
Word(.docx) | 生成包含段落和表格的报告——无需Microsoft Office |
|
自动登录 | 使用#rpa-login一次性保存Cookie,在每次录制和回放时自动注入——跳过OTP/验证码/二维码流程 |
|
混合流程 | 单个录制任务中的任意组合(例如API + Excel + Word,或浏览器 + 登录 + 提取) |
录制的示例脚本(位于rpa/目录下):onlineshoppingv1.py电商 · yahoonew.py雅虎财经新闻 · apiv3.pyAlpha Vantage API(NVDA每日JSON,无需浏览器)· reconciliationv2.py / 会计记账v2.py应付账款对账(GET → Excel匹配 → Word表格报告)——完整文档:英文 · 中文
何时使用
| 您想要… | 发送 |
|---|
| 开始录制新流程 | #automation robot、#RPA、#rpa,或提及Playwright自动化 |
| 查看已保存的任务 |
#rpa-list |
|
运行已保存的任务(例如新对话) | #rpa-run:{任务名称} |
|
在当前对话中运行 | run:{任务名称}(中文:#run:{任务名称}) |
快速入门(安装后)
text
#rpa-list
#rpa-run:your-task-name
完整协议、状态机、两行注册(任务名称 + 能力 A–G/N)、deps-check / deps-install、record-step JSON、渐进式探测和选择器强度(复合CSS——容器 + 标签/属性/:has();避免裸h3)位于下方的区域文件中。
输出
生成的文件是普通Python(rpa/*.py)——可使用python3独立运行、可编辑,回放时无需OpenClaw依赖。
范围
浏览器——goto、click、fill、selectoption、scroll、wait、snapshot、extracttext、dom_inspect。
HTTP API——apicall(httpx GET/POST、密钥嵌入、saveresponse_to);独立于浏览器页面。
本地文件——mergefiles(合并桌面文件);extracttext写入磁盘;录制后修补rpa/*.py以进行文件夹/文件操作。
Excel / Word——excelwrite(openpyxl、多工作表、从JSON或其他文件动态生成行);wordwrite(python-docx、段落+表格);无需Microsoft应用程序。
计算逻辑——python_snippet将任意Python注入生成的脚本;在录制时执行并验证。
不包含——大型ETL、数据库、重度操作系统自动化。
推荐网站
适合——结构可预测,开箱即用效果良好:
| 类别 | 示例 |
|---|
| 金融/数据 | 雅虎财经、investing.com |
| 电商 |
Sauce Demo(saucedemo.com)、速卖通、eBay |
| 新闻/媒体 | BBC新闻、路透社、Hacker News、Reddit列表页面 |
| 参考 | 维基百科、GitHub公共仓库/问题页面 |
不推荐——可能出错或需要人工干预:
| 情况 | 原因 | 解决方法 |
|---|
| 高度动态的单页应用(重度客户端路由) | 选择器在渲染间变化;快照可能遗漏内容 | 使用dom_inspect + scroll定位稳定选择器 |
| 验证码/机器人检测(reCAPTCHA、hCaptcha) |
自动化被阻止;需要人工验证 | — |
| 需要登录的流程(密码/短信验证码/滑块/二维码) | 凭据和双重验证必须手动处理 |
使用#rpa-login手动登录一次→Cookie自动保存→#rpa-autologin在每次未来录制和回放时注入,完全跳过登录流程 |
提示: 在新网站上,先使用goto + snapshot确认页面结构可读,再构建完整流程。
必须:加载正确的指令文件
- 1. 读取此技能目录中的config.json。如果不存在,则读取config.example.json(相同结构;默认locale为en-US)。
- 读取locale字段。允许的值:zh-CN和en-US(仓库默认在config.example.json中:en-US)。
- 立即使用读取工具加载完整技能正文:
- zh-CN →
SKILL.zh-CN.md
- en-US →
SKILL.en-US.md
- 4. 仅遵循该文件中的状态机、触发器、record-step JSON、引导文本和面向用户的回复。
- 5. 使用当前区域设置的语言回复用户:
- zh-CN → 代理消息使用简体中文(用户仍可输入英文)。
- en-US → 代理消息使用英文(用户仍可输入中文)。
更改语言
- - 如有需要,复制config.example.json → config.json(python3 scripts/bootstrapconfig.py),然后编辑locale,或
- 运行:python3 scripts/setlocale.py en-US / python3 scripts/set_locale.py zh-CN(缺失时从示例创建config.json)。
更改区域设置后,代理应在新的轮次或会话中重新读取匹配的SKILL.*.md。有关完整工作流程,请参阅此目录中的README.md。
ClawHub / 发现
相对路径
当加载的文件引用playwright-templates.md、synthesis-prompt.md或rpa_manager.py时,请相对于此技能目录(SKILL.md的父目录)解析路径。