Langsung ke konten
Skillpedia
API & server (backend)7.6k · #13182

server-plugins

Fungsinya

Skill ini menjelaskan cara plugin server bekerja di aplikasi agent-native dan di mana rute framework sebaiknya diletakkan. Skill ini untuk pengembang yang menambahkan fitur server atau memperbaiki rute yang muncul otomatis.

Kapan dipakai

  • ✓Saat Anda perlu menambahkan plugin server kustom ke aplikasi.
  • ✓Ketika Anda harus memilih antara rute API biasa dan aksi.
  • ✓Saat rute framework bawaan berperilaku tidak sesuai harapan.

Link skill

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/server-plugins/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/server-plugins/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

“Tambahkan fitur server kustom ke aplikasi ini, dan beri tahu saya apakah sebaiknya berupa rute API atau aksi.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Plugin bawaan dimuat otomatis. Hanya plugin yang perlu disesuaikan yang mendapat berkas sendiri, dan semua rute framework berada di bawah awalan jalur bersama.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Server Plugins & Framework Routes

Default Plugins (auto-mount)

Five default plugins auto-mount when your app doesn't have a custom version in server/plugins/:

Plugin Default behavior Customize when
agent-chat Agent chat endpoints Custom mentionProviders or systemPrompt
auth Auth middleware Custom publicPaths or Google OAuth config
core-routes /_agent-native/poll, /_agent-native/ping, etc Custom envKeys or sseRoute
resources Resource CRUD Rarely
terminal Terminal emulator Rarely

Only create plugin files for plugins you need to customize. Let defaults auto-mount.

Framework Route Namespace: /_agent-native/

All framework-level routes live under /_agent-native/ to avoid collisions with template-specific /api/* routes.

Hard rule

  • ALL framework routes go under /_agent-native/.
  • Templates own /api/* only for route-only domain concerns such as uploads, streaming, webhooks, OAuth callbacks, or non-JSON protocols.
  • Never put framework routes under /api/.
  • Never put template routes under /_agent-native/ — that namespace is reserved.
  • Never create /api/* routes that only wrap, proxy, or re-export actions. Use the existing /_agent-native/actions/:name endpoint or the React action hooks.

Auto-mounted framework routes

Route Purpose
GET /_agent-native/poll Polling endpoint for DB change detection
GET /_agent-native/events SSE endpoint for real-time sync
GET /_agent-native/ping Health check
GET/PUT/DELETE /_agent-native/application-state/:key Application state CRUD
GET/PUT/DELETE /_agent-native/application-state/compose/:id Compose draft CRUD
POST /_agent-native/agent-chat Agent chat SSE endpoint
GET /_agent-native/agent-chat/mentions Mention search for @-tagging
GET /_agent-native/env-status Env key configuration status
POST /_agent-native/env-vars Save env vars
/_agent-native/auth/* Authentication (login, session, logout)
/_agent-native/google/* Google OAuth (callback, auth-url, etc.)
/_agent-native/resources/* Resource CRUD
/_agent-native/actions/:name Auto-mounted action endpoints
/_agent-native/available-clis Available CLI tools
/_agent-native/agent-terminal-info Terminal connection info
/_agent-native/collab/* Real-time collaboration (see real-time-collab)
/_agent-native/a2a A2A JSON-RPC endpoint (see a2a-protocol)

Actions-First Approach

For standard CRUD and data operations, use defineAction in actions/ — the framework auto-mounts them as HTTP endpoints at /_agent-native/actions/:name. Only create custom /api/* routes for things actions can't do:

  • File uploads with multipart form data
  • Streaming responses
  • Webhooks from external services
  • OAuth callbacks

Before adding a route, inspect the existing action files. Reuse the action if it already encodes the business rule, or add a new action if the operation should be available to both the agent and the UI. A route whose implementation mostly calls an action is usually the wrong abst

Pertanyaan umum

Apakah setiap plugin perlu berkas?

Tidak. Skill ini menyatakan biarkan default dimuat dan sesuaikan hanya yang Anda butuhkan.

Jalur apa yang dipakai rute framework?

Skill ini memakai awalan /_agent-native/ agar tidak bertabrakan dengan rute aplikasi.

Kapan saya sebaiknya memakai rute /api/?

Untuk keperluan khusus rute saja, seperti unggahan atau streaming.

Detail

Deskripsi asli dari pembuat

Framework server plugins and the `/_agent-native/` route namespace. Use when adding a custom server plugin, deciding whether to create an `/api/` route vs an action, or debugging auto-mounted framework routes.

repo: BuilderIO/agent-native

Popularitas

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

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa