About explore-lakehouse
Explore Lakehouse is a skill for exploring a project’s BigQuery lakehouse with the bq CLI. It guides users through dataset and schema inspection, layer assessment, and data completeness checks.
Key features
- 01List project datasets and tables
- 02Inspect schemas and preview rows
- 03Count rows and check nulls
- 04Assess bronze, silver, and gold layers
- 05Group tables by source
Use cases
- 01Survey tables in a dataset
- 02Inspect a table’s fields and sample rows
- 03Assess which data layers exist
- 04Find missing values in key fields
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ revosai/ skills --skill explore-lakehouseAfter installing, type/explore-lakehousein Claude Code to confirm it loaded.
Details
From the project READMEExplore Lakehouse
Use bq CLI to explore the BigQuery lakehouse for this project.
Environment
Resolve connection details from env vars before running any command:
echo "Project: $GOOGLE_CLOUD_PROJECT"
echo "Dataset: $REVOS_BQ_DATASET"
$GOOGLE_CLOUD_PROJECT— BQ project ID$REVOS_BQ_DATASET— default dataset (may be overridden by user)INFORMATION_SCHEMAqueries: omit--locationflag — use plainbq query --nouse_legacy_sql
Commands
List tables in the org's dataset:
bq ls $REVOS_BQ_DATASET
List all datasets in the project (only if the user explicitly asks):
bq ls --project_id=$GOOGLE_CLOUD_PROJECT
Inspect a table schema (filter out internal columns):
bq show --schema --format=prettyjson $REVOS_BQ_DATASET.<table> | python3 -c "
import json, sys
cols = json.load(sys.stdin)
names = [c['name'] for c in cols if not c['name'].startswith('_airbyte')]
print('\n'.join(names))
"
Preview sample rows:
bq head -n 5 $REVOS_BQ_DATASET.<table>
Get row counts for a list of tables:
for table in table1 table2 table3; do
echo -n "$table: "
bq query --nouse_legacy_sql --format=csv \
"SELECT COUNT(*) FROM \`$GOOGLE_CLOUD_PROJECT.$REVOS_BQ_DATASET.$table\`" 2>/dev/null | tail -1
done
Check null rates on a set of columns:
bq query --nouse_legacy_sql "
SELECT
COUNTIF(col1 IS NULL) AS col1_null,
COUNTIF(col2 IS NULL) AS col2_null,
COUNT(*) AS total
FROM \`$GOOGLE_CLOUD_PROJECT.$REVOS_BQ_DATASET.<table>\`
"
Workflows
"What's in my database?" / general overview
- List tables in the org's dataset:
bq ls $REVOS_BQ_DATASET - If the dataset is empty (no tables), tell the user:
- They can add data sources by running
revos sources createto open the RevOS UI - They can view existing sources with
revos sources list - Stop here — no further exploration is possible without data
- They can add data sources by running
- Infer the data source and domain from table name prefixes (e.g.
salesforce_*,stripe_*,hubspot_*) - Group tables by source/domain
- Return: sources found, table count per source, table types (TABLE/VIEW), one-line description per group
"What layer is this data?" / bronze–silver–gold assessment
- Check dbt model folders:
find dbt/models -type f | sort - If folders contain only
.gitkeep→ that layer hasn't been built yet - Assess the tables themselves:
- Bronze indicators: raw source-prefixed names, many flat columns with source-system naming (e.g.
properties_*,fields_*), no aggregations, no joins visible in schema - Silver indicators: cleaned column names, deduplicated, conformed types,
_idforeign keys - Gold indicators: aggregated metrics, wide fact tables, business-named columns (
arr,churn_rate,ltv)
- Bronze indicators: raw source-prefixed names, many flat columns with source-system naming (e.g.
- Report which layers exist and which are missing
"Is data complete?" / data quality check
- Get all tables:
bq ls <dataset> - For each table, fetch its schema to discover actual column names
- Identify the business-critical columns from the schema — look for:
- Identity/key columns: anything named
id,*_id,email,name - Date columns:
created_at,*_date,*_at - Relationship columns: foreign keys linking to other objects
- Core metric columns: amounts, statuses, stages, owner assignments
- Identity/key columns: anything named
- Run a single
COUNTIF(col IS NULL)query per table covering those columns - Where a source uses an
archived/is_deletedflag, filter it out:WHERE archived = false OR archived IS NULL - Present results per table:
| Field | Nulls | % Missing | Status |
|---|---|---|---|
| ... | ... | ...% | ✅ / ⚠️ / ❌ |
Status thresholds: ✅ < 5% · ⚠️ 5–50% · ❌ > 50%
- Summarise findings: which tables are well-populated, which have critical gaps, and what that means for downstream use
"What's in a specific table?"
bq show --schema— get full column list (omit_airbyte_*columns)SELECT COUNT(*)— row countbq head -n 5— sample rows- Identify and highlight the most important business columns from the schema
Output rules
- Never mention Airbyte — it is an internal ETL mechanism invisible to users
- Do not reference
_airbyte_*columns by name or explain their origin; omit them from schema summaries - Describe data freshness neutrally: "updated daily" not "partitioned on
_airbyte_extracted_at" - Do not use phrases like "via Airbyte", "Airbyte's flat-column pattern", or "Airbyte artifact"
- Always discover table structure dynamically from the schema — never assume column names from a previous session
- Group output by integration source when listing many tables
- Note small row counts (< 100 rows) as a possible indicator of sandbox or test data
Comments
Markdown supported