Agent Skillslangwatch/langwatch › drive-the-ui

drive-the-ui

GitHub

驱动用户当前打开页面的实时 UI 操作,列出并接受页面动作,通过键入负载调用并读取包括未保存编辑在内的实时状态。适用于需要在前端直接操作的评估工作台等场景。

skills/_compiled/native/drive-the-ui/SKILL.md langwatch/langwatch

Trigger Scenarios

用户正在查看可操作的页面(如评估工作台) 需要在用户面前执行 UI 变更而非后台处理 需要读取页面实时状态或未保存的草稿

Install

npx skills add langwatch/langwatch --skill drive-the-ui -g -y
More Options

Non-standard path

npx skills add https://github.com/langwatch/langwatch/tree/main/skills/_compiled/native/drive-the-ui -g -y

Use without installing

npx skills use langwatch/langwatch@drive-the-ui

指定 Agent (Claude Code)

npx skills add langwatch/langwatch --skill drive-the-ui -a claude-code -g -y

安装 repo 全部 skill

npx skills add langwatch/langwatch --all -g -y

预览 repo 内 skill

npx skills add langwatch/langwatch --list

SKILL.md

Frontmatter
{
    "name": "drive-the-ui",
    "license": "MIT",
    "metadata": {
        "category": "skill"
    },
    "description": "Drive the page the user has open through live UI actions. List the actions a page accepts, call them with typed payloads, and read the live state including unsaved edits. Use when the user is looking at a page you can operate, such as the evaluations workbench, and a change should happen in front of them rather than behind their back.",
    "compatibility": "Requires the LangWatch CLI inside a Langy worker session. UI actions run mid-turn only."
}

Drive the Page the User Has Open

Some pages accept live UI actions. When the turn context says the current page does, you can operate it directly: the action executes in the user's browser, they watch it happen, and the result comes back to you in the same command. When no browser answers, the platform applies the same action on the backend and tells you which happened.

The three commands

langwatch ui actions

Lists the action kinds the current page accepts, with the JSON schema for each payload and the permission it needs. Run it before your first call on a page; never guess a kind or a payload shape.

langwatch ui call <kind> --payload '<json>'
langwatch ui call <kind> --payload-file <path>   # or - for stdin

Calls one action and blocks until it is done. Use --payload-file for any payload holding text a person wrote, above all a prompt: prose has apostrophes, one apostrophe ends the shell's quoting, and the rest of the payload then arrives as separate arguments, which the command refuses. Write the JSON to a file first, or pipe it in. Keep --payload for payloads that are only ids and numbers.

The result carries executedVia:

  • "browser": the user's open page applied it. They saw it happen.
  • "backend": no page answered, the platform applied it to the saved state. The page has not caught up.

Say where the change happened. When you report work you did, name the place, because those are two different places for the reader. "browser" means it is on the page in front of them, so point at it: "the new column is on your table now". "backend" means it is on the saved workbench and their page is behind, so tell them that: "I made it on the saved workbench, so your page is a step behind". Do not tell them to reload. A page with no unsaved edits catches up on its own, and a page that has unsaved edits shows a stale banner and lets them choose, because a reload discards what they wrote. This is not decoration. A reader watching a page they think is current, which is not, will read stale numbers and believe them.

Say it once for a run of work, not once per call. A loop that made six changes reports where the six landed, not six sentences.

Only claim the page shows something when executedVia said "browser" for that action. If you did not read executedVia, say nothing about the page at all. Guessing wrong here is worse than staying quiet, because the reader trusts what you tell them about their own screen.

executedVia names the path that ran the action, not the outcome. The write landed only when the answer's result names what it touched, such as the new target id, the model, or the row count. When result names nothing, read the state again before you build on it.

langwatch workbench get-state <experiment-slug>

The workbench read, sugar over ui call workbench.getState. Browser first, so it includes unsaved prompt drafts and in-memory results; falls back to the saved state and marks the source. Use it before you change anything and after anything surprising.

All three print the platform's answer as JSON already, so parse what they print. They also take --format, -o and --jq like every other command, which is how you ask for less than the whole answer.

Rules

  • UI actions run mid-turn only. Outside a turn the call is refused with langy_ui_turn_inactive.
  • One action, one intent. Do not chain ui call with other commands; run it alone so the result is attributable.
  • On langy_ui_payload_invalid, read meta.issues, fix the payload, and retry once.
  • On langy_ui_timeout, the page claimed the action and went silent. Do not retry blind: re-read the state first, the action may have half-applied.
  • Your edits are undoable by the user with ordinary undo, and every batch lands as a restorable version. Do not undo or restore on their behalf.
  • The action's permission is enforced on your session key. A refusal means the user's own role does not allow it; say so, do not look for another way in.

Workbench action kinds

workbench.duplicateTarget, workbench.setTargetPrompt, workbench.updateTargetModel, workbench.setMapping, workbench.setEvaluatorMapping, workbench.addEvaluator, workbench.addTarget, workbench.setCellValue, workbench.addColumn, workbench.addRows, workbench.removeTarget, workbench.getState, workbench.run.

For the prompt improvement loop that uses these, follow the prompt-optimization skill.

Trace Explorer action kinds

explorer.setFilter, explorer.setTimeRange, explorer.setLens, explorer.setSort, explorer.setPage, explorer.select, explorer.getState, explorer.runInstantEval.

With no Explorer open, explorer.setFilter, explorer.setTimeRange and explorer.setLens answer executedVia: "backend" with an href to the Explorer in that state, and the card links there as "View in Trace Explorer". explorer.getState answers source: "saved" with the defaults and no count. The other kinds need an open page and are refused with langy_ui_no_browser.

For choosing between driving the Explorer and answering with cards, follow the find-traces skill.

Version History

  • c106e86 Current 2026-09-22 23:39
  • 6f9d4a4 2026-08-28 21:10

Same Skill Collection

.claude/skills/browser-pair/SKILL.md
.claude/skills/browser-test/SKILL.md
.claude/skills/code-review/SKILL.md
.claude/skills/feature-map/SKILL.md
.claude/skills/haven-setup/SKILL.md
.claude/skills/langwatch-kanban/SKILL.md
plugins/langwatch/skills/langwatch/SKILL.md
services/langy-agent/skills/github/SKILL.md
skills/_compiled/native/agent-best-practices/SKILL.md
skills/_compiled/native/agent-performance/SKILL.md
skills/_compiled/native/code-changes/SKILL.md
skills/_compiled/native/context-sweet-spot/SKILL.md
skills/_compiled/native/dashboard-widgets/SKILL.md
skills/_compiled/native/datasets/SKILL.md
skills/_compiled/native/debug-instrumentation/SKILL.md
skills/_compiled/native/debug-with-langwatch/SKILL.md
skills/_compiled/native/eval-triage/SKILL.md
skills/_compiled/native/evaluate-multimodal/SKILL.md
skills/_compiled/native/evaluations/SKILL.md
skills/_compiled/native/experiments/SKILL.md
skills/_compiled/native/find-traces/SKILL.md
skills/_compiled/native/generate-rag-dataset/SKILL.md
skills/_compiled/native/github/SKILL.md
skills/_compiled/native/guided-onboarding/SKILL.md
skills/_compiled/native/level-up/SKILL.md
skills/_compiled/native/lwql-charts/SKILL.md
skills/_compiled/native/online-evaluations/SKILL.md
skills/_compiled/native/prompt-optimization/SKILL.md
skills/_compiled/native/prompts/SKILL.md
skills/_compiled/native/provider-cost-comparison/SKILL.md
skills/_compiled/native/setup-lw/SKILL.md
skills/_compiled/native/test-cli-usability/SKILL.md
skills/_compiled/native/test-compliance/SKILL.md
skills/_compiled/native/tracing/SKILL.md
skills/_compiled/native/connect-agent/SKILL.md
skills/_compiled/native/scenarios/SKILL.md

Metadata

Files
0
Version
c106e86
Hash
902ba8e5
Indexed
2026-08-28 21:10

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-23 19:39
浙ICP备14020137号-1