AG-UI is an event-based protocol that lets AI agent backends communicate with user-facing applications. It standardizes agent events and inputs while supporting transports such as server-sent events, WebSockets, and webhooks. The catalogue add-ons help developers build integrations and applications around the protocol.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add ag-ui-protocol/ag-ui --skill agui-dotnet-shared-stategit clone --depth 1 https://github.com/ag-ui-protocol/ag-uiWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/ag-ui-protocol/ag-ui/agui-dotnet-shared-state)<a href="https://agentmods.dev/skills/ag-ui-protocol/ag-ui/agui-dotnet-shared-state"><img src="https://agentmods.dev/badge/skills/ag-ui-protocol/ag-ui/agui-dotnet-shared-state.svg" alt="Measured on agentmods" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00215 | $0.01375 |
| Opus 5 | $0.00108 | $0.00687 |
| Sonnet 5 | $0.00043 | $0.00275 |
| Haiku 4.5 | $0.00021 | $0.00137 |
Grade A, and why
agui-dotnet-shared-state scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AG-UI .NET — shared state
Goal: keep a structured object (a form, a document, a plan, a recipe) in sync between the client and the agent — the client provides the current state, the agent updates it, and the new state streams back next to the assistant's text.
State travels on the wire inside RunAgentInput.State (inbound) and as StateSnapshotEvent / StateDeltaEvent (outbound). In Microsoft.Extensions.AI terms, inbound state rides on the request's raw representation and outbound state rides on a ChatResponseUpdate's raw representation.
Client: seed the state and read it back
Send the starting state with the request, and watch for snapshots in the response:
using System.Text.Json;
using AGUI.Abstractions;
using Microsoft.Extensions.AI;
var initialState = JsonSerializer.SerializeToElement(new
{
recipe = new { title = "", ingredients = Array.Empty<string>(), steps = Array.Empty<string>() }
});
var options = new ChatOptions
{
RawRepresentationFactory = _ => new RunAgentInput { State = initialState },
};
var messages = new List<ChatMessage> { new(ChatRole.User, "Suggest an Italian pasta recipe") };
JsonElement? latestState = null;
await foreach (var update in client.GetStreamingResponseAsync(messages, options))
{
if (update.RawRepresentation is StateSnapshotEvent snapshot)
{
latestState = snapshot.Snapshot; // the full updated state object
}
Console.Write(update.Text); // the assistant's summary streams as usual
}
State updates are content-less — they arrive on update.RawRepresentation, not as update.Text.
Server: read inbound state and emit the new state
Add a DelegatingChatClient to the pipeline that reads RunAgentInput.State, produces the new state, and yields it as a StateSnapshotEvent:
using System.Runtime.CompilerServices;
using System.Text.Json;
using AGUI.Abstractions;
using AGUI.Server;
using Microsoft.Extensions.AI;
internal sealed class RecipeStateChatClient(IChatClient inner, JsonSerializerOptions jso)
: DelegatingChatClient(inner)
{
public override async IAsyncEnumerable<ChatResponseUpdate> GetStreamingResponseAsync(
IEnumerable<ChatMessage> messages,
ChatOptions? options = null,
[EnumeratorCancellation] CancellationToken ct = default)
{
if (options?.TryGetRunAgentInput(out var input) is true
&& input!.State is { ValueKind: JsonValueKind.Object } incoming)
{
var newState = await BuildStateAsync(messages, incoming, ct); // your logic / an LLM call
yield return new ChatResponseUpdate
{
RawRepresentation = new StateSnapshotEvent
{
Snapshot = JsonSerializer.SerializeToElement(newState, jso.GetTypeInfo(typeof(AgentState))),
},
};
}
await foreach (var update in base.GetStreamingResponseAsync(messages, options, ct))
{
yield return update; // the assistant's text summary
}
}
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 118 lines · 215 tokens per session scan A f356a7554de6
agui-dotnet-shared-state is a skill published in the GitHub repository ag-ui-protocol/ag-ui (15,752 stars, last pushed today), licensed MIT. It adds 215 tokens to every session and 1,375 once invoked, about $0.0011 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
agent-code-analyzer
Agent skill for code-analyzer - invoke with $agent-code-analyzer.
worker-integration
Worker-Agent integration for intelligent task dispatch and performance tracking.
quality-hooks
Language-specific auto-lint/format/typecheck pipeline. Supports Python (ruff+pyright), TypeScript (prettier+eslint+tsc), Go (gofmt+golangci-lint). Auto-fix and convergence loops.
cog-knowledge-consolidation
Build structured knowledge frameworks from scattered vault notes with source attribution.
revdiff-plan
Review the last Codex assistant message (plan, analysis, or proposal) with inline annotations in a TUI overlay. Extracts the most recent response from Codex rollout files and opens it in revdiff for review and annotation. Activates on "revdiff-plan", "review plan with revdiff", "annotate plan", "review last response"…
strict-tdd
Strict RED->GREEN->REFACTOR test-driven development with enforcement. Never write production code before a failing test. Atomic commits per TDD cycle.