← All cookbooks Data cookbook

Data

Validated SQL against your real warehouse. Stakeholder-ready charts. Weekly metric anomalies surfaced for you.

Marquee recipe

Weekly metric anomaly digest, Mondays at 7am

Anomalies caught the morning they happen, not three sprints late.

Trigger
Routine, schedule, weekly Monday 07:00
Skills
statistical-analysis, write-query
Features
Routines (cloud schedule), Snowflake + BigQuery connectors, plan mode

Monday morning the data team walks in with a short list of metrics that moved unusually last week, the queries that surfaced them, and a candidate explanation for each. Stops anomalies from being noticed weeks late.

How to set it up

  1. 1
    Install the data plugin
    Install in Cowork ↗ claude plugin install data@pace
  2. 2
    Authorize your warehouse + Slack

    Snowflake / Databricks / BigQuery use Custom URL authorization : provide your account's MCP endpoint the first time Claude asks. Slack is OAuth.

  3. 3
    Create the scheduled routine

    In Cowork, open RoutinesNew routineSchedule · Weekly · Monday · 07:00.

  4. 4
    Paste this as the routine prompt

    Edit the KPI list to match your team's metrics + the channel name.

    Routine prompt
    Run statistical-analysis against last week's data
    for these KPIs: signups, activations, weekly active users,
    revenue, gross retention. Use write-query as needed
    to pull the underlying numbers from the warehouse. Flag
    any metric that moved more than ~2 standard deviations
    from the trailing 8-week baseline. For each anomaly,
    include: the slice (segment / cohort), the SQL that
    surfaced it, week-over-week delta, and one candidate
    explanation. Post the digest to #data-weekly in Slack.
  5. 5
    Click Run now to verify

    The first run may take 5+ minutes if your warehouse queries are heavy. Verify the digest format, then trust the Monday 07:00 cadence going forward.

Self-serve queries that don't lie

Trigger
Interactive, slash command in Claude Code
Skills
write-query
Features
Snowflake connector, schema-aware autocomplete, plan mode

Anyone on the team can run write-query "revenue by region for Q3, excluding refunds" and get a working query against the real schema, with the unit assumptions made explicit. Plan mode lets you sanity-check before running.

Anomaly digest, every weekday morning

Trigger
Routine, schedule, weekdays 07:00
Skills
write-query, interpret
Features
Routines (cloud schedule), Snowflake + Slack connectors, sub-agent fan-out per metric

Runs the standard metrics (DAU, signups, conversion, NRR) against yesterday vs. trailing 28 days. Flags anything beyond 2 standard deviations. For each flagged metric, a sub-agent runs interpret to surface likely causes and the slice to investigate first. Posts the digest to #data-pulse with the boring ones collapsed.

Weekday anomaly prompt
Every weekday at 7am, run our standard metrics (DAU, signups, conversion, NRR) against yesterday versus the trailing 28-day baseline. Flag anything more than 2 standard deviations off.

For each flagged metric, spawn a sub-agent that runs interpret against it: candidate cause, which slice to investigate first (cohort / channel / region / plan tier). Post the digest to #data-pulse with the boring metrics collapsed; flagged metrics expanded with the analyst notes.

Pre-merge SQL review on every analytics PR

When someone opens a PR that touches a .sql file or a dbt model, a hook runs validate-analysis against the changes: column-level reasoning, common pitfalls (cartesian joins, NULL handling, timezone drift), and a clear "is this query answering what it claims to answer?" check. Findings post as inline review comments before a human ever opens the diff.

Trigger
Routine, GitHub trigger on pull_request.opened for repos with SQL/dbt
Skills
validate-analysis, write-query
Features
Routines (GitHub trigger), inline PR comments, dbt + Snowflake context

How to set it up

  1. 1
    Create the scheduled routine in Cowork

    In Cowork, open RoutinesNew routineSchedule. Match the cadence described in the trigger above.

  2. 2
    Paste this as the routine prompt
    PR validate-analysis prompt
    When a PR opens that touches a .sql file or a dbt model, run validate-analysis against the changed queries. Check column-level reasoning, common pitfalls (cartesian joins, NULL handling, timezone drift), and the higher-level question: is this query answering what its name claims it answers?
    
    Post findings as inline review comments on the PR before a human ever opens the diff.
  3. 3
    Click Run now to verify

    Eyeball the first run for accuracy. Once it looks right, the routine fires on its trigger from then on. Assumes the plugin from the marquee above is already installed and connectors authorized.