Skip to content
Data
Skill

/causal-query-classifier

Pearl's three-rung causal hierarchy as a query classifier. Tags every analytics question as rung-1 (association, P(Y|X)), rung-2 (intervention, P(Y|do(X))), or rung-3 (counterfactual, P(Y_x|Y',X')) before answering. Refuses to escalate a rung-1 observational finding into a

From plugin
analytics-skills
813 skills
Install
$ npx -y skills add clamp-sh/analytics-skills --skill causal-query-classifier --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/causal-query-classifier

Context preview

The summary Claude sees to decide when to auto-load this skill.

Pearl's three-rung causal hierarchy as a query classifier. Tags every analytics question as rung-1 (association, P(Y|X)), rung-2 (intervention, P(Y|do(X))), or rung-3 (counterfactual, P(Y_x|Y',X')) before answering. Refuses to escalate a rung-1 observational finding into a

SKILL.md

causal-query-classifier.SKILL.md
name: causal-query-classifier
description: Pearl's three-rung causal hierarchy as a query classifier. Tags every analytics question as rung-1 (association, P(Y|X)), rung-2 (intervention, P(Y|do(X))), or rung-3 (counterfactual, P(Y_x|Y',X')) before answering. Refuses to escalate a rung-1 observational finding into a rung-2 ship/kill recommendation without naming an identification strategy (back-door, instrumental variable, DiD, RDD, synthetic control). Use this skill whenever interpreting an analytics question that asks why or what-if, to classify it on Pearl's causal hierarchy before answering. Pairs with analytics-diagnostic-method. Triggers when Clamp MCP returns a comparison or trend that the user is about to act on, so the agent labels the claim's rung explicitly instead of laundering correlation into causation. Works with any observational source; Clamp MCP is the canonical integration via traffic.compare, funnels.list, and cohorts.compare.
when_to_use: When the user asks "did X cause Y", "what if we ship Z", "would CVR have moved if we hadn't launched", "is the lift from the new page real", or any question shaped as a counterfactual or intervention. Also when the user is about to act on a comparison or trend that came back from Clamp MCP (or any analytics tool) and wants a yes/no recommendation rather than a description.

Causal query classifier

Most analytics arguments lose at the question, not at the data. Someone shipped a new pricing page, CVR went up the same week, and the deck says "the page lifted CVR by 18%." The data says nothing of the sort — it says CVR was higher the week after launch. Pearl's three-rung causal hierarchy gives you a vocabulary for catching that slide before it happens.

This skill makes the rung explicit. Every question is classified before it's answered. Rung-1 questions get rung-1 answers. Rung-2 questions get either a real identification strategy or a refusal to make the claim.

When NOT to use this

  • The user is asking a purely descriptive question with no decision attached: "what's our checkout CVR this month?". That's rung-1 by construction; classification is overhead. Just answer it.
  • A randomized experiment is already running and you're reading its result. Randomization handles identification; load `experiment-result-reader` instead.
  • The user wants help designing an experiment. Use experiment-design tooling; this skill is for interpreting questions, not specifying tests.
  • You're inside a forecasting task (rung-1 prediction of the future), not a causal one. Predictions are rung-1; "what would the metric have been if we'd done X instead" is rung-3.

Background: Pearl's three rungs in plain language

Judea Pearl's hierarchy ranks queries by what they require of the data. Each rung subsumes the one below.

Rung 1 — Association: P(Y | X)

What is the relationship between two observed variables, exactly as the world has shown them to us. No intervention, no counterfactual. Pure observation.

  • "What's our checkout CVR?" → P(checkout | session)
  • "How does CVR vary by device?" → P(checkout | device)
  • "Mobile CVR is 1.8%, desktop is 3.6%." → joint distribution, descriptive only.

Rung-1 claims are always defensible from the data. They are also always silent about *why* the pattern holds. Mobile users may convert lower because mobile is worse, or because mobile attracts top-of-funnel browsers, or because the checkout form is broken on Safari. Rung-1 cannot distinguish these.

Rung 2 — Intervention: P(Y | do(X))

What would Y look like if we *forced* X to a specific value, holding everything else as it would have been. `do(X)` is Pearl's notation for an external setting of X — surgery on the causal graph that severs X from its usual causes.

  • "If we ship the new pricing page to everyone, what happens to CVR?" → P(CVR | do(new_page))
  • "If we double ad spend on Google, what's the lift on signups?" → P(signups | do(spend=2x))
  • "Does adding social proof on the homepage move CVR?" → P(CVR | do(social_proof=on))

P(Y | do(X)) is generally **not** equal to P(Y | X). The conditional is "among sessions where the new page was seen, what was CVR" — which is a rung-1 quantity contaminated by selection (the kind of users who saw the new page might differ from the kind who didn't). The interventional is "what would CVR be if we made everyone see the new page" — a counterfactual question about the world as it would be under a forced setting.

Rung-2 queries are answerable from observational data only if you can identify the causal effect through an explicit strategy. Named below.

Rung 3 — Counterfactual: P(Y_x | Y', X')

What would Y have been for *this specific unit* if X had been different, given what we actually observed. Counterfactuals are unit-level and contrary to fact.

  • "What CVR would we have had on the Q4 launch week if we'd held back the new page?" → P(CVR_{no_page} | CVR_observed, page_shipped)
  • "Would this specific user have churned if we'd given them the discount?" → unit-level counterfactual
  • "How much of the YoY revenue growth is attributable to the rebrand vs. the market?" → counterfactual decomposition

Rung-3 requires the strongest assumptions. It typically needs a structural model (synthetic control, causal forests, structural causal models), and it answers questions about specific units or specific historical moments — not generic policy.

Decision table: question shape → rung → strategies

| Question shape | Rung | What it actually asks | Identification strategies if observational | |---|---|---|---| | "What is X?" / "How does Y vary with X?" | 1 | P(Y|X) | None needed; descriptive | | "Why did X change?" | 1 or 2 | Depends — diagnostic (rung-1) or causal (rung-2) | If rung-2: requires explicit decomposition | | "Did X cause Y?" | 2 | P(Y|do(X)) | RCT, back-door adjustment, IV, DiD, RDD, synthetic control | | "Will X cause Y if we ship it?" | 2 | P(Y|do(X=on)) | RCT (preferred), or identification strate

Read more
Ships withanalytics-skills

Analytics skills for Claude, Cursor, and other AI agents. Read web analytics like a senior analyst: diagnose traffic changes, judge channel quality, read funnels, declare typed events, and read A/B tests without the usual rookie mistakes.

Get the whole plugin

Other skills on analytics-skills.