Agent skill
ag-ui
AG-UI protocol implementation guidance for event ordering (`RUN_STARTED`, `TOOL_CALL_*`, `STATE_SNAPSHOT`/`STATE_DELTA`), streaming semantics, and middleware patterns. Use when integrating agent backends with AG-UI clients.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/ag-ui
SKILL.md
AG-UI
Use this skill to implement AG-UI compliant integrations with correct event ordering, tool lifecycle behavior, and state synchronization semantics.
Quick Triage
- Use this skill when the task is protocol-level integration between agent backend and UI client.
- Switch to
$langgraphwhen graph orchestration/checkpoint logic is the primary issue. - Switch to
$langchainwhen chain or tool orchestration internals are the primary issue. - Switch to
$copilotkitwhen CopilotKit hooks/provider behavior is primary.
Workflow
- Define integration mode.
Choose client-side
HttpAgent, customAbstractAgent, or middleware bridge. - Lock event subset and ordering. Map required lifecycle, text, tool, and state events before implementation.
- Implement lifecycle first.
Guarantee
RUN_STARTEDandRUN_FINISHED/RUN_ERRORframing around all runs. - Implement message and tool streams. Ensure tool call start/args/end/result sequence is valid and complete.
- Implement state synchronization. Choose snapshot-only, delta-only, or hybrid strategy intentionally.
- Add middleware with explicit order. Enforce auth, filtering, and logging without mutating protocol invariants.
- Validate against event traces. Use deterministic replay to confirm ordering and payload shape.
Default Patterns
- Emit minimal valid event streams rather than custom ad-hoc payloads.
- Keep tool result payloads parseable and bounded.
- Prefer explicit event schemas over inferred client parsing.
- Keep protocol payloads transport-agnostic.
Failure Modes
- Out-of-order lifecycle or tool events.
- Partial tool-call streams without terminal result events.
- State delta application mismatch on client.
- Middleware mutating payloads into non-compliant shapes.
Reference Map
Load only what is needed for the current subtask.
- Event contracts:
references/event-contracts.md - State sync strategy:
references/state-sync.md - Middleware usage:
references/middleware-patterns.md - Integration checklist:
references/integration-checklist.md
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?