bigquery-analytics
Skill1 starsChanged 2 months agoMITView on GitHub
Model and query BigQuery for analytics without burning slots or money — partitioning and clustering, always filter the partition column, avoid SELECT * (columnar billing), nested/repeated fields, streaming vs batch load, approximate aggregates, scheduled queries and materialized views, and never treat it as an OLTP store. Use when the event pipeline lands data in BigQuery, when writing an analytics query, or when a query is expensive/slow.
In this repository73 other files it gives its agents.
- AGENTS.mdAGENTS.md
- cache-invalidationSkill
- mongo-aggregationSkill
- mongo-modelingSkill
- postgres-aggregationSkill
- postgres-indexingSkill
- redis-coordinationSkill
- redis-patternsSkill
- review-querySkill
- code-migrationSkill
- cut-releaseSkill
- data-migrationSkill
- deploy-serviceSkill
- hotfixSkill
- rollbackSkill
- design-endpointSkill
- design-eventSkill
- design-schemaSkill
- evolve-contractSkill
- scaffold-nestjs-moduleSkill
- scaffold-projectSkill
- incident-responseSkill
- investigate-bugSkill
- on-callSkill
- postmortemSkill
- audit-skillsSkill
- distill-review-styleSkill
- write-skillSkill
- debug-with-tracesSkill
- define-alertsSkill
- instrument-serviceSkill
- evaluate-dependencySkill
- grillSkill
- handoffSkill
- orientSkill
- phased-deliverySkill
- spikeSkill
- to-questionnaireSkill
- write-adrSkill
- write-prdSkill
- devops-pr-reviewSkill
- go-backend-pr-reviewSkill
- nestjs-backend-pr-reviewSkill
- python-backend-pr-reviewSkill
- react-frontend-pr-reviewSkill
- bisectSkill
- break-couplingSkill
- dead-code-sweepSkill
- deslopifySkill
- extract-moduleSkill
- rebase-cleanSkill
- resolve-merge-conflictsSkill
- split-commitSkill
- tddSkill
- wait-whatSkill
- wide-renameSkill
- bullmqSkill
- kafkaSkill
- sqs-consumerSkill
- audit-dependenciesSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Every design decision is really a cost decision.
- Very specific: line 14
Partition: every large table — by ingestion time (_PARTITIONTIME / _PARTITIONDATE), an event-time DATE/TIMESTAMP column, or an integer …
- Very specific: line 29
Always filter the partition column in the WHERE.
- Distinctive: line 31
Check the bytes-processed estimate (dry run / the editor's validator) before running — it's the bill.
- Distinctive: line 46
Don't: update/delete row-by-row — BigQuery is append-optimized.
- Very specific: line 60
No point lookups by key at low latency, no per-request reads, no transactions.
- Very specific: line 61
If a service needs to read one row fast, that lives in Postgres/Mongo/Redis — copy to BigQuery for analytics.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
BigQuery analytics
BigQuery bills by bytes scanned (on-demand) or slot-time (reservations).
Every design decision is really a cost decision. The event-service pipeline
streams events here — model it for the dashboards that read it.
Table design
- Partition every large table — by ingestion time (
_PARTITIONTIME/_PARTITIONDATE), an event-timeDATE/TIMESTAMPcolumn, or an integer range. Queries must filter the partition column or they scan everything. - Cluster by the columns you filter/group on most (up to 4, order matters — most-selective first). Clustering prunes blocks within a partition.
- Require a partition filter (
require_partition_filter = true) on big tables so a missing filter errors instead of scanning a year. - Denormalize — BigQuery joins are fine but a wide denormalized table (or nested/repeated fields) usually beats a star schema for scan cost.
- Nested & repeated (
STRUCT,ARRAY<STRUCT>) — model one event with its attributes as nested fields;UNNESTto flatten in the query. Avoids joins.
Querying
- Never
SELECT *— you're billed for every column's bytes. Name the columns. - Always filter the partition column in the
WHERE; add cluster-column filters. - Check the bytes-processed estimate (dry run / the editor's validator) before running — it's the bill.
- Approximate aggregates —
APPROX_COUNT_DISTINCT,APPROX_QUANTILES— orders of magnitude cheaper than exactCOUNT(DISTINCT)on billions of rows, when approximate is acceptable. - Window functions and
QUALIFYfor top-N-per-group without a subquery. WITHCTEs are inlined (re-evaluated per reference) — for an expensive shared subquery, write to a temp table or use a materialized view.
Loading
- Batch load (from GCS, or
LOAD DATA) is free and preferred for bulk. - Streaming inserts cost per row and land in a streaming buffer — use only
when you need sub-minute freshness. The
event-serviceshould batch where it can. - Don't update/delete row-by-row — BigQuery is append-optimized; DML on individual rows is slow and quota-limited. Model as append + "latest wins" via a window function or a scheduled dedup.
Serving dashboards
- Materialized views for common rollups — auto-maintained, queries against the base table transparently use them.
- Scheduled queries to build daily rollup tables that dashboards read cheaply.
- BI Engine reservation for sub-second dashboard queries if it's worth the cost.
Not an OLTP store
No point lookups by key at low latency, no per-request reads, no transactions. If a service needs to read one row fast, that lives in Postgres/Mongo/Redis — copy to BigQuery for analytics.
Anti-patterns
- ❌
SELECT *. - ❌ A query with no partition-column filter on a big table.
- ❌ Streaming inserts when a batch load would do.
- ❌ Row-by-row
UPDATE/DELETE. - ❌ Exact
COUNT(DISTINCT)over billions when approximate is fine. - ❌ Using it as a lookup store for a service's hot path.
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.

