/devils-analyst:metric-definitionsfrom devils-analyst
Provides correct formulas, valid grains, and common pitfalls for marketing metrics (CTR, CAC, ROAS, LTV, etc.) from platforms like GA4, Google Ads, Meta, Shopify, and email tools. Use before writing queries or reconciling conflicting numbers.
Ships in devils-analyst. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Most broken dashboards do not look broken. The total is right and the rows are wrong, or every number is right and the comparison is wrong. This skill is the definition layer: decide what each number means, at what grain, from which source, before any chart exists.
Before the dictionary, read the team's house rules: every .md file in a
house-rules/ folder at the root of the project or workspace, except
README.md, TEMPLATE.md and examples/ (fictional, never applied). In a
chat without files, use rules the user pasted, uploaded or keeps in the
project's knowledge. If route-question already listed them, use its list.
Precedence, highest first: what the user says in this conversation; the
team's house rules; the team's governed definitions (a Power BI model, a
metric dictionary); the shipped catalog and traps in this skill. A house rule
that defines a metric, a revenue of record, a conversion action, a filter or
a threshold replaces the catalog entry it names in overrides:, or the one it
contradicts. It cannot make an averaged rate or a summed distinct count
correct: if it seems to, report its number, show the core-rule number beside
it and say why they differ. In the dictionary, put the rule's id in the
Caveat column of every metric it changed.
Before querying, write a short dictionary for the metrics the dashboard needs, and show it with the dashboard (as a "Definitions" panel):
| Metric | Formula | Source | Grain | Filters | Format | Caveat |
|---|---|---|---|---|---|---|
| CTR % | unique clicks / delivered | Klaviyo campaign report | per send, summed | campaigns only, no flows | 0.0% | not clicks / opens; that is CTOR |
| CAC | paid acquisition spend / new customers | Google Ads + Meta spend; Shopify first orders | month | excludes brand search | $0 | platform spend, no agency fees |
Take formulas and caveats from references/catalog.md,
the per-platform export traps from
references/source-traps.md, CRM and lifecycle
definitions from references/crm-lifecycle.md, and organic
social goals and KPIs from references/organic-social.md.
If the team has a Power BI model, its definitions win over this catalog
(house rules still win over both): use the power-bi-definitions skill. If the user or a Claude Project already has a
metric dictionary, use it and say so.
Offer to save the dictionary as metric-dictionary.md in the user's Claude
Project, so the next dashboard uses the same definitions.
These come from Power BI modelling practice. They hold in any SQL, any spreadsheet, any connector.
SUM(clicks) / SUM(impressions), never AVG(ctr). An average of rates is a
number true of nothing.COUNT(DISTINCT orders.customer_id) in the filtered orders, not a count of
the customers table.SUM(position * impressions) / SUM(impressions).NULLIF(x, 0)) and show blanks as blanks.n_1d_click, n_7d_click, n_28d_click,
view windows: each contains the shorter ones), conversions vs
all_conversions, total vs unique clicks and opens, report_level rows
(account, campaign, ad group rows repeat the same spend), query rows vs
query x page rows, web vs image vs video search types. If an export has a
column like these, filter or choose before any SUM.- vs _) and report the rows that did not match.*_micros by 1,000,000, and keep media spend apart from fees,
payroll or other manual expense rows.references/sql-patterns.md has tested shapes for the cases that go wrong most: rates from parts, two sources joined after aggregation, period over period with explicit date ranges, impression-weighted position, the cohort triangle, new vs returning, budget pacing, and platform-vs-backend reconciliation. Adapt them to the warehouse dialect.
When the data comes from a connector rather than SQL (an API returning rows), apply the same rules in code: request the grain you will display, sum parts, divide last.
Every move above has a challenger. Run the attack, settle it with the check, and act on a failure before moving on.
| Move | Adversary asks | Check that settles it | If it fails |
|---|---|---|---|
| Write the dictionary | "Could two readers compute this metric differently from your definition?" | formula, grain, filters and source all filled | tighten the definition |
| Pick the grain | "Is any column in this sum non-additive or overlapping (users, reach, windows, report levels)?" | rules 5 and 13-20 checked against every column used | query at the right grain or pick one column |
| Join sources | "Did two facts meet before aggregation?" | recompute one total two ways (sum of rows vs source total) | aggregate each source first, then join |
| Compute rates | "Is any rate an average of rates or a ratio across two systems?" | numerator and denominator from the same system, summed | recompute from parts |
| Show the number | "What would make this number wrong that the reader cannot see?" | volume beside every rate; exclusions stated | add the caveat or the volume |
Score and probe before handing over. First the gate: every check in the table above passed; if one did not, fix it before scoring. Then score the draft 0-100 on four dimensions: clarity (unambiguous, easy to follow), relevance (answers the question asked, for this reader), depth (explains the why with numbers, not only the what) and insightfulness (says something the reader did not already know, and what to do about it). If any score is below 80, write the probe question that would raise it, answer it from the data, revise, and score again (two loops at most). The question and the decision belong to the person asking: when either is unclear, ask instead of assuming.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub c-kapsalis/devils-analyst --plugin devils-analyst16 skills in this plugin
/auditUse this skill when someone wants a whole marketing setup or account checked, not one report: "audit our Google Ads account", "audit my GA4 setup", "audit our tracking", "health check our email program", "what's broken in our setup", "where are we wasting money", "we just took over this account, what should we fix first", "is our Meta / Performance Max set up right", "check our UTMs", "audit our Search Console", "audit our CRM or lifecycle program", "check our Power BI model", "review this TMDL / semantic model", or an account, settings or model export with "what's wrong with it". It maps the setup, runs the checks for each area present (paid search, Performance Max, Meta, GA4 and UTMs, Search Console, email, CRM, revenue, experiments, attribution, dashboards, Power BI), estimates the money at stake, ranks findings Must fix, Should fix, Nice to have and ends "Fix N first". One report or deck: use review. Whether a single channel pays: use channel-audit./brand-healthUse this skill when the question is about the brand rather than one campaign: "is our brand getting stronger or weaker", "is our brand healthy", awareness, consideration or preference from a tracker or survey, brand search volume, direct traffic as a brand signal, share of voice or share of search, social mentions and sentiment, "are promotions hurting the brand", baseline sales, price premium or "can we raise prices", "should we cut brand ads and put it into performance", a flat brand score, NPS up but repeat purchase down, "should we launch [product] under our brand", line or category extension, sub-brand, repositioning, rebrand, "milk or kill this brand", brand valuation, and whether content is on-brand. It measures brand health from the data, separates short-term sales from long-term equity, checks per segment, and turns the result into a decision with a way to verify it.