performance
Skill này làm gì
Skill này hướng dẫn agent tìm phần chậm của ứng dụng, chẳng hạn quá nhiều dữ liệu hoặc công việc lặp lại, rồi giảm bớt. Nó dành cho lập trình viên khi trang có cảm giác chậm, giật hoặc trễ.
Khi nào nên dùng
- ✓Khi một trang có cảm giác tải chậm hoặc bị trễ khi bạn nhấn vào các thứ.
- ✓Khi một danh sách chậm dần khi lượng dữ liệu tăng.
- ✓Khi bạn thay đổi một lần đọc dữ liệu, đường dẫn polling hoặc code khởi động trên một màn hình nhạy cảm về hiệu năng.
Liên kết skill
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/performance/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ảng điều khiển của tôi tải rất lâu khi có nhiều bản ghi. Bạn có thể làm nó nhanh hơn không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent đo xem thời gian chờ nằm ở đâu, chỉ tải dữ liệu màn hình cần, gom các lần đọc thành lô, và chỉ thêm bộ nhớ đệm khi phép đo cho thấy nó hữu ích.
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.
Performance
Find the cost that users actually wait on, then reduce it without weakening the result. A slow screen may be waiting on the server, moving too much data, serial reads, repeated computation, or browser rendering; measure before adding caches or extra complexity.
Load only what the current view needs
- Shape list reads around the fields the list displays. Keep large document bodies, histories, rendered output, and other rarely viewed data on a detail or on-demand path. Return a small preview when the list needs one.
- Paginate or window unbounded histories and activity feeds. Start with the recent or visible range and load more as the user asks for it.
- Batch related reads instead of issuing one query per row. Compute counts and other aggregates in the database when the result can be much smaller than the source rows.
- Start independent reads together. Do not make the first useful content wait for unrelated settings, below-the-fold panels, or secondary details.
- Index fields used by frequent filters, joins, and sorts when the data and observed query cost justify it. Keep indexes aligned with real query shapes.
For action-backed screens, shape the action response for the screen's current need and keep the UI on the app's existing action and query hooks. Do not add a second fetch path that duplicates the same read.
Keep repeated work cheap
- Keep list and frequently refreshed reads inexpensive. Avoid parsing, reformatting, or rebuilding large values on every read when the result can be prepared once or computed only for the view that needs it.
- Use the app's existing live-update path when fresh data must reach an open screen. Poll only when needed, and keep polled reads bounded and cheap.
- Keep large file contents and long records out of list responses. Load them when the user opens the relevant item rather than sending them on every list refresh.
- Defer nonessential data and expensive child views until after the main content is usable. Window a rendered list when rendering all rows makes scrolling or updates slow.
Protect startup and the first paint
- Keep migrations, backfills, data scans, aggregations, provider handshakes, and cache warming out of module evaluation and application startup. Hosted serverless instances can restart, so startup work can repeat on user requests. Use the app's deliberate migration, job, or on-demand path.
- Keep optional heavy runtimes out of modules loaded by ordinary page requests. Load a browser, media processor, or other large dependency only in the feature or job that needs it, and inspect the deployed bundle when adding one.
- Keep the server-rendered shell public and independent of a visitor's session. Resolve user-specific state after the shell loads through the app's authenticated client data path. Reads that must reflect a recent mutation should not depend on cached server-rendered loader data.
- Give loading placeholders the final content's basic geometry. Reserve space for content whose size is known; avoid showing a temporary layout that shifts the user's reading position when data arrives.
Keep interactions responsive
Show that an interaction registered as soon as it happens, aiming for 100 ms. If the work needs the network or takes longer, acknowledge it before waiting and show a focused pending state within 400 ms. Use an optimistic update when it is safe, then confirm or roll back on failure.
When investigating a slow experience, separate server response time, data transfer, serial waits, rendering, layout movement, and long interaction work. Use representative data and the production build when development tooling changes the cost. Verify that the user-visible action completed before comparing timings or memory.
Câu hỏi thường gặp
Agent có luôn nên thêm bộ nhớ đệm không?
Không. Skill nói nên đo trước, vì bộ nhớ đệm làm tăng độ phức tạp.
Dữ liệu nào nên tải sau?
Nội dung tài liệu lớn, lịch sử dài và chi tiết ít khi xem nên được tải theo yêu cầu, thay vì khi màn hình danh sách mở.
Điều này có thay đổi những gì người dùng thấy không?
Không nên làm giảm kết quả. Mục tiêu là một màn hình nhanh hơn cho cùng một kết quả.
Chi tiết
Mô tả gốc của tác giả
Keep app loads and interactions responsive as data grows. Use when a page feels slow, jumps, or lags, or when changing a data read, list, polling path, startup path, or performance-sensitive UI.
repo: BuilderIO/agent-native
Độ phổ biến
- Sao GitHub
- 7.6k
- Vị trí xếp hạng
- #13171
- 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ự
angular-developer
280kGiúp agent của bạn viết code Angular và tư vấn cấu trúc dự án, hữu ích khi bắt đầu dự án mới hoặc cải thiện hiệu suất.
frontend-a11y
280kGiúp agent của bạn làm cho giao diện web dễ tiếp cận với mọi người. Đảm bảo website và ứng dụng hoạt động tốt với trình đọc màn hình và điều hướng bằng bàn phím.
frontend-patterns
280kGiúp agent của bạn áp dụng các mẫu hiện đại trong phát triển frontend. Tối ưu hiệu năng, quản lý trạng thái và tuân theo thực hành tốt nhất với React và Next.js.