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.mdSalin 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
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
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
extensionsskill). They are NOT LLM "tools" (function calls). The slot-system tables are still physically namedtool_slotsandtool_slot_installsfor back-compat β see the table at the bottom of this doc and the "Database & API names" section in theextensionsskill.
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.bottommail.thread-toolbar.actionsclips.right-panel.tabscalendar.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.
Create the extension with
create-extension. The HTML can readwindow.slotContextto get the host's context (the contact email, recording id, etc.) and subscribe to changes viawindow.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>Declare the slot target with
add-extension-slot-target:add-extension-slot-target { extensionId: "<id>", slotId: "mail.contact-sidebar.bottom" }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/toolscontinues 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 asslotContext. 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. (ThetoolClassNameprop 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
Komentar
- β¦
Skill lain dari repositori ini
design-exploration
7.6kMembantu agent Anda mengeksplorasi beberapa arah desain UI secara berdampingan, membiarkan Anda memilih satu, lalu menyempurnakan desain yang dipilih.
visual-edit
7.6kMembantu agent Anda membuka aplikasi lokal yang sedang berjalan di editor visual agar Anda dapat meninjau dan mengedit layar aslinya bersama-sama.
turn-into-app
7.6kMengubah alur kerja, spreadsheet, atau proyek menjadi aplikasi visual yang rapi, dengan layar yang terisi dan agent yang bekerja di balik kontrol.
visual-plan
7.6kMengubah rencana teks biasa menjadi rencana visual interaktif dengan diagram, peta file, cuplikan kode, dan pertanyaan terbuka.
Skill serupa
angular-developer
280kMembantu agent Anda membuat kode Angular dan memberi saran struktur proyek. Berguna saat memulai proyek baru, membuat komponen, atau meningkatkan performa.
frontend-a11y
280kMembantu agent Anda membuat antarmuka web dapat diakses semua orang. Memastikan website dan aplikasi berfungsi baik dengan screen reader dan navigasi keyboard.
frontend-patterns
280kMembuat agent Anda menerapkan pola modern dalam frontend. Mengoptimalkan performa, mengelola state, dan mengikuti praktik terbaik React dan Next.js.