Langsung ke konten
Skillpedia
Website & UI (frontend)7.6k Β· #13156

extension-points

Fungsinya

Skill ini menjelaskan sistem slot ekstensi, tempat lubang bernama di aplikasi diisi oleh widget yang bisa dipasang. Cakupannya meliputi slot, target slot, dan pemasangan oleh pengguna. Skill ini untuk pengembang yang ingin aplikasinya menjadi tuan rumah bagi widget opsional.

Kapan dipakai

  • βœ“Saat aplikasi yang mendukung ekstensi perlu menampilkan widget di slot bernama.
  • βœ“Ketika blok kustom sekali pakai yang sudah ada sebaiknya menjadi sesuatu yang bisa dipasang di slot.
  • βœ“Saat Anda perlu tahu bagaimana slot dan targetnya disimpan.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/extension-points/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBisakah Anda menambahkan slot ke dasbor saya supaya pengguna bisa memasang widget cuaca di sidebar?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Pengembang menempatkan slot bernama di tata letak aplikasi. Widget mendaftarkan diri bahwa ia bisa mengisi slot tersebut, dan pengguna dapat memasangnya di sana.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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

Pertanyaan umum

Apa itu slot?

Slot adalah tempat bernama di tata letak aplikasi tempat widget bisa muncul.

Apakah fitur ini aktif secara default?

Tidak. Skill ini menyatakan sebagian besar aplikasi menonaktifkan pembuatan dan penemuan ekstensi, sambil tetap mempertahankan blok yang sudah dipasang.

Apakah ini sama dengan alat LLM?

Tidak. Ekstensi di sini adalah widget aplikasi kecil, bukan fungsi panggilan yang dipakai AI.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
7.6k
Peringkat
#13156
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa