/marketing-skills:marketing-analystfrom marketing-skills
Analyzes campaign performance, attribution models, ROI, and budget allocation. Use when evaluating marketing spend efficiency, comparing channel performance, or forecasting leads and revenue.
Ships in marketing-skills. 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; scripts run unread.
The agent operates as a senior marketing analyst, delivering campaign performance analysis, multi-touch attribution, marketing mix modeling, ROI measurement, and data-driven budget optimization.
Before running the analysis, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
| Metric | Formula | Rule of thumb (heuristic, not a sourced benchmark; use your own history) |
|---|---|---|
| CPL | Spend / Leads | Varies by industry |
| CAC | S&M Spend / New Customers | LTV/CAC > 3:1 |
| CPA | Spend / Acquisitions | Target specific |
| ROAS | Revenue / Ad Spend | > 4:1 |
| Metric | Formula | Rule of thumb (heuristic, not a sourced benchmark; use your own history) |
|---|---|---|
| Engagement Rate | Engagements / Impressions | 1-5% |
| CTR | Clicks / Impressions | 0.5-2% |
| Conversion Rate | Conversions / Visitors | 2-5% |
| Bounce Rate | Single-page sessions / Total | < 50% |
| Metric | Formula | Rule of thumb (heuristic, not a sourced benchmark; use your own history) |
|---|---|---|
| Churn Rate | Lost Customers / Total | < 5% monthly |
| NRR | (MRR - Churn + Expansion) / MRR | > 100% |
| LTV | ARPU x Gross Margin x Lifetime | 3x+ CAC |
The agent should apply multiple models and compare results to identify channel over/under-valuation:
| Model | Logic | Best For |
|---|---|---|
| First-touch | 100% credit to first interaction | Measuring awareness channels |
| Last-touch | 100% credit to final interaction | Measuring conversion channels |
| Linear | Equal credit across all touches | Balanced view of full journey |
| Time-decay | More credit to recent touches | Short sales cycles |
| Position-based | 40% first, 40% last, 20% middle | Most B2B scenarios |
def calculate_attribution(touchpoints, model='position'):
"""Calculate attribution credit for a conversion journey.
Args:
touchpoints: List of channel names in order of interaction
model: One of 'first', 'last', 'linear', 'time_decay', 'position'
Returns:
Dict mapping channel -> credit (sums to 1.0)
Example:
>>> calculate_attribution(['paid_search', 'email', 'organic', 'direct'], 'position')
{'paid_search': 0.4, 'email': 0.1, 'organic': 0.1, 'direct': 0.4}
"""
n = len(touchpoints)
credits = {}
if model == 'first':
credits[touchpoints[0]] = 1.0
elif model == 'last':
credits[touchpoints[-1]] = 1.0
elif model == 'linear':
for tp in touchpoints:
credits[tp] = credits.get(tp, 0) + 1.0 / n
elif model == 'time_decay':
decay = 0.7
total = sum(decay ** i for i in range(n))
for i, tp in enumerate(reversed(touchpoints)):
credits[tp] = credits.get(tp, 0) + (decay ** i) / total
elif model == 'position':
if n == 1:
credits[touchpoints[0]] = 1.0
elif n == 2:
credits[touchpoints[0]] = 0.5
credits[touchpoints[-1]] = credits.get(touchpoints[-1], 0) + 0.5
else:
credits[touchpoints[0]] = 0.4
credits[touchpoints[-1]] = credits.get(touchpoints[-1], 0) + 0.4
for tp in touchpoints[1:-1]:
credits[tp] = credits.get(tp, 0) + 0.2 / (n - 2)
return credits
Illustrative layout only. All numbers below are made up to show the format; they are not tool output.
# Campaign Analysis: Q1 2026 Product Launch
## Performance Summary
| Metric | Target | Actual | vs Target |
|--------------|---------|---------|-----------|
| Impressions | 500K | 612K | +22% |
| Clicks | 25K | 28.4K | +14% |
| Leads | 1,200 | 1,350 | +13% |
| MQLs | 360 | 410 | +14% |
| Pipeline | $1.2M | $1.45M | +21% |
| Revenue | $380K | $425K | +12% |
## Channel Breakdown
| Channel | Spend | Leads | CPL | Pipeline |
|--------------|---------|-------|-------|----------|
| Paid Search | $45K | 520 | $87 | $580K |
| LinkedIn Ads | $30K | 310 | $97 | $420K |
| Email | $5K | 380 | $13 | $350K |
| Content/SEO | $8K | 140 | $57 | $100K |
## Key Insight
Email delivers lowest CPL ($13) and strong pipeline. Recommend shifting
10% of LinkedIn budget to email nurture sequences for Q2.
Illustrative layout only. The percentages and ROI multiples are made-up placeholders, not tool output or benchmarks; run scripts/channel_mix_optimizer.py on your own data for real figures.
Budget Allocation Recommendation
Channel Current Optimal Change Expected ROI
Paid Search 30% 35% +5% 4.2x
Social Paid 25% 20% -5% 2.8x
Display 15% 10% -5% 1.5x
Email 10% 15% +5% 8.5x
Content 10% 12% +2% 5.2x
Events 10% 8% -2% 2.2x
Projected Impact: <computed from your data>
import math
def analyze_ab_test(control_conv, control_total, treatment_conv, treatment_total, alpha=0.05):
"""Two-proportion z-test (standard library only).
>>> r = analyze_ab_test(150, 5000, 195, 5000)
>>> r['significant'], round(r['lift_pct'], 1)
(True, 30.0)
"""
p_c = control_conv / control_total
p_t = treatment_conv / treatment_total
p_pool = (control_conv + treatment_conv) / (control_total + treatment_total)
se = math.sqrt(p_pool * (1 - p_pool) * (1 / control_total + 1 / treatment_total))
z = (p_t - p_c) / se
p_value = math.erfc(abs(z) / math.sqrt(2)) # two-sided
return {'control_rate': p_c, 'treatment_rate': p_t,
'lift_pct': (p_t - p_c) / p_c * 100, 'p_value': p_value,
'significant': p_value < alpha}
| Symptom | Likely Cause | Resolution |
|---|---|---|
| Attribution models give wildly different channel credit allocations | No single model captures full truth; each has structural bias | Run 3+ models (first-touch, last-touch, position-based) and compare; use position-based as default for B2B |
| ROAS calculations look great but pipeline is flat | Revenue attribution counting existing customers, not new pipeline | Separate new business attribution from expansion; report pipeline separately from revenue |
| Marketing reports and sales reports show different lead counts | Marketing counts MQLs at form fill, sales counts at CRM entry with different criteria | Align on shared definitions: document exact MQL, SQL, and opportunity criteria in a shared SLA |
| Forecast consistently over-predicts by 20%+ | Model uses linear extrapolation without accounting for seasonality or saturation | Apply dampening factors for longer forecasts; use ensemble method (linear + growth rate + moving average) |
| Executive dashboard takes too long to build each month | Manual data pulls from 5+ platforms with different schemas | Automate data collection; standardize UTM and naming conventions so cross-platform analysis is consistent |
| Channel ROI is negative but still generating pipeline | Long B2B sales cycle means revenue attribution has not caught up to spend | Use pipeline-based attribution for channels with 3+ month sales cycles rather than closed-won revenue |
In Scope: Campaign performance analysis, multi-touch attribution modeling, marketing mix optimization, ROI/ROAS calculation, budget allocation recommendations, executive reporting, cohort retention analysis, marketing forecasting.
Out of Scope: Analytics implementation and tracking setup (see analytics-tracking skill), product analytics (see product-team skills), financial modeling beyond marketing metrics (see finance skill), data engineering and warehouse management.
Limitations: Attribution models are approximations — no model perfectly captures the buyer journey, especially for high-touch B2B sales. Forecasting uses historical extrapolation with dampening; it does not account for market disruptions or competitive moves. Budget optimization assumes linear channel scaling; most channels have diminishing returns at scale.
Three stdlib-only tools read your JSON, judge it, and exit non-zero when something needs action. Each takes a file (positional or --input), --format text|json (--json is an alias) and --demo (labelled DEMO DATA). Ready-made inputs are in assets/.
| Script | Input | What it judges |
|---|---|---|
scripts/channel_mix_optimizer.py | channels: name, spend, revenue (+ leads, customers, clicks, impressions) | Channels losing money, far below or above blended ROAS; proposes a capped same-total reallocation |
scripts/cohort_analyzer.py | cohorts: name, initial_users, retention list | Cohorts worse than the oldest at the same period, retention that rises, cohorts with too few periods |
scripts/marketing_forecast_generator.py | period list or {metric: [numbers]} | Ensemble forecast plus hold-out backtest error, noise, short history |
Real run:
python3 scripts/channel_mix_optimizer.py assets/flawed_channels.json
FIX 2 issue(s)
Read 4 channels | spend 77,000 | revenue 339,000 | blended ROAS 4.4x
...
2. [revenue below spend] Display: spend 15,000, revenue 9,000, ROAS 0.60x
Rule: ROAS < 1.0x (break-even on attributed revenue; internal heuristic)
Fix: Cut Display by 20% (3,000) now and re-test; ...
Projected revenue 360,616 (+6.4%) - treat as an estimate; run the shift as a test.
Other commands:
python3 scripts/cohort_analyzer.py assets/flawed_cohorts.json
python3 scripts/marketing_forecast_generator.py assets/sample_history.json --periods 6 --metric leads
python3 scripts/channel_mix_optimizer.py assets/sample_channels.json --budget 120000 --max-shift 0.1 --format json
| Code | Meaning |
|---|---|
| 0 | No findings |
| 1 | Findings to act on (each quotes your value, the rule, and a fix) |
| 2 | Unusable input: missing file, invalid JSON, wrong shape, non-numeric or negative values, too few periods. One-line message on stderr |
--elasticity); it is an estimate, not a measurement. Run the reallocation as a test.assets/contract.json (opens in a new tab)assets/flawed_channels.json (opens in a new tab)assets/flawed_cohorts.json (opens in a new tab)assets/flawed_history.json (opens in a new tab)assets/malformed_channels.json (opens in a new tab)assets/malformed_cohorts.json (opens in a new tab)assets/malformed_history.json (opens in a new tab)assets/sample_channels.json (opens in a new tab)assets/sample_cohorts.json (opens in a new tab)assets/sample_history.json (opens in a new tab)scripts/channel_mix_optimizer.py (opens in a new tab)scripts/cohort_analyzer.py (opens in a new tab)scripts/marketing_forecast_generator.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
46 skills in this plugin
/ab-test-setupCalculates A/B test sample size and duration, writes a reviewable test plan, and analyzes conversion results (z-test, confidence interval, sample ratio check, ship/revert/inconclusive verdict). Use when setting up an A/B test, sizing an experiment, checking whether a test ran long enough, or deciding whether to ship a variant from visitor and conversion counts.
/ad-creativeDesign ad creative across Google, Meta, LinkedIn, Twitter/X, and TikTok with platform format specs, headline formulas, and A/B testing. Use when writing ad copy, generating headline variations, creating ad sets, or validating creative.
/aeoAnswer Engine Optimization (AEO): checks a page for the structures LLM answers quote (definition first, tables, numbered steps, sourced numbers, question headings, visible date), generates FAQ/HowTo JSON-LD from the page's own Q&A, and tallies brand mentions and cited URLs in saved LLM answers. Use when auditing a page for LLM citability, adding Q&A schema, or measuring whether ChatGPT, Claude, Perplexity or Gemini name your brand.
/ai-content-disclosureCheck AI-generated marketing content and reviews for required disclosures under the EU AI Act, FTC rules and platform AI-label policies. Use when you have a list of AI-made ads, deepfakes, chatbots, influencer posts or testimonials to clear before publishing, or a set of customer reviews to vet for fakes.
/ai-seoOptimize content to rank in AI search engines (AI Overviews, Perplexity, ChatGPT) via generative engine optimization (GEO), citability audits, and schema markup. Use when optimizing for AI search, generative search, or LLM visibility, when auditing a page for AI citability, when checking which passage answers a query, or when classifying keywords by intent for AI answers.
/analytics-trackingAnalytics implementation for web and SaaS (GA4, Google Tag Manager, event taxonomy, conversion tracking, UTM strategy) with three checkers: UTM links, event names/params/PII, and funnel drop-off. Use when building a tracking plan, validating a UTM sheet or event list before launch, finding where a funnel leaks, debugging missing events, or auditing existing analytics.
npx claudepluginhub borghei/claude-skills --plugin marketing-skillsOther plugins' skills for the same job