customizing-agent-native
Skill này làm gì
Skill này nêu thứ tự cần làm khi tùy chỉnh các tính năng Agent-Native trong một ứng dụng. Nó bắt đầu bằng các thiết lập thương hiệu và tùy chọn component được hỗ trợ, rồi mới sao chép một tính năng vào ứng dụng. Skill dành cho lập trình viên muốn giao diện hoặc hành vi riêng.
Khi nào nên dùng
- ✓Khi bạn muốn đổi diện mạo của một tính năng dùng chung để khớp với thương hiệu.
- ✓Khi bạn cần thay một component dùng chung bằng hệ thống thiết kế của công ty.
- ✓Khi một tính năng dùng chung phải hoạt động khác trong ứng dụng của bạn và cài đặt không đủ.
Liên kết skill
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/customizing-agent-native/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
“Bạn có thể đổi giao diện khung chat của agent để khớp với màu và nút thương hiệu của chúng tôi mà không làm hỏng các bản cập nhật không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent trước hết đặt các token thương hiệu và đăng ký component của công ty, rồi dùng các tùy chọn được hỗ trợ của tính năng. Chỉ khi vẫn chưa đủ, nó mới sao chép tính năng nhỏ nhất vào ứng dụng.
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.
Customizing Agent-Native
Rule
Start with the app's registered design system and local UI adapters, then use
the public feature's props, semantic components, controller, product slots,
and callbacks. If those seams are not enough, use the eject CLI to transfer
the smallest supported feature into the app and make that copy app-owned.
Never edit node_modules, deep-import a private source file at runtime, or
patch an @agent-native/* package.
Use this order:
- Set brand tokens with the build-time theme configuration when tokens are enough.
- Register company components in
app/design-system.tswithdefineDesignSystem, then pass that definition toToolkitProvider. - Configure a public feature through its semantic components, headless controller, and product-level render slots.
- Compose app primitives behind the app's local UI adapter layer.
- Eject the smallest feature into app-owned source.
- Propose a new Toolkit seam when the same override is useful in two apps.
Ejection is for intentional product customization, not for hiding an upgrade failure or replacing Core runtime behavior.
Use A Company Design System
Keep the explicit, typed registration seam in app/design-system.ts:
import { defineDesignSystem } from "@agent-native/toolkit/design-system";
import {
AcmeActionButtonAdapter,
AcmeDialogAdapter,
} from "./design-system/acme-adapter";
export const designSystem = defineDesignSystem({
name: "Acme",
components: {
ActionButton: AcmeActionButtonAdapter,
Dialog: AcmeDialogAdapter,
},
});
Adapters translate the semantic Toolkit contract into company component props.
They are ordinary React components and may use MUI-style providers, React Aria,
CSS modules, CSS-in-JS, or another styling runtime. className and style are
optional interoperability hooks, not Tailwind or CVA requirements.
The contract has nine leaf components (ActionButton, IconButton,
TextField, TextArea, Spinner, Skeleton, Status, Surface, Avatar)
and eight behavior components (Tooltip, Menu, Popover, Dialog,
Picker, Checkbox, Switch, Tabs). Picker covers select and combobox
behavior, not date picking. Behavior adapters own their portal, focus,
keyboard, dismissal, and stacking implementation while honoring the semantic
props and portalContainer interop contract.
App product code imports standard controls from its local adapter path, usually
@/components/ui/*. Do not import @agent-native/toolkit/ui/* directly from
pages, routes, or domain components. That bypasses the app seam and makes a
future design-system replacement incomplete. Toolkit feature packages remain
valid imports; configure their presentation through the registered semantic
components, controller, and product slots.
Run the published conformance kit against a complete adapter in its own CI:
import { assertDesignSystemConformance } from "@agent-native/toolkit/conformance";
import { DESIGN_SYSTEM_CONTRACT_VERSION } from "@agent-native/toolkit/design-system";
await assertDesignSystemConformance({
adapterName: "Acme",
components,
contractVersion: DESIGN_SYSTEM_CONTRACT_VERSION,
});
Customize A Shared Feature
Prefer feature-level headless controllers over rebuilding individual widgets. One controller must power both the Toolkit default view and every custom render path so behavior, actions, analytics, accessibility state, and error handling cannot drift. Use a product-level render slot to replace the view while keeping that controller. Eject only when the controller and slots cannot express the required product behavior.
Eject A Feature
Discover and inspect the ejection units published by installed first-party packages before changing source:
agent-native eject --list
agent-native eject inspect <unit>
agent-native eject <unit> --app <app>
agent-native eject <unit> --app <app> --apply
The command is dry-run by default. It prints the file closure, consumer import
rewrites, protected package contracts, and verification commands before
writing. --apply copies the package-version-matched source into the app and
rewrites only imports covered by the unit manifest.
If a framework feature has no ejection unit, follow its documented configuration, adapter, or extension seam; do not invent a manual package-copy recipe. For an unknown third-party package, use the emitted add-style blueprint as a starting point. Protected runtime behavior is neve
Câu hỏi thường gặp
Tôi có thể sửa trực tiếp file package không?
Không. Skill nói không bao giờ sửa thư mục node_modules hoặc vá các package.
Eject ở đây nghĩa là gì?
Nghĩa là sao chép tính năng được hỗ trợ nhỏ nhất vào ứng dụng để bạn sở hữu và chỉnh sửa bản sao đó.
Thay đổi của tôi có còn sau khi nâng cấp không?
Các tùy chỉnh qua cài đặt được hỗ trợ được tách khỏi code package, giúp nâng cấp dễ hơn.
Chi tiết
Mô tả gốc của tác giả
How to configure, compose, or eject Agent-Native features into app-owned code. Use when overriding shared components or integrations, customizing a template, adding UI to chat or headless apps, or inspecting package source.
repo: BuilderIO/agent-native
Độ phổ biến
- Sao GitHub
- 7.6k
- Vị trí xếp hạng
- #13151
- 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ự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.