CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

cassis/dbt-agent-readiness

Audit a dbt project for what an AI agent will get wrong if you point it at the data today: wrong metric, wrong table, missed rows, broken joins. Produces one evidence-backed report with blockers, verification queries, and a safe starting perimeter.

Quality

90%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

Overview
Quality
Evals
Security
Files

messy-jaffle-shop-audit.mdexamples/

dbt-agent-readiness: messy_jaffle_shop

Scanned: 10 models | Date: 2026-08-24 Source: YAML + raw SQL (manifest not compiled)

This example shows the output format against the bundled test-fixtures/messy-jaffle-shop project. Use it to see what an audit report looks like before installing.

Readiness verdict

Posture: Not ready for self-serve. Distance to ready: Afternoon of doc fixes + a sprint for grain declarations and tests. Confidence: High.

In plain terms: The project is small and cleanly laid out, but an agent pointed at it today can make four concrete mistakes: join customers incorrectly because the same entity is named customer_id, cust_id, and user_id; produce different revenue numbers depending on whether it picks fct_revenue or rpt_daily_revenue; SELECT customers.loyalty_tier, which is documented in YAML but absent from the SQL output; and misinterpret columns whose descriptions are placeholders such as "Customer ID", "The amount", and "Primary key". Description coverage is 46.5% raw, but only 25.6% of columns carry trustworthy descriptions.

Blockers (agent will hit these today)

1. The same entity is named three different ways across models

What the agent gets wrong: Asked "how many orders did customer X place?", the agent joins orders.customer_id to customers.customer_id and misses the rows in fct_revenue where the column is cust_id. Or filters WHERE user_id = X on a staging model where the same concept is customer_id. Evidence: catalogs.concept_variants cluster customer_id has distinct names ['cust_id', 'customer_id', 'user_id']. models/marts/fct_revenue.sql:13 emits o.cust_id. models/marts/customers.sql:11 aliases o.cust_id as customer_id. Staging uses user_id in stg_customer_events. Affected models: customers, orders, fct_revenue, int_customer_orders, stg_customer_events. Blast radius: Every cross-model customer question. Fix: Rename to one canonical form (customer_id). Single find-replace pass + test updates. Fix type: naming. Effort: afternoon.

2. Two revenue marts, both with ambiguous grain

What the agent gets wrong: Asked "what was revenue last week?", the agent picks fct_revenue or rpt_daily_revenue at random. fct_revenue groups by (order_date, cust_id, has_refund) — one row per customer per day per refund-status. rpt_daily_revenue groups by revenue_date only — one row per day. SUM(total_revenue) on either works but "average revenue per row" gives wildly different answers. Evidence: Review queue flagged grain_ambiguous (severity high) on both models. models/marts/fct_revenue.sql:23 groups by three columns but no description declares the grain. models/marts/rpt_daily_revenue.sql same pattern. Affected models: fct_revenue, rpt_daily_revenue. Blast radius: Every revenue question. Fix: Add Scope: + Grain: lines to both YAML descriptions. Decide which is canonical and cross-reference from the other. Fix type: doc_only + semantic_layer_decision. Effort: afternoon.

3. Description coverage is half as trustworthy as it looks

What the agent gets wrong: Reads "Primary key" on customers.customer_id and gets no information about what a customer actually is. Reads "The amount" on orders.amount and doesn't know if it's gross, net, in cents, in dollars, or includes refunds. Evidence: catalogs.effective_description_coverage reports 11/43 trustworthy (25.6%) vs 20/43 raw (46.5%). Breakdown: 8 weak descriptions, 1 phantom-documented, 0 SQL contradictions. Top offenders: customers.customer_id = "Primary key", orders.amount = "The amount", orders.order_id = "Order ID". Affected models: customers, orders, all 4 staging models. Blast radius: Any question whose answer depends on measure semantics. Fix: Replace the 8 weak descriptions with ones that say what the entity is, not what type the column is. Fix type: doc_only. Effort: afternoon.

4. YAML documents a column the model does not emit

What the agent gets wrong: Uses customers.loyalty_tier for a segmentation question and produces a query that fails because the column does not exist. Evidence: models/marts/_marts_schema.yml:22 declares loyalty_tier. The static analyzer resolves the final CTE through models/marts/customers.sql:18 and confirms that its output does not include the column. catalogs.phantom_columns_by_model reports the finding with confidence: high and no unresolved macro signals. Affected models: customers. Blast radius: Any customer segmentation or loyalty-tier question. Fix: Either add the intended loyalty_tier expression to customers.sql or remove the stale YAML declaration. Fix type: code_or_doc. Effort: hour.

Notes on what did NOT become a Blocker

  • 0 relationship tests, 3 models with zero tests — forecasts, not evidence. Moved to Hygiene with verification queries.

Hygiene (risk factors — verify before trusting the pilot)

Verification to-do

RiskModel / columnVerification queryIf non-zero
Missing PK testint_customer_orders.customer_id (1 inbound ref)SELECT customer_id, COUNT(*) FROM int_customer_orders GROUP BY 1 HAVING COUNT(*) > 1promote: fan-out on join to customers
Missing PK testfct_revenue (composite grain)SELECT order_date, cust_id, has_refund, COUNT(*) FROM fct_revenue GROUP BY 1,2,3 HAVING COUNT(*) > 1promote: revenue double-counted
Missing relationshipsorders.customer_id → customers.customer_idSELECT COUNT(*) FROM orders a LEFT JOIN customers b ON a.customer_id=b.customer_id WHERE b.customer_id IS NULL AND a.customer_id IS NOT NULLpromote: orphan orders, LEFT JOIN returns nulls agent won't expect
Missing accepted_valuesorders.status, stg_orders.status, customers.loyalty_tierSELECT DISTINCT status FROM orders — compare against docspromote if undocumented values exist

Standing hygiene items (don't block pilot, keep on backlog)

  • Grain undeclared on 3/4 core models. The description of fct_revenue and rpt_daily_revenue is also silent on cardinality (see Blocker #2) — those two are promoted. customers and orders have grain clear enough from context.
  • Models with zero tests (3): int_customer_orders, int_order_payments, stg_customer_events. Listed in appendix.
  • Global test severity: not set (falls back to dbt default: error). No action needed.

What's safe to start with

Safe today

No models currently meet all safety criteria. The closest candidate is stg_customers (has PK test, grain clear from context, no Blocker flags) — safe for simple "how many customers?" questions, but not for anything joining to orders until Blocker #1 is resolved.

Safe after one small fix

ModelOne fixFile
ordersReplace "The amount" with "Order total in USD, including tax, after discounts, before refunds"models/marts/_marts_schema.yml
stg_customersReplace "Primary key" on customer_id with "Unique customer identifier (sourced from raw.customers.id)"models/staging/_stg_schema.yml
int_customer_ordersAdd unique test on customer_idmodels/intermediate/_int_schema.yml

Out of scope until remediation

  • Any cross-model customer question (Blocker #1).
  • Any revenue question routed through fct_revenue vs rpt_daily_revenue (Blocker #2).
  • Any question selecting customers.loyalty_tier until Blocker #4 is resolved.

Remediation backlog

This week (doc/naming fixes)

  • Rename cust_id / user_id → customer_id project-wide (find-replace).
  • Add Scope: + Grain: paragraphs to fct_revenue and rpt_daily_revenue.
  • Replace the 8 weak descriptions listed in Appendix.
  • Either implement customers.loyalty_tier or remove it from the YAML schema.
  • Add an accepted_values test on orders.status and stg_orders.status (listing the canonical set).

This sprint (model + test changes)

  • Add unique + not_null tests to all FKs.
  • Add relationship test on orders.customer_id → customers.customer_id.

Later (structural)

  • Decide whether fct_revenue or rpt_daily_revenue is canonical; deprecate the other.

Coverage snapshot

DimensionScoreDetail
Concept consistencypoor1 concept cluster (customer_id/cust_id/user_id) across 5 models
Scope/filter transparencygoodNo hidden WHERE clauses detected
Description trustworthinesspoorEffective 25.6% vs raw 46.5% — 9 untrusted of 20 documented
Key/entity stabilitymixedKeys named inconsistently; no relationship tests
Safe entry pointspoorNo mart meets safety criteria today

Detailed metrics

MetricScore
Models with descriptions6/10 (60%)
Columns with descriptions (raw)20/43 (46.5%)
Columns with trustworthy descriptions (effective)11/43 (25.6%)
Grain declared (core/ref)0/4 (informational)
Relationships declared / implicit0 / 3 (informational — see Verification to-do)
Unique / not_null / accepted_values / relationships tests4 / 5 / 1 / 0
Models with zero tests3

Why two coverage numbers? Raw coverage counts any non-empty YAML description. Effective coverage subtracts columns whose descriptions are weak (restate the name or are placeholders), copy-pasted, contradict the SQL, or describe phantom columns. The gap is the share of docs an agent cannot trust.

What's working well

  • Clean three-layer structure (staging → intermediate → marts).
  • No broken refs, no lineage cycles, no duplicate YAML columns.
  • Every staging model has at least one test.

Appendix

Review packet verdicts

PacketVerdictSeveritySummary
customerconfirmedhighcustomer_id / cust_id / user_id clusters across 5 models
fct_revenue (grain)confirmedhighGROUP BY 3 columns, no grain declared
rpt_daily_revenue (grain)confirmedhighGROUP BY revenue_date, no grain declared

Catalogs (non-empty sections)

Low-quality column descriptions (8 from catalogs.weak_column_descriptions)

ModelColumnCurrent textReason
customerscustomer_id"Primary key"generic_technical
stg_customerscustomer_id"Primary key"generic_technical
int_customer_orderscustomer_id"Customer ID"restates_name
ordersorder_id"Order ID"restates_name_or_too_short
ordersamount"The amount"restates_name
stg_ordersorder_id"The ID"restates_name_or_too_short
stg_paymentspayment_id"Payment ID"restates_name
stg_paymentsamount"The amount"restates_name

Same-concept-different-name clusters (1 from catalogs.concept_variants)

  • Canonical: customer_id. Variants: cust_id, customer_id, user_id.
  • Evidence: cust_id as customer_id in customers.sql; user_id in stg_customer_events.

Same name, different grain (2 from catalogs.same_name_different_grain)

ColumnLayersExamples
order_countcore, intermediatecustomers.order_count, int_customer_orders.order_count
amountcore, stagingorders.amount, stg_orders.amount, stg_payments.amount

Phantom columns by model (1 from catalogs.phantom_columns_by_model)

ConfidenceModelCountPhantom columnsMacro signalsYAML path
highcustomers1loyalty_tiernonemodels/marts/_marts_schema.yml

Categorical columns with values only in SQL (via test_summary.categorical_columns_without_accepted_values)

ColumnModels
statusorders, stg_orders
loyalty_tiercustomers

Hygiene appendix: test gaps

Models with zero tests (3): int_customer_orders, int_order_payments, stg_customer_events.

What this audit cannot detect

  • Runtime data quality (null rates, freshness, row counts) — requires executing queries; verification queries in Hygiene cover this.
  • Whether a join makes business sense.

Audit metadata

MetricValue
Total models scanned10
Models reviewed by LLM10 (inline — subagent threshold is >30 models)
Review packets generated2
Concept index size6 concepts across 10 models
Blockers4
Hygiene items4
Inventory methodscript

Generated by the dbt-agent-readiness skill for Claude Code. This audit was built by the team at Cassis, the living context layer between a company's data and its business.

CHANGELOG.md

LICENSE

README.md

report-template.md

requirements.txt

SKILL.md

tile.json

TROUBLESHOOTING.md