/devils-analyst:marketing-modelsfrom devils-analyst
Selects and runs the right quantitative model for marketing decisions: pricing, forecasting, CLV, regression, churn, segmentation, and survey analysis. Validates significance before interpreting effect size.
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.
A right number can still lead to the wrong decision. This skill picks the model that fits the question, runs it in code, and reads it the way the decision needs: profit not revenue, cost-weighted thresholds not 0.5, fit judged against a naive baseline, effects tested before they are sized.
Two rules run through every method:
The question and the decision are the user's. Before modelling, ask (do not assume) what is unknown here:
| Ask | Why |
|---|---|
| What decision rides on this, and what does each kind of mistake cost? | Sets the classification threshold and the price objective (profit, not revenue) |
| Unit variable cost or margin per unit? | Price and CLV decisions are wrong without it |
| Discount rate and horizon? | NPV, IRR and CLV depend on both |
| Length of the seasonal cycle? | Sets the moving-average order |
If the user cannot answer, state the assumption you used and show how the answer changes if it is wrong.
| The question | Dependent variable / data | Method | Reference |
|---|---|---|---|
| Is this investment worth it? Max acquisition cost? Minimum retention? | Cash flows over time | NPV, IRR, CLV | valuing.md |
| Is the price too high or too low? Best price? | Price, quantity, unit cost | Elasticity, PV ratio, P* | the pricing-promotions skill owns price and promotion decisions (promo controls, stock-up around price changes, test steps); use pricing.md only for the model fit itself |
| Next period's sales; trend under seasonality | Time series | Moving average of order = cycle | forecasting.md |
| Constant % growth or decay (new product revenue, awareness after ads stop) | Series over time | Exponential, ln Y on t | forecasting.md |
| Unit cost vs cumulative volume; constant elasticity demand | Two variables, % to % | Power model, ln Y on ln X | forecasting.md |
| What drives a quantity? Does the effect differ by group? | Continuous Y | Linear regression, dummies, interactions, partial F | regression.md |
| Are two categorical variables related? Equal rates across groups? | Cross-tab of counts | Chi-square | regression.md |
| Will this case be 1 or 0, and what do we do? | Binary Y | Binary logit + cost-based classification + lift | logit.md |
| Which of 3+ options will each segment choose? | Choice among >2 | Multinomial logit | logit.md |
| Many correlated ratings; who belongs together | Ratings or part-worths per respondent | Factor analysis, then K-means on factor scores | segmenting.md |
| Did B beat A? Did the change work? | Experiment or before/after | Not here: evidence-check |
Several categorical predictors at once: logit, not a stack of chi-square tests (separate cross-tabs can each look significant and vanish together).
| Method | The data must contain | Refuse or caveat when |
|---|---|---|
| Pricing | Price, units at each price, unit variable cost | No variable cost: give elasticity only, no price advice |
| NPV / CLV | Cash flow per period (margin, not revenue), discount rate, retention | Revenue given instead of margin: say CLV is overstated |
| Moving average | At least 2 full cycles; cycle length | Fewer than n points: no MA exists yet (first MA at t = n) |
| Regression | n well above the number of coefficients; no duplicated rows | Duplicated rows inflate n and shrink standard errors |
| Chi-square | Counts (not percentages) per cell | Any expected count < 1, or < 80% of cells with expected ≥ 5 |
| Logit | One row per independent case; both outcomes present | Rows for related people repeated: likelihood assumption broken |
| Factor / cluster | Respondent x item matrix, items on comparable scales | Raw correlated items fed straight into K-means |
| Need | Formula |
|---|---|
| NPV | Σ V_t / (1 + I)^t |
| IRR | I such that Σ V_t / (1 + I)^t = 0 (exists, unique and positive only if V_0 < 0, later V_t > 0 and their sum > abs(V_0)) |
| CLV | Σ V_t R^t / (1 + I)^t − AQ = Σ V_t / (1 + ρ)^t − AQ, with ρ = (1 + I − R) / R. Use one form, never both |
| Max acquisition cost | AQ_max = Σ V_t R^t / (1 + I)^t |
| Minimum retention | R_min = (1 + I) / (1 + IRR), IRR of (−AQ, V_1..V_T) |
| Elasticity (two points) | ε = (ΔQ/Q) / (ΔP/P); E = abs(ε). Many points: slope of ln Q on ln P |
| PV ratio | PV = (P − VC) / P; a 1% price rise adds 1/PV % to unit margin and costs E % of volume |
| Optimal price | Constant elasticity, E > 1: P* = VC · E / (E − 1). Linear Q = A − BP: P* = A/(2B) + VC/2 |
| Moving average | MA_t = (X_t + ... + X_{t−n+1}) / n, n = cycle length; MA_t forecasts t+1; MA_t − MA_{t−1} = trend per period |
| Exponential | ln Y = ln A + b t; % change per period = e^b − 1 |
| Power / experience | ln Y = ln A − a ln X; cost after a doubling = 2^−a of before; a = −log2(learning rate); C = C_0 (Q/Q_0)^−a |
| R², adjusted R² | R² = 1 − SSE/SST; adj = 1 − (1 − R²)(n − 1)/(n − m − 1) |
| Partial F | F = [(R²_full − R²_restricted) / (1 − R²_full)] · (n − m − 1)/k vs F_α(k, n − m − 1) |
| Chi-square | E_ij = row_i · col_j / n; χ² = Σ (O − E)²/E; df = (R − 1)(C − 1) |
| Logit | I = b_0 + Σ b_j X_j; P(Y=1) = 1/(1 + e^−I); odds R = e^I; +1 unit of X_j multiplies odds by e^{b_j} |
| LR test | deviance_restricted − deviance_full vs χ²_α(k) |
| Classify | Assign 1 iff R ≥ c, c = C(1|0)/C(0|1); equivalently P(Y=1) ≥ c/(1 + c) |
| Multinomial | I_1 = 0; P_j = e^{I_j} / (1 + Σ_{k≥2} e^{I_k}) |
| Factors kept | Eigenvalue ≥ 1; variance explained = Σ kept eigenvalues / m; item belongs to a factor if abs(loading) ≥ 0.5 |
| K-means | Minimise Σ WCSS; choose K at the elbow of total WCSS vs K |
Compute in code. Show the table of inputs so the reader can redo it.
| Situation | Rule |
|---|---|
| Price | 1/PV < E: overpriced, cut. 1/PV > E: underpriced, raise. Equal: optimal. E < 1: raising price always raises profit |
| Elastic demand (E > 1) | Says revenue falls with price, not that profit falls. Decide on 1/PV vs E |
| Price move size | The 1/PV vs E test is local (about 1%). Move a step, re-measure E, repeat. Do not jump to P* far outside observed prices |
| Investment | Invest iff NPV ≥ 0; choose the highest NPV; customer: invest iff ρ ≤ IRR |
| Forecast with seasonality | MA order must equal the cycle; any other order leaves seasonality in |
| Model choice | Same Y only. Higher adjusted R², or a significant partial F for the added block. Never raw R² |
| Reading a regression | F-test first (stop if not significant), then R², then each coefficient |
| Dummy coefficient | A difference in group averages vs the base level, not "a one-point increase" |
| Interaction model | The main-effect coefficient is the effect for the base group only. Effect in group g = main + interaction |
| Classification | Threshold from costs, not 0.5. 0.5 assumes both errors cost the same |
| Logit coefficient | Changes log-odds; the probability effect depends on where the case sits on the S-curve |
| Model usefulness for targeting | Lift curve: actual positives in the top i ranked vs i · base rate; closer to the "all positives first" curve is better |
| Chi-square not significant | No evidence of a relationship, not evidence of none. Significance grows with n (double the counts, double χ²) |
| Segments | Factor analysis first, K-means on factor scores; factor scores are standardised, so 0 = average, not "none" |
Verdict: [decision in one line]
Deciding number: [the figure and the test that decides it]
Naive read and why it is wrong: [one line]
Action: [what to do now] · How to verify: [the test, data or re-measurement that confirms it]
Assumptions: [costs, rates, cycle length used, and what flips the decision]
Each step gets attacked before it stands. Run the check; if it fails, do the fix before moving on.
| Move | Adversary asks | Check that settles it | If it fails |
|---|---|---|---|
| Frame the decision | "Is this the user's decision, or one I invented?" | The decision and the error costs come from the user or are stated as assumptions | Ask the user; do not model yet |
| Pick the method | "Does the method match the type of Y?" | Section 1 table: continuous → regression, binary → logit, >2 → multinomial, two categoricals → chi-square | Switch method |
| Pick the method | "Is this really a causal question?" | Wording like "did it work", "caused", "after we changed" | Hand to evidence-check |
| Load the data | "Margin or revenue? Units or currency?" | Column definitions; VC or margin present | Ask for cost; caveat or stop the price/CLV advice |
| Fit the model | "Does it beat the naive baseline?" | F-test, LR test vs null deviance, or lift vs random | Report "no evidence the model helps"; stop |
| Size the effect | "Is the effect significant before I size it?" | p-value or test statistic vs critical value | Report as not established |
| Chi-square | "Is the table valid?" | All E ≥ 1 and ≥ 80% of E ≥ 5 | Merge neighbouring categories (keep ≥ 2x2), recompute |
| Choose a model | "Did fit rise only because I added variables?" | Adjusted R² and partial F on the added block | Keep the smaller model |
| Interaction | "Am I reading the base-group effect as the effect for all?" | Write each group's effect = main + interaction | Recompute per group |
| Price advice | "Am I deciding on revenue instead of profit?" | Contribution (P − VC) · Q at each price; 1/PV vs E | Redo on contribution |
| Price advice | "Is P* an extrapolation?" | P* inside or near the tested price range | Recommend a step and a re-test instead |
| Forecast | "Is seasonality leaking into the trend?" | MA order = cycle length; compare same season | Refit with order = cycle |
| Exponential fit | "Did I report b as the % change?" | % change = e^b − 1 | Correct it |
| CLV / NPV | "Did I count churn twice or use revenue?" | Only one of R^t or ρ; V_t is margin | Recompute |
| IRR | "Does a positive IRR even exist?" | Outflow first, inflows sum > outflow | Report NPV only |
| Classification | "Why this threshold?" | c = C(1|0)/C(0|1) from stated costs; threshold P ≥ c/(1 + c) | Recompute; show who changes group |
| Segments | "Are clusters built on duplicated items?" | Factors with eigenvalue ≥ 1, varimax, K from the elbow | Refit on factor scores |
| Recommend | "What does it cost if this is wrong, and what would the CFO ask?" | Downside in money and a way to verify (test, holdout, re-measure) | Add the test or shrink the bet |
What SKILL.md sets; muted values are Claude Code's defaults
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.Other plugins' skills for the same job