2.6 KiB
2.6 KiB
name, description
| name | description |
|---|---|
| rrweb-sgrobot-adapter | Generate SGrobot-compatible PlanTemplate.toml and runtime SKILL.toml artifacts from rrweb semantic traces. Use when adapting recorded browser workflows, rrweb traces, semantic-trace JSON, or browser automation recordings for SGrobot/sgclaw plan_templates and .sgclaw-workspace skills without changing SGrobot core. |
RRWeb SGrobot Adapter
Use this skill to turn one rrweb semantic trace into SGrobot runtime artifacts:
plan_templates/<flow>/PlanTemplate.toml
.sgclaw-workspace/skills/<flow>-execute/SKILL.toml
.sgclaw-workspace/skills/<flow>-execute/scripts/execute_trace.js
.sgclaw-workspace/skills/<flow>-execute/trace.semantic.json
Do not treat SKILL.md as the SGrobot runtime artifact. In SGrobot:
PlanTemplate.tomlis the user-facing business task orchestration..sgclaw-workspace/skills/**/SKILL.tomlis the executable runtime skill..agents/skills/**/SKILL.mdis only an agent/Codex helper.
Workflow
- Read the semantic trace JSON and confirm it has
id,name,startUrl, and non-emptysteps. - Read references/sgrobot-adapter.md when you need SGrobot mapping details.
- Generate artifacts with:
node scripts/generate_sgrobot_flow.mjs \
--trace examples/basic-trace.json \
--out /path/to/sgrobot-architecture-design \
--default-mode dry-run
Use --default-mode execute only when the user explicitly wants the generated skill to mutate the target page. Generated execute-mode plans set requires_approval = true when the trace includes mutating actions.
- Inspect the generated
PlanTemplate.tomlandSKILL.tomlbefore handing off. The plan stepskills = ["..."]must match the generated[skill].name. - In a live SGrobot repo, verify
/api/debug/planssees the plan and/api/skillsees the skill before running the digital employee task.
Trace Shape
Minimal trace:
{
"id": "expense-approval",
"name": "费用审批",
"description": "打开审批页,填写意见并点击同意。",
"startUrl": "https://oa.example.test/expense/123",
"steps": [
{ "type": "assertText", "text": "费用审批", "label": "确认在审批页" },
{ "type": "fill", "selector": "textarea[name='comment']", "value": "同意", "label": "填写审批意见" },
{ "type": "click", "selector": "button[data-action='approve']", "label": "点击同意", "risk": "write" }
]
}
Supported first-version action types are assertText, extractText, click, fill, input, type, select, check, uncheck, and submit. Prefer stable CSS selectors; XPath is supported with xpath= or leading //.