server-plugins
Skill này làm gì
Skill này giải thích cách plugin máy chủ hoạt động trong ứng dụng Agent-Native và route framework nên nằm ở đâu. Skill dành cho lập trình viên thêm tính năng máy chủ hoặc gỡ lỗi các route xuất hiện tự động.
Khi nào nên dùng
- ✓Khi bạn cần thêm một plugin máy chủ tùy chỉnh vào ứng dụng.
- ✓Khi bạn phải quyết định giữa một route API thường và một action.
- ✓Khi một route framework tích hợp sẵn hoạt động theo cách bất ngờ.
Liên kết skill
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/server-plugins/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Thêm một tính năng máy chủ tùy chỉnh vào ứng dụng này, và cho tôi biết nó nên là một route API hay một action.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Plugin mặc định được tải tự động. Chỉ các plugin cần tùy chỉnh mới có file riêng, và mọi route framework đều nằm dưới một tiền tố đường dẫn chung.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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/:nameendpoint 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
Câu hỏi thường gặp
Mỗi plugin có cần một file không?
Không. Skill nói hãy để mặc định được tải và chỉ tùy chỉnh những gì bạn cần.
Route framework dùng đường dẫn nào?
Chúng dùng tiền tố /_agent-native/ để tránh trùng với route của ứng dụng.
Khi nào nên dùng route /api/?
Cho các mối quan tâm chỉ thuộc về route, như tải lên hoặc streaming.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 7.6k
- Vị trí xếp hạng
- #13182
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
design-exploration
7.6kGiúp agent của bạn khám phá nhiều hướng thiết kế giao diện song song, để bạn chọn một hướng rồi tinh chỉnh thiết kế đã chọn.
visual-edit
7.6kGiúp agent của bạn mở một ứng dụng cục bộ đang chạy trong trình chỉnh sửa trực quan, để bạn xem và sửa các màn hình thật cùng nhau.
turn-into-app
7.6kBiến quy trình, bảng tính hoặc dự án thành ứng dụng trực quan có màn hình đầy đủ dữ liệu, với agent làm việc phía sau các điều khiển.
visual-plan
7.6kBiến một kế hoạch viết bằng văn bản thuần thành kế hoạch trực quan tương tác, có sơ đồ, bản đồ file, đoạn code và các câu hỏi còn mở.
Skill tương tự
api-connector-builder
280kGiúp agent của bạn xây dựng kết nối API mới theo đúng mẫu đã có, dùng khi bạn cần thêm một tích hợp mà không tạo cách làm mới.
api-design
280kGiúp agent của bạn thiết kế REST API theo các thực hành tốt nhất, hữu ích để định nghĩa cách API giao tiếp, hiển thị lỗi và tổ chức dữ liệu.
backend-patterns
280kGiúp agent của bạn với các mẫu kiến trúc phía máy chủ và tối ưu cơ sở dữ liệu, hữu ích khi xây dựng hoặc rà soát code chạy trên máy chủ.