본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)7.6k · #13156

extension-points

하는 일

이 스킬은 확장 슬롯 시스템을 설명합니다. 앱의 이름 붙은 빈자리를 설치 가능한 위젯이 채웁니다. 슬롯, 슬롯 대상, 사용자의 설치를 다룹니다. 앱에 선택적 위젯을 넣고 싶은 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓확장을 지원하는 앱이 이름 붙은 슬롯에 위젯을 보여 줘야 할 때.
  • ✓일회성으로 만든 맞춤 블록을 슬롯에 설치할 수 있는 것으로 바꿔야 할 때.
  • ✓슬롯과 슬롯 대상이 어떻게 저장되는지 알아야 할 때.

스킬 링크

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

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

사용 방법

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

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

Use this skill to help me: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/extension-points/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분.

작동 방식

개발자는 앱 레이아웃에 이름 붙은 슬롯을 둡니다. 위젯은 자신이 그 슬롯을 채울 수 있다고 등록하고, 사용자는 거기에 위젯을 설치할 수 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Extension Points

Terminology note. "Extensions" in this doc are the framework's sandboxed Alpine.js mini-app primitive (see the extensions skill). They are NOT LLM "tools" (function calls). The slot-system tables are still physically named tool_slots and tool_slot_installs for back-compat — see the table at the bottom of this doc and the "Database & API names" section in the extensions skill.

Mental model

Slots are named React-shaped holes in apps. Extensions are widgets that opt into filling those holes. The framework matches them up by string ID.

Three primitives:

Primitive What it is
Slot <ExtensionSlot id="..." context={...} /> dropped into an app's JSX
Slot target A row saying "extension X can render in slot Y" — tool_slots table (Drizzle: extensionSlots)
Slot install A row saying "user U wants extension X in slot Y" — tool_slot_installs (Drizzle: extensionSlotInstalls)

Slots do not make extensions a default product surface. Most apps keep extension creation and discovery disabled while preserving installed blocks and old deep links for compatibility. Add a slot only when the app deliberately supports this customization seam; otherwise implement the requested behavior in native app code.

When <ExtensionSlot> renders, it queries the user's installs and mounts one <EmbeddedTool> (a small auto-sized iframe) per install, pushing the slot's context into each via postMessage. (The component is still exported as EmbeddedTool for back-compat.)

Slot ID convention

<app>.<area>.<position> — three dot-separated lowercase-kebab segments.

  • mail.contact-sidebar.bottom
  • mail.thread-toolbar.actions
  • clips.right-panel.tabs
  • calendar.event-detail.bottom

Stable strings. Renaming a slot is a data migration — same as renaming a route.

How to author an extension that fills a slot

Only follow this flow when the host app explicitly enables extensions and the user has asked for a one-off custom block. Reusable behavior belongs in app code.

  1. Create the extension with create-extension. The HTML can read window.slotContext to get the host's context (the contact email, recording id, etc.) and subscribe to changes via window.onSlotContext(fn).

    <div
      x-data="{ contact: null }"
      x-init="contact = window.slotContext; window.onSlotContext(c => contact = c)"
    >
      <template x-if="contact">
        <div class="rounded-lg border p-4 m-4">
          <p class="text-sm">
            Notes for <span x-text="contact.contactEmail"></span>
          </p>
        </div>
      </template>
    </div>
    
  2. Declare the slot target with add-extension-slot-target:

    add-extension-slot-target { extensionId: "<id>", slotId: "mail.contact-sidebar.bottom" }
    
  3. Install it for the current user with install-extension:

    install-extension { extensionId: "<id>", slotId: "mail.contact-sidebar.bottom" }
    

The slot will pick up the install on its next render (≤2s via polling sync, immediate after the action's UI invalidation).

How to declare a slot in your app

Drop <ExtensionSlot> wherever you want to allow extensions:

import { ExtensionSlot } from "@agent-native/core/client/extensions";

// inside your component
<ExtensionSlot
  id="mail.contact-sidebar.bottom"
  context={{ contactEmail: contact.email, contactName: contact.name }}
  showEmptyAffordance
/>;

The legacy import path @agent-native/core/client/tools continues to re-export the same component for back-compat with existing templates.

Props:

  • id — slot identifier. Must match what extensions target.
  • context — object pushed to each embedded extension as slotContext. Re-pushed whenever this prop changes.
  • showEmptyAffordance — when true, shows a "+ Add widget" button in the empty state. Default: false (slot renders nothing when empty).
  • className / toolClassName — optional styling hooks. (The toolClassName prop name is kept for back-compat; it styles the embedded extension's iframe wrapper.)

The host doesn't register slots in advance — <ExtensionSlot> is the declaration. If an extension ta

자주 묻는 질문

슬롯이란 무엇인가요?

앱 레이아웃에서 위젯이 나타날 수 있는 이름 붙은 자리입니다.

기본으로 켜져 있나요?

아니요. 이 스킬은 대부분의 앱이 확장 생성과 탐색을 꺼 둔 채, 설치된 블록은 보존한다고 설명합니다.

LLM 도구와 같은 것인가요?

아니요. 여기서 확장은 미니 앱 위젯이며, AI가 쓰는 함수 호출과는 다릅니다.

상세 정보

작성자의 원본 설명

How extensions render as widgets inside other apps via named UI slots — the framework's optional extension system. Use when an extension-enabled app needs to wire an ExtensionSlot or make an existing one-off custom block installable into a slot.

repo: BuilderIO/agent-native

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬