analytics-hub-publisher
Skill0 starsChanged 3 months agoMITView on GitHub
Design and publish BigQuery data products through Analytics Hub, including exchanges, listings, subscriber governance, and the decision of whether to share at all. Use when the user mentions Analytics Hub, a data exchange, a listing, sharing datasets across projects or with a partner or vendor, linked datasets, or asks how to give another team read access without copying data.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- gcp-data-engineeringSkill
- bq-cost-auditorSkill
- bq-schema-contractSkill
- composer-dag-builderSkill
- dataform-modelerSkill
- de-pr-reviewerSkill
- pipeline-incident-triageSkill
- terraform-gcp-scaffolderSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
Create pub_<domain> containing only the published surfaces.
- Very specific: line 100
Read references/execution-model.md.
- Distinctive: line 130
When designing a share, return: the mechanism chosen and why, the exchange and listing names, the publication dataset contents, the …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Analytics Hub publisher
Decide the sharing mechanism first
Analytics Hub is not always the answer. Work down this table before designing an exchange.
| Situation | Use | Why not Analytics Hub |
| One team, same org, one dataset | dataset IAM grant | an exchange is overhead for one grant |
| Row or column restrictions per consumer | authorized view, or row-level security | listings share the whole dataset |
| Many consumers, stable product, cross-project | Analytics Hub | this is what it is for |
| External partner, different org | Analytics Hub | no data copy, no egress, revocable |
| Consumer needs to write | not sharing, a pipeline | linked datasets are read-only |
| One-off extract | authorized view or an export | a listing implies a commitment |
Say plainly that a listing is a product commitment. Publishing one means you have promised a schema, a freshness, and a deprecation path to people you may never meet. If the user is not ready for that, recommend an authorized view instead.
Structure
- Exchange: a container, scoped by audience.
internal-analytics,partner-suppliers,public-reference. Do not put internal and partner listings in the same exchange. - Listing: one per data product, backed by one dataset.
- Linked dataset: what the subscriber creates in their own project. It is read-only, queried on the subscriber's own slots, and reflects the source live.
Billing follows the query, so subscribers pay for their own scans. Storage stays with you. Say this explicitly when someone asks who pays.
Prepare the source dataset before listing it
A listing exposes the whole dataset, so the dataset must contain only what you intend to publish. Build a dedicated publication dataset rather than listing a working dataset.
- Create
pub_<domain>containing only the published surfaces. - Populate it with authorized views over the marts, so you keep control of the column list.
- Description and column descriptions on everything. This is the documentation the subscriber sees, and it is the only documentation they get.
- Partition filters required, so a subscriber cannot accidentally scan history.
- A schema contract on file for each table. See
bq-schema-contract.
Terraform
resource "google_bigquery_analytics_hub_data_exchange" "internal" {
project = var.project_id
location = var.location
data_exchange_id = "internal_analytics"
display_name = "Internal analytics"
description = "Governed data products published by the data platform team."
primary_contact = "data-platform@example.com"
}
resource "google_bigquery_analytics_hub_listing" "orders" {
project = var.project_id
location = var.location
data_exchange_id = google_bigquery_analytics_hub_data_exchange.internal.data_exchange_id
listing_id = "retail_orders_v1"
display_name = "Retail orders, v1"
description = "One row per order. Grain: order_id. Refreshed daily by 07:00 UTC."
primary_contact = "data-platform@example.com"
documentation = "https://internal.example.com/docs/data/retail-orders"
bigquery_dataset {
dataset = google_bigquery_dataset.pub_retail.id
}
restricted_export_config {
enabled = true
restrict_query_result = true
}
}
resource "google_bigquery_analytics_hub_listing_iam_member" "finance" {
project = var.project_id
location = var.location
data_exchange_id = google_bigquery_analytics_hub_data_exchange.internal.data_exchange_id
listing_id = google_bigquery_analytics_hub_listing.orders.listing_id
role = "roles/analyticshub.subscriber"
member = "group:finance-analytics@example.com"
}Version in the listing id, not just the display name. retail_orders_v1 and
retail_orders_v2 can coexist while consumers migrate, which is the whole point
of versioning a published product.
Inspect before you publish
Read references/execution-model.md. A listing exposes an entire dataset, so
check what is actually in it before designing one. list_table_ids and
get_dataset_info tell you whether the working dataset has tables nobody
intended to publish, which is the usual reason a publication dataset is needed.
Creating the exchange, the listing, and the IAM bindings are writes. Emit the Terraform and the gcloud commands.
Governance
- Grant
roles/analyticshub.subscriberto groups, never to individuals. restricted_export_configon anything that leaves the org, so results cannot be exported wholesale.- Review subscribers quarterly. List them and ask each owner if they still need it:
gcloud bigquery analytics-hub listings list \
--data-exchange=internal_analytics --location=us
gcloud bigquery analytics-hub listings get-iam-policy LISTING_ID \
--data-exchange=internal_analytics --location=us- Deprecating a listing: announce, keep the old version live for one full consumer cycle, then delete. Deleting a listing breaks every linked dataset immediately and without warning to the subscriber, so never do it quietly.
Output format
When designing a share, return: the mechanism chosen and why, the exchange and listing names, the publication dataset contents, the Terraform, the subscriber groups, and the deprecation policy in one sentence.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

