sharing
What it does
This skill explains how items like dashboards, documents, and forms stay private to their creator until shared on purpose. It is for developers adding sharing or access checks to an app.
When to use it
- βWhen you add a new item type that users create, such as a document or form.
- βWhen you need to control who can view or edit something a user made.
- βWhen you add the standard share dialog to an app.
Skill link
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/sharing/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βLet people create documents that stay private, but let me share a document with specific teammates.β
5 new skills a week. 1 minute to read.
How it works
New items start private to their creator. The creator can share with named people, or set visibility to the organization or to anyone with the link, and every list and read is checked against those rules.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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
FAQ
Who can see a new document by default?
Only its creator, unless it is explicitly shared.
What are the visibility levels?
Private, organization, and public, where public means anyone with the link.
Do public items show up in other people's lists?
No. They are reachable by link but are left out of default lists and search.
Details
Original description by the author
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
Popularity
- GitHub stars
- 7.6k
- Ranking position
- #13184
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
design-exploration
7.6kHelps your agent explore several UI design directions side by side, let you pick one, and then refine the chosen design.
visual-edit
7.6kHelps your agent open a running local app in a visual editor so you can review and edit its real screens together.
turn-into-app
7.6kTurns a workflow, spreadsheet or project into a polished visual app, with populated screens and an agent working behind the controls.
visual-plan
7.6kTurns a plain text plan into an interactive visual plan with diagrams, file maps, code snippets and open questions.
Similar skills
api-connector-builder
280kHas your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
api-design
280kHelps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
backend-patterns
280kHelps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.