본문으로 건너뛰기
Skillpedia
인터페이스 (UI/UX)7.6k · #13162

generative-ui

하는 일

이 스킬은 에이전트가 샌드박스 Alpine.js와 Tailwind로 만든 대화형 UI를 채팅 안에 보여 주는 방법을 설명합니다. 일회성 컨트롤과 저장된 미니 앱을 다룹니다. 대화 중에 빠른 대화형 도우미를 원하는 사람을 위한 스킬입니다.

사용하는 경우

  • ✓채팅 안에서 슬라이더, 선택기, 계산기 같은 빠른 컨트롤이 필요할 때.
  • ✓대화에 도움이 되는 임시 차트나 미리보기가 필요할 때.
  • ✓나중에 다시 열 수 있도록 유용한 위젯을 저장하고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/generative-ui/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 채팅에 가격을 바꾸면 합계가 바로 바뀌는 슬라이더를 만들어 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 작은 샌드박스 HTML 컨트롤을 채팅 안에 인라인으로 렌더링합니다. 그 값은 다음 턴에 에이전트에게 다시 전달될 수 있고, 저장된 버전은 나중에 다시 열 수 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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.

자주 묻는 질문

앱의 코드를 바꾸는 작업인가요?

아니요. 채팅 안의 인라인 UI이며, 앱의 소스 코드는 바뀌지 않습니다.

에이전트가 제가 컨트롤에서 설정한 값을 볼 수 있나요?

네. 제출 클릭 없이 수동 출력으로 값을 에이전트에게 돌려줄 수 있습니다.

일회성 UI와 저장된 UI의 차이는 무엇인가요?

일회성 UI는 현재 채팅에만 존재하고, 저장된 UI는 재사용할 수 있으며 확장 보기에도 표시됩니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
7.6k
순위
#13162
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬