agentleFS
selamy-labsselamy-labs/agent-skills/skills/agent-drives-ui/SKILL.md

agent-drives-ui

Skill0 starsChanged 6 days agoMITView on GitHub

Use when an agent operates a UI on the user's behalf through conversation, navigating, filling forms, updating live views, with real-time bi-directional state sync. Activates on conversational app control, agent drives the front end, agentic UX, or choosing an agent-to-app protocol.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Stream, don't block: Use the event stream (SSE) so the UI reacts in real time as the agent works — partial messages, intermediate state …

    line 34
  2. Distinctive:

    Human-in-the-loop on consequential actions: Use the protocol's approval events for anything irreversible/outward-facing.

    line 35
  3. Very specific:

    Use: when an agent should operate an app for the user (conversational campaign/CRM/ops management, a "virtual employee" driving tools, …

    line 39
  4. Distinctive:

    No approval gate on destructive actions → an agent confidently doing the wrong irreversible thing.

    line 45

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Agent Drives the UI (AG-UI pattern)

A UX where the agent operates the application for the user through conversation: the user says "go to Atlas and show this address" and the agent drives the map + street view; "set the campaign time" and events appear in the live calendar instantly. The agent isn't just chatting beside the app — it drives the app, and the UI stays in real-time sync both ways.

Adopt an open protocol — don't invent one

Drive the app over an open, standardized agent-to-UI protocol rather than a bespoke websocket scheme. The properties that matter for this layer:

  • Open, lightweight, bi-directional connection between a user-facing app and any agent backend.
  • A single event stream over standard HTTP / SSE (with an optional binary channel).
  • Event types covering messages, tool calls, state patches, and lifecycle signals.
  • Shared state: bi-directional sync of agent ↔ application state (read/write or read-only).
  • Frontend tool calls (agent invokes UI actions), human-in-the-loop approvals, and session management.
  • Backend-agnostic, with first-class client SDKs.

The reference implementation of this layer is the AG-UI (Agent–User Interaction Protocol). Prefer an established protocol with these properties over rolling your own; evaluate a declarative/generative-UI protocol separately if the app needs the agent to render UI rather than drive existing UI.

How the protocol layers compose

Each layer connects a different pair of parties — keep them distinct:

  • Agent ↔ tools/data (e.g. MCP).
  • Agent ↔ other agents (e.g. A2A).
  • Agent runtime ↔ the user-facing app — this skill's layer.

Design rules

  1. Frontend actions are tools. Model "navigate", "set field", "open view", "create event" as explicit frontend tool calls the agent invokes — not free-text the UI guesses at.
  2. Single source of truth via shared state, synced both directions: the agent reads what the user sees and writes changes that render instantly (the live-calendar/live-map effect).
  3. Stream, don't block. Use the event stream (SSE) so the UI reacts in real time as the agent works — partial messages, intermediate state patches, lifecycle signals.
  4. Human-in-the-loop on consequential actions. Use the protocol's approval events for anything irreversible/outward-facing; the agent proposes, the user confirms.
  5. Degrade safely. Pair with sim-zero so the UI-driving harness can be exercised without live model calls (see sim-zero-mode).

When to use / not

  • Use when an agent should operate an app for the user (conversational campaign/CRM/ops management, a "virtual employee" driving tools, conversational dashboards).
  • Don't reach for it for a plain chat sidebar that never touches app state — that's just a chat box; AG-UI's value is the driving + shared state.

Anti-patterns

  • A custom event protocol reinventing AG-UI → maintenance burden, no ecosystem.
  • Agent mutates UI state out-of-band instead of through synced shared state → the two views drift.
  • No approval gate on destructive actions → an agent confidently doing the wrong irreversible thing.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.