agentleFS
ScaleDockHQScaleDockHQ/scaledock-skills/skills/ag-ui/SKILL.md

ag-ui

Skill1 starsChanged 31 days agoMITView on GitHub

AG-UI: stream agent runs to user-facing apps with the Agent-User Interaction Protocol 1.0. Use when building or reviewing an AG-UI agent endpoint (producer), a client or UI that consumes one (consumer), a framework bridge, or middleware: RunAgentInput (threadId, runId, messages, tools, context, state, forwardedProps, resume), the 31 event types in eight families (RUN_STARTED, RUN_FINISHED with success, interrupt and cancelled outcomes, RUN_ERROR, steps, TEXT_MESSAGE_*, TOOL_CALL_*, REASONING_*, STATE_SNAPSHOT, STATE_DELTA with JSON Patch, MESSAGES_SNAPSHOT, ACTIVITY_*, SUBAGENT_*, RAW and CUSTOM), the chunked form, the HTTP + SSE and HTTP + Protobuf bindings, frontend tools, human-in-the-loop interrupts and resume, the processing model (unknown versus malformed), protocolVersion negotiation, the AG-UI JSON Schema, and the TypeScript, Python and .NET SDKs. Triggers: ag-ui, agui, agent-user interaction protocol, agent UI streaming, copilot UI events, generative UI, shared state, human in the loop.

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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:

    Follow the workflow below step by step: Every rule here comes from a source in Sources, cited by page title.

    line 15
  2. Very specific:

    A stream begins with RUN_STARTED or RUN_ERROR;: every message, tool call, step, reasoning span and subagent a run opens is closed …

    line 28

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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

AG-UI

AG-UI (Agent-User Interaction Protocol) connects agents to user-facing applications: one request (RunAgentInput) in, one ordered stream of typed events out, carrying text, tool calls, reasoning, shared state and progress. Version 1.0 is the first release with a normative specification; the JSON Schema is authoritative for structure and the specification for behaviour (Specification, "What this document is"). With this skill the agent builds or reviews a producer, a consumer, or middleware.

Follow the workflow below step by step. Every rule here comes from a source in Sources, cited by page title. When a rule and the pinned source disagree, the source wins; when the source has a newer version than the pin, follow the refresh steps.

Inputs (fill in, or ask before starting)

  • Role: producer (agent endpoint or bridge), consumer (client SDK or UI), middleware, or several.
  • Transport: HTTP + SSE (required for HTTP), HTTP + Protobuf (optional), or a custom binding.
  • Features: which event families beyond the run lifecycle, frontend tools, interrupts, shared state.
  • Revision: AG-UI 1.0 as pinned in Sources, unless the user names another.
  • Sources: when refreshing this skill or when a rule looks out of date, re-read every URL in Sources, check https://docs.ag-ui.com/llms.txt for a newer frozen spec version, check the @ag-ui/core version and the repository head, and update the pins.

Invariants

  1. Arrival order is the protocol's order. Consumers must not order by timestamp (The Event Model).
  2. A stream begins with RUN_STARTED or RUN_ERROR; every message, tool call, step, reasoning span and subagent a run opens is closed before RUN_FINISHED; nothing but RUN_STARTED follows RUN_ERROR (Runs and Steps).
  3. Absent means absent. Optional fields without a value are omitted, never null (The Event Model).
  4. Unrecognised material is stripped with a warning; a malformed known value is fatal (Processing Model).
  5. Middleware runs before enforcement, enforcement before chunk expansion and verification, and all before application code (Processing Model).
  6. Tool arguments are not acted on before TOOL_CALL_END, and are validated as untrusted input (Tool Calls).
  7. A producer never answers a frontend tool call it made; the run ends as success, and a continuing thread answers every pending call (Tool Calls, "Frontend tools").
  8. An interrupted run ends with the interrupt outcome, and a resume covers every interrupt, answered or explicitly abandoned (Interrupts and Resume).
  9. A truncated stream is not a finished run. Consumers never synthesize RUN_FINISHED and never infer success from HTTP 200 (Transports; HTTP + Server-Sent Events).
  10. Model output is untrusted. Applications validate what they act on, never render streamed content as executable markup, and never represent an action as user-approved when it was not (Specification, "Security and Trust & Safety").

Workflow

  1. Choose roles and transport. Speak HTTP + SSE if you speak HTTP; add Protobuf only if needed. Put authentication in the binding. -> references/transports.md ✓ The endpoint accepts a JSON POST, answers text/event-stream with one JSON event per data field, and rejects bad input with an HTTP error before any stream.
  2. Emit or consume the run lifecycle. Implement RUN_STARTED, RUN_FINISHED with its outcome, RUN_ERROR, steps, and token usage. -> references/events.md ✓ Every run is bracketed; outcomes are success, interrupt or cancelled; a stopped run is never reported as success.
  3. Add the event families you need. Text messages, tool calls, reasoning, state, activity, subagents, passthrough, in triad or chunked form. -> references/events.md ✓ Each item follows open, content, close; deltas are RFC 6902 patches against a baseline the consumer has.
  4. Wire human-in-the-loop. Advertise frontend tools, handle pending tool calls, raise interrupts and send resume entries; ask consent before side effects. -> references/human-in-the-loop.md ✓ Approval-gated actions never run on an absent resume entry; declined calls are answered as declined.
  5. Build the processing pipeline and version handshake. Strip unknown material with warnings, fail on malformed known values, declare protocolVersion. -> references/processing-and-versioning.md ✓ A test stream with an unknown event type survives with a warning; a messageId holding a number fails the run.

Verify before done

  • Producer streams validate against the 1.0 JSON Schema in tests; the runtime receive path strips rather than rejects unknown material.
  • No optional field is sent as null; identifiers are treated as opaque.
  • RUN_STARTED.protocolVersion and RunAgentInput.protocolVersion are sent ("1.0").
  • Cancelled, interrupted, errored and truncated runs are each surfaced differently from success.
  • Activity messages are stripped from outgoing messages.
  • Tool arguments, tool results, state, RAW and CUSTOM payloads are validated before use and never rendered as markup.
  • No secrets are placed in state or messages, which round-trip through the client.

Reference index

  • references/events.md: the envelope, identifiers, the eight families, the run lifecycle and outcomes, streaming and the chunked form, snapshots and deltas, passthrough. Load for steps 2 and 3.
  • references/transports.md: the binding contract, HTTP + SSE, HTTP + Protobuf, truncation, custom transports, and a framework-neutral endpoint sketch. Load for step 1.
  • references/human-in-the-loop.md: frontend tools, interrupts and resume, and the security rules. Load for step 4.
  • references/processing-and-versioning.md: the processing pipeline, version negotiation, downgrades, the JSON Schema, capabilities, SDKs and the relation to MCP and A2A. Load for step 5.

Related skills

  • owasp-agentic for reviewing human-agent trust, tool misuse and approvals around the UI: npx skills add ScaleDockHQ/scaledock-skills --skill owasp-agentic.
  • a2a for agent-to-agent traffic behind an AG-UI front end: npx skills add ScaleDockHQ/scaledock-skills --skill a2a.

Sources

Status uses the publishing body's own maturity term. Checked is the date the source was last read.

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.