Zum Inhalt springen
Skillpedia
Oberflächen (UI/UX)7.6k · #13162

generative-ui

Was er macht

Dieser Skill erklärt, wie ein Agent interaktive Oberflächen direkt im Chat anzeigen kann, gebaut aus abgeschottetem Alpine.js und Tailwind. Er behandelt einmalige Bedienelemente und gespeicherte Mini-Apps. Er richtet sich an Menschen, die schnelle interaktive Helfer in einer Unterhaltung wollen.

Wann du ihn nutzt

  • ✓Wenn du im Chat ein schnelles Bedienelement willst, etwa einen Schieberegler, eine Auswahl oder einen Rechner.
  • ✓Wenn eine vorübergehende Grafik oder Vorschau der Unterhaltung helfen würde.
  • ✓Wenn ein nützliches Widget gespeichert werden soll, damit du es später wieder öffnen kannst.

Link zum Skill

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/generative-ui/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/generative-ui/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Kannst du mir in diesem Chat einen Schieberegler geben, mit dem ich den Preis ändern kann und die Summe sofort aktualisiert wird?”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Agent zeigt ein kleines, abgeschottetes HTML-Bedienelement direkt im Chat an. Seine Werte können bei der nächsten Antwort an den Agenten zurückgeschickt werden, und eine gespeicherte Version lässt sich später wieder öffnen.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Generative UI

Generative UI is sandboxed Alpine.js HTML rendered inline in chat. It is not a source-code change and does not go through Builder.

Pick the Lifetime

  • Use render-inline-extension for one-off UI that belongs only in the current chat: knobs, controls, pickers, calculators, temporary charts, and previews.
  • Use create-extension when the UI should be saved, reusable, or visible in the Extensions view. It also renders inline after creation.
  • Use show-extension-inline to reopen a saved extension inside chat.
  • Use update-extension to edit an existing saved extension.

Inputs From Chat

Pass initial values through the action context argument. The iframe reads them from window.slotContext and can subscribe to changes with window.onSlotContext(fn).

<script>
  Alpine.data("controls", () => ({
    threshold: 50,
    init() {
      this.threshold = Number(window.slotContext?.threshold ?? 50);
      window.onSlotContext?.((ctx) => {
        if (ctx.threshold !== undefined) {
          this.threshold = Number(ctx.threshold);
        }
      });
    },
  }));
</script>

Outputs To The Agent

Use passive output when a control's current value should be visible to the agent on the next turn without requiring a submit click:

<input
  type="range"
  min="0"
  max="100"
  x-model.number="threshold"
  @input="agentNative.ui.output({ threshold }, { label: 'Threshold' })"
/>

agentNative.ui.output(value, opts?) writes application state at:

inline-ui:<extensionId>:output

The id is scoped automatically; the HTML author must not pass it. When the user says "use that value", "apply the current setting", or "run it with the current selection", read the value with:

const output = await readAppState("inline-ui:<id>:output");

The stored payload includes value, updatedAt, extensionId, and source: "inline-ui", plus optional label, context, or meta.

Use agentNative.chat.send(message, opts?) or sendToAgentChat(message, opts?) for a visible Apply/Submit button that should send a prompt or selected value into the chat. Pass { submit: true } explicitly for that user-triggered action; extension messages are draft-only otherwise. Never call these helpers from polling, refresh, or error handlers.

App Data And State

  • Prefer appAction(name, params) for template data and operations.
  • Use appFetch(path, options) only for allowed framework endpoints under /_agent-native/*, including application-state reads and writes.
  • Do not call template /api/* routes from generated UI.
  • Use dbQuery/dbExec only for known existing SQL tables when no action fits.
  • Use extensionFetch for external APIs through the sandbox proxy and secrets.

Transient extensionData Boundary

For saved extensions, extensionData uses the authenticated database-backed extension data API.

For transient inline UIs, extensionData is host localStorage. The agent cannot read it, it does not sync across devices, it does not migrate when a UI is promoted to a saved Extension, and the server does not garbage-collect it. Use it only for throwaway local UI state.

For anything the agent or app must observe, use agentNative.ui.output, application state through appFetch, an appAction, or agentNative.chat.send.

Styling

Use semantic Tailwind classes so the iframe inherits the parent app theme:

  • bg-background, text-foreground, border-border
  • bg-card, text-card-foreground
  • bg-primary, text-primary-foreground
  • text-muted-foreground, bg-accent

Do not hardcode provider tokens, private data, or internal secrets in generated HTML. Do not call an LLM directly from the iframe; route AI work through the agent chat.

Häufige Fragen

Ist das eine Code-Änderung an meiner App?

Nein. Es ist eine Oberfläche im Chat und ändert nicht den Quellcode der App.

Kann der Agent sehen, was ich im Bedienelement eingestellt habe?

Ja. Die Werte können als passive Ausgabe an den Agenten zurückgegeben werden, ohne einen Absende-Klick.

Was ist der Unterschied zwischen einmaliger und gespeicherter Oberfläche?

Einmalige Oberflächen existieren nur im aktuellen Chat, gespeicherte können wiederverwendet und in der Ansicht Erweiterungen angezeigt werden.

Details

Originalbeschreibung des Autors

Generate transient or saved inline chat UI with Alpine/Tailwind controls, outputs, app state, and extensions. Use for knobs, pickers, calculators, dashboards, widgets, or reusable mini-apps.

repo: BuilderIO/agent-native

Beliebtheit

GitHub-Sterne
7.6k
Platz im Ranking
#13162
Lizenz
MIT
Aktualisiert
2.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills