Pular para o conteúdo
Skillpedia
Sites e telas (frontend)7,6 mil · #13156

extension-points

O que ela faz

Esta skill descreve o sistema de slots de extensão, em que espaços nomeados de um aplicativo são preenchidos por widgets instaláveis. Cobre o slot, o alvo do slot e a instalação pelo usuário. É para desenvolvedores que querem que o aplicativo hospede widgets opcionais.

Quando usar

  • ✓Quando um aplicativo com extensões precisa mostrar um widget em um slot nomeado.
  • ✓Quando um bloco personalizado avulso deve se tornar algo que pode ser instalado em um slot.
  • ✓Quando você precisa saber como os slots e seus alvos são armazenados.

Link da skill

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

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/extension-points/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Pode acrescentar um slot ao meu dashboard para que os usuários instalem um widget de previsão do tempo na barra lateral?”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O desenvolvedor coloca um slot nomeado no layout do aplicativo. Um widget registra que pode preencher o slot, e o usuário pode instalá-lo ali.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do 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

Perguntas frequentes

O que é um slot?

Um slot é um lugar nomeado no layout de um aplicativo, onde um widget pode aparecer.

Isto vem ativado por padrão?

Não. A skill diz que a maioria dos aplicativos mantém a criação e a descoberta de extensões desligadas, preservando os blocos já instalados.

São a mesma coisa que ferramentas de LLM?

Não. Aqui as extensões são widgets de mini aplicativo, e não as chamadas de função que uma IA usa.

Detalhes

Descrição original do autor

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

Popularidade

Estrelas no GitHub
7,6 mil
Posição no ranking
#13156
Licença
MIT
Atualizada em
02/11/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas