/motherduck-skills:motherduck-share-datafrom motherduck-skills
Creates, consumes, and manages MotherDuck data shares with audience grants, table filters, secure views, and refresh policy.
Ships in motherduck-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
ask_docs_question feature is available, use it before falling back to public docs.INCLUDE_PATTERNA working connection, the source database, and the intended audience. Reuse these from context; related skills are available for missing setup or SQL details.
ACCESS RESTRICTED plus GRANT READ ON SHARE ... TO ROLE ... for governed internal distribution. Use ACCESS ORGANIZATION only when the caller deliberately wants its legacy organization-wide behavior.INCLUDE_PATTERN when 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.UPDATE MANUAL when the recipient needs a stable snapshot or versioned delivery.ACCESS RESTRICTED or VISIBILITY HIDDEN when distribution should stay tightly controlled.INCLUDE_PATTERN selects whole tables and views; never describe it as row- or column-level security. It works on native MotherDuck and fully managed DuckLake sources.CREATE SHARE ... WITH SECURE VIEW REPLACES <table> AS (SELECT ...) or ALTER SHARE ... ADD [OR REPLACE] SECURE VIEW. Key the policy on current_email() for people, current_user for service accounts, or is_role_in_session('<role>'). 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.SELECT * (including SELECT * EXCLUDE or SELECT * 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. Combine INCLUDE_PATTERN (which tables) with secure views (which rows and columns) and keep macro schemas and mapping tables outside the pattern.CREATE SECURE VIEW is only an optimizer barrier and restricts nothing.INCLUDE_PATTERN.LIST SHARES or MD_INFORMATION_SCHEMA.OWNED_SHARES; for filtered shares, verify the stored pattern and consumer-visible catalog. For secure views, run SHOW SECURE VIEWS ON SHARE <name> and attach the share as a consumer to check the result; identity functions evaluate as whoever runs the test.ATTACH the shared database and query it read-only.ALTER SHARE ... SET|RESET INCLUDE_PATTERN for table/view scope changes and ALTER SHARE ... ADD|DROP SECURE VIEW for policy changes (not both in one statement). Avoid CREATE OR REPLACE SHARE on a share with secure views; it drops any view it does not restate. If the share uses UPDATE MANUAL, the owner runs UPDATE SHARE and consumers run REFRESH DATABASE when 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.
Read only the reference sections needed for the current task.
motherduck-security-governance (references/ACCESS_CONTROL_SETUPS.md).references/SHARE_PLAYBOOK.md for the full SQL playbook, role grants, include-pattern rules, secure views, access/update decisions, consumer workflow, and common failure modes.Load related skills only for missing capabilities; reuse established context.
motherduck-connect for MotherDuck authentication and connection setupmotherduck-explore for discovering databases, tables, columns, and existing sharesmotherduck-query for validating share SQL and downstream queriesmotherduck-duckdb-sql for DuckDB SQL syntax and lookup supportmotherduck-security-governance for role design and access-boundary reviewWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub motherduckdb/agent-skills --plugin motherduck-skills23 skills in this plugin
/motherduck-build-cfa-appBuild MotherDuck analytics into customer-facing applications with tenant isolation, backend routing, and serving APIs./motherduck-build-dashboardBuild a MotherDuck dashboard as a Dive, choosing the analytical story, metrics, and section queries./motherduck-build-data-pipelineBuild ingestion-to-serving pipelines on MotherDuck, including stage boundaries, transformations, and publication. Use for any recurring ingestion from an API, SaaS app, or database into MotherDuck.Other plugins' skills for the same job