sharing
Skill này làm gì
Skill này giải thích cách các mục như bảng điều khiển, tài liệu và biểu mẫu được giữ riêng tư với người tạo cho đến khi được chia sẻ có chủ đích. Skill dành cho lập trình viên thêm chia sẻ hoặc kiểm tra truy cập vào ứng dụng.
Khi nào nên dùng
- ✓Khi bạn thêm một loại mục mới mà người dùng tạo, chẳng hạn tài liệu hoặc biểu mẫu.
- ✓Khi bạn cần kiểm soát ai có thể xem hoặc chỉnh sửa thứ mà người dùng đã tạo.
- ✓Khi bạn thêm hộp thoại chia sẻ tiêu chuẩn vào ứng dụng.
Liên kết skill
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/sharing/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
“Cho phép mọi người tạo tài liệu và giữ chúng riêng tư, nhưng cho tôi chia sẻ một tài liệu với đồng đội cụ thể.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Mục mới mặc định riêng tư với người tạo. Người tạo có thể chia sẻ với những người được nêu tên, hoặc đặt khả năng hiển thị cho tổ chức hoặc cho bất kỳ ai có liên kết, và mọi danh sách hay lần đọc đều được kiểm tra theo các quy tắc đó.
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.
Sharing — Private by Default, Explicit Share
Rule
Any resource a user creates (dashboards, documents, forms, decks, compositions, booking links, issues, analyses) is private to the creator by default and visible to others only when they have been explicitly shared with or when the creator changes visibility to org or public.
This is the framework-level primitive. Every ownable resource gets it for free — same API, same UI, same skill.
Workspace apps are the intentional organization-scoped exception: their default
visibility is org, configurable by an organization owner/admin. The creator is
stored as the app owner, and the creator or an organization owner/admin can
change the app's visibility or manage its share grants.
Concepts
Three visibility levels
private— owner + explicit share grants only. Default.org— owner + explicit grants + anyone in the same org (read-only).public— owner + explicit grants + anyone with the link (read-only). Public docs do NOT appear in other users' list/sidebar/search results —accessFilteromits them by default. They're reachable by id (resolveAccessadmits them) so direct links and SSR routes like/p/:idkeep working. If a list endpoint legitimately needs cross-user public discovery (a template gallery, etc.), passaccessFilter(table, shares, ctx, minRole, { includePublic: true }).
Visibility is coarse. Explicit share grants are fine-grained (per user, reusable organization group, or per org).
Roles on a share grant
viewer— read only.commenter— read + add comments, but cannot edit the resource or manage shares.editor— read + write.admin— read + write + manage shares. Does NOT replace the singleowner_emailon the resource.
Share roles apply to one resource; organization roles apply to a team; app
roles apply within one app. These are separate permissions. For role setup,
use agent-native-docs to find the current organization and app-role guide.
Before adding an admin gate, identify which role system protects that operation
and use its existing role descriptor and permission checks. Do not replace role
checks with an email comparison or a custom isAdmin column.
Anonymous public URLs stay separate
Form "publish" slugs, booking-link slugs, any feature that exposes a URL to unauthenticated users — these are a different axis and are NOT controlled by the sharing system. Keep them alongside it.
Make a resource ownable
In your template's server/db/schema.ts:
import { sql } from "drizzle-orm";
import { pgTable, text } from "drizzle-orm/pg-core";
import {
createSharesTable,
ownableColumns,
} from "@agent-native/core/db/schema";
export const decks = pgTable("decks", {
id: text("id").primaryKey(),
title: text("title").notNull(),
data: text("data").notNull(),
createdAt: text("created_at").notNull().default(sql`now()`),
updatedAt: text("updated_at").notNull().default(sql`now()`),
...ownableColumns(), // adds owner_email, org_id, visibility
});
export const deckShares = createSharesTable("deck_shares");
Then register it in server/db/index.ts (not the schema file — keeps the schema file free of the getDb closure and avoids circular imports):
// server/db/index.ts
import * as schema from "./schema.js";
import { createGetDb } from "@agent-native/core/db";
import { registerShareableResource } from "@agent-native/core/sharing";
export const getDb = createGetDb(schema);
export { schema };
registerShareableResource({
type: "deck",
resourceTable: schema.decks,
sharesTable: schema.deckShares,
displayName: "Deck",
titleColumn: "title",
getResourcePath: (deck) => `/deck/${deck.id}`,
getDb,
});
Add agentRead: { actions: ["get-deck"] } naming the MCP tool that reads one
resource, so the share panel can send it to Claude, Claude Code and Codex.
The type string is the stable id the UI and actions use. getDb is required — the framework-level share actions use it to reach your template's DB.
Restricting public visibility and cross-org user shares
Some resources should NOT be reachable by an arbitrary authenticated user even with the link, and should NOT be shareable to an email outside the org. Two optional registration flags lock these axes down:
registerShareableResource({
type: "extension",
// ...
allowPublic: false, // hides "Public" in the share dialog and rejects it server-side
Câu hỏi thường gặp
Mặc định ai có thể thấy một tài liệu mới?
Chỉ người tạo, trừ khi nó được chia sẻ rõ ràng.
Có những mức hiển thị nào?
Riêng tư, tổ chức và công khai, trong đó công khai nghĩa là bất kỳ ai có liên kết.
Mục công khai có xuất hiện trong danh sách của người khác không?
Không. Chúng có thể truy cập qua liên kết nhưng bị loại khỏi danh sách và tìm kiếm mặc định.
Chi tiết
Mô tả gốc của tác giả
Framework-level sharing and privacy for user-authored resources (dashboards, documents, forms, decks, etc.). Use when making a resource table ownable, wiring list/read/update access checks, or dropping the standard share dialog into a template.
repo: BuilderIO/agent-native
Độ phổ biến
- Sao GitHub
- 7.6k
- Vị trí xếp hạng
- #13184
- 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ủ.