Warehouse-only setup (discover)
Full walkthrough for Step 2a in SKILL.md. Read this on demand — only after the user has said they know their warehouse.
No secret is involved here — bq/snow/databricks are already in this skill's allowed tools — so run this in this chat session, not a separate terminal.
-
Ask for the warehouse type (BigQuery / Snowflake / Databricks) and the database/project/catalog name. Do not ask the user to recall schema names: only the warehouse and database are required, and schema names are discoverable (step 3 below lists them). Discovery does not match on schema name anyway, because Fivetran schema names are arbitrary (a Facebook Ads connector may land in a schema called
ads_9108233). Instead, discovery inspects the table names inside each schema and fingerprints them against known connector/QDM table sets. -
Run
check-clifor the chosen warehouse tool first (same as the Prerequisites step inSKILL.md) to confirm the CLI is installed and authenticated. -
List the schemas and let the user pick from what is shown, rather than asking them to name one from memory:
bash ${CLAUDE_SKILL_DIR}/asa.sh list-schemas \ --warehouse <bq|snowflake_cli|databricks_cli> --database <name> 2>&1; echo "EXIT:$?"This is a metadata-only lookup (
bq ls,SHOW SCHEMAS), so it is cheap on all three warehouses and reads no table inventory. Exit0printsschemas[]; exit53means the database has no schemas, so re-check the database name. Show the names, ask which look relevant, and pass those as--schemain the next step. If the user cannot tell, skip--schemaand let fingerprinting decide. On BigQuery this step also avoids the--locationrequirement, sincebq lsis not a regionalINFORMATION_SCHEMAview. -
Run discovery:
bash ${CLAUDE_SKILL_DIR}/asa.sh discover \ --warehouse <bq|snowflake_cli|databricks_cli> \ --database <project|database|catalog> \ --schema <schema_name> [--schema <schema_name> ...] 2>&1; echo "EXIT:$?"Omit
--schemaentirely if the user gave none — discovery scans the whole database. For BigQuery specifically, prefer asking for at least one schema hint when possible: an unscoped scan queriesINFORMATION_SCHEMA.TABLESacross every dataset in the project's region, which is slow and can be costly on projects with many unrelated datasets. On BigQuery,--locationis required unless a--schemahint is given for discovery to read the region from; discovery will not assumeUS, because a scan against the wrong region returns zero rows that look identical to an empty project. -
Discovery exit codes:
0— profile written. Parse the printed JSON and present the same Setup Summary asSKILL.md's "Setup Summary" section (the shape is identical:connections[],single_source_qdms[],multi_source_qdms[]). Then continue to the Freshness Check inSKILL.md. Three optional keys need handling when present:raw_schema_placeholders— these families were found in the unified layer but no raw connector schema was fingerprinted for them, so raw-table drill-down is unavailable. Ask if the user can name the missing raw schema(s) and re-run with--schema-override <family>=<schema_name>. The named schema must be one discovery actually scanned, so add it via--schemain the same re-run if it was outside the original scope.linkage_warning— the connector-to-QDM linkage check did not succeed, so every connector is reported asrawtier andunified_schemais null. That looks the same as a warehouse with no QDM layer, so do not present the tiers as confirmed. Relay the warning and offer to re-run with--schema-override unified=<name>.broad_scan_warning— the scan covered more schemas than expected with no--schemahints given, so the fingerprint match may have picked up a schema belonging to an unrelated team/connector on a shared project. Relay the warning and offer to re-run with--schema <name>to narrow the scan.ignored_schema_override_keys— one or more--schema-overridekeys matched nothing and were skipped, usually a misspelled family name. Tell the user which keys were ignored and re-run with the corrected spelling.
70(CLI missing) or71(CLI unauthenticated) — same handling asSKILL.md's setup exit codes: surface the printed recipe verbatim and STOP.54(schema disambiguate) — multiple schemas matched the same fingerprint. Parse the JSON;"schemas"maps a key (either"multisource_ad_reporting"for the unified layer, or a connector family likegoogle_adsfor a raw schema) to a list of candidate schema names, and"hint"carries a ready-made re-run flag string. Show the candidate names to the user and ask which to use for each key, then re-run with--schema-override KEY=<chosen_schema>(repeatable):bash ${CLAUDE_SKILL_DIR}/asa.sh discover \ --warehouse <tool> --database <db> --schema <hint> \ --schema-override google_ads=<chosen_schema> 2>&1; echo "EXIT:$?"53(insufficient connectors / nothing found) — parse the JSON (required_pool,found,min_required_count, or a"not_found"message). Tell the user nothing matched, ask them to double-check the database/schema names, or offer to fall back to the Fivetran API key setup.- any other non-zero — relay the stderr message; offer to fall back to the Fivetran API key setup.
-
If you learn more after
discoverhas already run, re-run it. Discovery's fingerprinting is heuristic — it can under-detect. If you later confirm that a schema belongs to a connector beyond what the last run found, write that back by re-runningdiscover; do not leave the finding in chat.profile.jsonis whatresolveand every future session read, so anything not in it is lost at the end of this session.Re-run with the complete schema list, not just the newly found one.
discoveroverwrites the profile wholesale and does not merge with what is already there, so a re-run naming only the new schema silently drops every connector the previous run found. The same applies to--schema-override: overrides are not persisted, so any that were needed before must be repeated in the re-run.No flag is needed — unlike
setup,discoverhas no "already configured" guard and will simply rewrite the profile.Do not hand-edit
profile.json. A re-run is already safe and produces a profile that passes validation; a hand-edit can silently produce one that does not.
Acceptable degradations of a warehouse-discovered profile vs. the API-key path: it cannot know which QDM models are excluded from refresh, or when the transformation last ran (excluded_models is always empty, last_ended_at is always null) — that metadata only the Fivetran API has. This is fine because the Freshness Check (readiness) independently probes actual data recency per table at query time, so staleness is still caught.