Create, consume, or manage MotherDuck data shares, including audience grants, table filters, and refresh policy.
Getting started
Full instructionsInstall the skill, then ask your AI tool for the task in plain words. The full SKILL.md below shows what it covers.
Instructions: SKILL.mdv1.0.50
Share Data with MotherDuck
Source Of Truth
- Prefer the current MotherDuck sharing docs and SQL reference first.
- If the MotherDuck MCP
ask_docs_questionfeature is available, use it before falling back to public docs. - Keep the sharing model aligned with the documented behavior:
- zero-copy and metadata-only
- a database is the share source, with optional table/view filtering through
INCLUDE_PATTERN - optional secure views that filter rows, drop columns, or mask values for each consumer
- read-only recipients
- owner-controlled update and include-pattern policy
Prerequisites
A working connection, the source database, and the intended audience. Reuse these from context; related skills are available for missing setup or SQL details.
Default Posture
- Prefer
ACCESS RESTRICTEDplusGRANT READ ON SHARE ... TO ROLE ...for governed internal distribution. UseACCESS ORGANIZATIONonly when the caller deliberately wants its legacy organization-wide behavior. - Use
INCLUDE_PATTERNwhen every recipient of one share should see the same table/view subset. Create separate shares when audiences need different table subsets; when they differ only by rows, columns, or masked values, one share with secure views can serve them all. - Use
UPDATE MANUALwhen the recipient needs a stable snapshot or versioned delivery. - Use
ACCESS RESTRICTEDorVISIBILITY HIDDENwhen distribution should stay tightly controlled. - Confirm whether the recipient is an internal user, another organization, or public before choosing access and visibility.
- For write-heavy publishers, verify the DuckDB client version is one MotherDuck supports before relying on checkpoint or concurrent-write behavior during share-update workflows.
INCLUDE_PATTERNselects whole tables and views; never describe it as row- or column-level security. It works on native MotherDuck and fully managed DuckLake sources.- For row filtering, hidden columns, or masked values, add secure views to the share:
CREATE SHARE ... WITH SECURE VIEW REPLACES <table> AS (SELECT ...)orALTER SHARE ... ADD [OR REPLACE] SECURE VIEW. Key the policy oncurrent_email()for people,current_userfor service accounts,is_role_in_session('<role>'), orsession_context('<key>')when many tenants connect as one service account and a server-minted token context (or embed sessioncontext) carries the tenant. One share with secure views can replace a set of per-audience shares. They are plan-gated, and managing them in SQL needs a recent DuckDB client and a read-write token; check the current secure-views docs for both. - Write secure views with explicit column lists, never
SELECT *(includingSELECT * EXCLUDEorSELECT * REPLACE): a new source column would otherwise leak to every consumer, and schema changes break the view. A table the share exposes without a replacing secure view stays fully readable. CombineINCLUDE_PATTERN(which tables) with secure views (which rows and columns) and keep macro schemas and mapping tables outside the pattern. - MotherDuck secure views are share policies. DuckDB's own
CREATE SECURE VIEWis only an optimizer barrier and restricts nothing.
Workflow
- Identify the exact database to publish and who should consume it.
- Decide the audience, visible table/view subset, discoverability, and freshness requirements before writing SQL.
- Preview and validate any include pattern against the live source catalog, then create the share with explicit access, visibility, update mode, and optional
INCLUDE_PATTERN. - If access is restricted, grant users or roles explicitly. If the share is hidden or link-based, distribute the share URL directly.
- Read the share back with
LIST SHARESorMD_INFORMATION_SCHEMA.OWNED_SHARES; for filtered shares, verify the stored pattern and consumer-visible catalog. For secure views, runSHOW SECURE VIEWS ON SHARE <name>and attach the share as a consumer to check the result; identity functions evaluate as whoever runs the test. - Have recipients
ATTACHthe shared database and query it read-only. - Use
ALTER SHARE ... SET|RESET INCLUDE_PATTERNfor table/view scope changes andALTER SHARE ... ADD|DROP SECURE VIEWfor policy changes (not both in one statement). AvoidCREATE OR REPLACE SHAREon a share with secure views; it drops any view it does not restate. If the share usesUPDATE MANUAL, the owner runsUPDATE SHAREand consumers runREFRESH DATABASEwhen a new snapshot is ready.
For answer, review, or planning requests, return the sharing design and SQL without provisioning. For create, update, grant, or revoke requests, perform the requested in-scope operation and validate the resulting access; ask before public exposure, destructive revocation, or unrelated grants.
References
Read only the reference sections needed for the current task.
- For who-gets-what design across teams, tenants, or environments, use
motherduck-security-governance(references/ACCESS_CONTROL_SETUPS.md). - Read
references/SHARE_PLAYBOOK.mdfor the full SQL playbook, role grants, include-pattern rules, secure views, access/update decisions, consumer workflow, and common failure modes.
Related Skills
Load related skills only for missing capabilities; reuse established context.
motherduck-connectfor MotherDuck authentication and connection setupmotherduck-explorefor discovering databases, tables, columns, and existing sharesmotherduck-queryfor validating share SQL and downstream queriesmotherduck-duckdb-sqlfor DuckDB SQL syntax and lookup supportmotherduck-security-governancefor role design and access-boundary review
Explore more skills
Browse all- Motherduck Design DiveDesign or improve a MotherDuck Dive’s layout, responsive behavior, themes, filters, and visual accessibility.
- Motherduck Build Malleable DiveBuild a generative MotherDuck Dive where a Flight writes a daily briefing and question-to-page specs from a semantic…
- Motherduck Manage GuidesRead or maintain MotherDuck Guides for business definitions, join rules, and reusable warehouse conventions.
- Motherduck Model DataDesign or implement MotherDuck analytical schemas and transformation models, including grain, types, and…
- Motherduck ExploreFind and understand MotherDuck databases, tables, columns, shares, and sample data, including which tables hold a given…
- Motherduck Load DataLoad files, object storage, dataframes, or external databases into MotherDuck with bulk ingestion. Use for any import…
Security
Reviews (0)
More from MotherDuck Agent Skills
View source →Frequently asked questions about motherduck-share-data
What does the motherduck-share-data skill do?
Create, consume, or manage MotherDuck data shares, including audience grants, table filters, and refresh policy. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the motherduck-share-data skill?
Run `npx @skills-hub-ai/cli install motherduck-share-data` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/motherduck-share-data/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does motherduck-share-data work with?
motherduck-share-data runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the motherduck-share-data skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use motherduck-share-data after installing it?
In Claude Code, type `/motherduck-share-data` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the motherduck-share-data skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.
Badge for your README
Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.
[](https://skills-hub.ai/skills/motherduck-share-data)<a href="https://skills-hub.ai/skills/motherduck-share-data"><img src="https://skills-hub.ai/api/badges/skill/motherduck-share-data" alt="Install on Skills Hub"></a>More options in the badge docs.