/marketing-skills:social-media-analyzerfrom marketing-skills
Analyzes social media campaign performance with engagement rate, ROI, and cross-platform benchmarks. Supports Instagram, Facebook, Twitter/X, LinkedIn, and TikTok.
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.
Campaign performance analysis with engagement metrics, ROI calculations, and platform benchmarks.
Before analyzing, 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.
Analyze social media campaign performance:
| Field | Required | Description |
|---|---|---|
| platform | Yes | instagram, facebook, twitter, linkedin, tiktok |
| posts[] | Yes | Array of post data |
| posts[].likes | Yes | Like/reaction count |
| posts[].comments | Yes | Comment count |
| posts[].reach | Yes | Unique users reached |
| posts[].impressions | No | Total views |
| posts[].shares | No | Share/retweet count |
| posts[].saves | No | Save/bookmark count |
| posts[].clicks | No | Link clicks |
| total_spend | No | Ad spend (for ROI) |
Before analysis, verify:
Engagement Rate = (Likes + Comments + Shares + Saves) / Reach × 100
| Metric | Formula | Interpretation |
|---|---|---|
| Engagement Rate | Engagements / Reach × 100 | Audience interaction level |
| CTR | Clicks / Impressions × 100 | Content click appeal |
| Reach Rate | Reach / Followers × 100 | Content distribution |
| Virality Rate | Shares / Impressions × 100 | Share-worthiness |
| Save Rate | Saves / Reach × 100 | Content value |
| Rating | Engagement Rate | Action |
|---|---|---|
| Excellent | > 6% | Scale and replicate |
| Good | 3-6% | Optimize and expand |
| Average | 1-3% | Test improvements |
| Poor | < 1% | Analyze and pivot |
Calculate return on ad spend:
| Metric | Formula |
|---|---|
| Cost Per Engagement (CPE) | Total Spend / Total Engagements |
| Cost Per Click (CPC) | Total Spend / Total Clicks |
| Cost Per Thousand (CPM) | (Spend / Impressions) × 1000 |
| Return on Ad Spend (ROAS) | Revenue / Ad Spend |
Planning values for a weighted model; the scripts do not use them. They take one value per engagement from you (--value-per-engagement).
| Action | Value | Rationale |
|---|---|---|
| Like | $0.50 | Brand awareness |
| Comment | $2.00 | Active engagement |
| Share | $5.00 | Amplification |
| Save | $3.00 | Intent signal |
| Click | $1.50 | Traffic value |
| ROI % | Rating | Recommendation |
|---|---|---|
| > 500% | Excellent | Scale budget significantly |
| 200-500% | Good | Increase budget moderately |
| 100-200% | Acceptable | Optimize before scaling |
| 0-100% | Break-even | Review targeting and creative |
| < 0% | Negative | Pause and restructure |
| Platform | Average | Good | Excellent |
|---|---|---|---|
| 1.22% | 3-6% | >6% | |
| 0.07% | 0.5-1% | >1% | |
| Twitter/X | 0.05% | 0.1-0.5% | >0.5% |
| 2.0% | 3-5% | >5% | |
| TikTok | 5.96% | 8-15% | >15% |
| Platform | Average | Good | Excellent |
|---|---|---|---|
| 0.22% | 0.5-1% | >1% | |
| 0.90% | 1.5-2.5% | >2.5% | |
| 0.44% | 1-2% | >2% | |
| TikTok | 0.30% | 0.5-1% | >1% |
| Platform | Average | Good |
|---|---|---|
| $0.97 | <$0.50 | |
| $1.20 | <$0.70 | |
| $5.26 | <$3.00 | |
| TikTok | $1.00 | <$0.50 |
See references/platform-benchmarks.md for complete benchmark data.
Both commands read a campaign JSON (fields in Input Requirements), run the data checks from Data Validation Checks, and report what they read and what was missing. Run them from the skill folder.
python3 scripts/calculate_metrics.py assets/sample_campaign.json
python3 scripts/calculate_metrics.py assets/sample_input.json --value-per-engagement 2.50 --format json
Per-post and campaign engagement rate, CTR, cost per engagement and cost per click. Flags data
problems only: missing or zero reach, engagements above reach (rate over 100%), reach above
impressions (columns likely swapped), counts that are not numbers. ROI is computed only when you
say what one engagement is worth (--value-per-engagement, or value_per_engagement in the
input); otherwise it is reported as not computed, never guessed.
python3 scripts/analyze_performance.py assets/flawed_campaign.json
python3 scripts/analyze_performance.py campaign.json --value-per-engagement 0.80 --benchmark-er 3.5 --benchmark-ctr 0.9 --max-cpc 4
Runs the metrics and data checks above, then compares engagement rate and CTR with the platform
reference value and flags cost per click above --max-cpc (default $1.00), ROI below 100% and
fewer than 10 posts. Each finding quotes your number and the threshold and gives the fix as a
number: the engagements or clicks needed on your actual reach/impressions, or the spend that would
meet the target. At most three next actions, data problems first.
Reference values. The tool compares against these bundled averages (percent):
Instagram ER 1.22 / CTR 0.22, Facebook 0.09 / 0.90, Twitter/X 0.045 / 1.64, LinkedIn 0.54 / 0.39,
TikTok 5.96 / 1.00. Their source and year were not recorded, so the output labels them
"unsourced heuristic"; they differ from the tables above in places. Pass your own trailing averages
with --benchmark-er and --benchmark-ctr for a comparison you can defend. The $1.00 CPC, 100% ROI
and 10-post thresholds are internal heuristics.
Exit codes (both tools): 0 no findings, 1 findings to act on, 2 unusable input (missing
or empty file, invalid JSON, no posts list). Errors print one BLOCKED: line to stderr.
Example output (python3 scripts/analyze_performance.py assets/flawed_campaign.json, excerpt):
SOCIAL CAMPAIGN ANALYSIS: linkedin
Read: assets/flawed_campaign.json: 6 posts; missing fields: likes missing on 1, saves missing on 6, reach missing on 1
| Metric | Yours | Reference | Status |
|---|---:|---:|---|
| Engagement rate | 0.14% | 0.54% | below_average |
| CTR | 0.10% | 0.39% | below_average |
| Cost per click | $24.24 | $1.00 max | heuristic |
| ROI | -84.1% | 100% min | heuristic |
Findings
1. [reach-above-impressions] li_103: reach 31000 is above impressions 18200; unique reach cannot exceed total views.
Fix: Swap li_103's reach and impressions values if the columns were mixed up.
...
4. [engagement-below-reference] Engagement rate 0.14% is below the linkedin reference 0.54% (bundled reference (unsourced heuristic)).
Fix: 309 more engagements on the same 77,000 reach would reach 0.54%. Your best post, li_101 (document), reached 0.33%; make the next posts in that format.
...
FIX 8 issues
assets/sample_campaign.json (10 posts, exits 0), assets/flawed_campaign.json (exits 1),
assets/malformed_campaign.json (exits 2) and the short assets/sample_input.json:
{
"platform": "instagram",
"total_spend": 500,
"posts": [
{
"post_id": "post_001",
"content_type": "image",
"likes": 342,
"comments": 28,
"shares": 15,
"saves": 45,
"reach": 5200,
"impressions": 8500,
"clicks": 120
}
]
}
assets/expected_output.json is the real --format json output of
python3 scripts/analyze_performance.py assets/sample_input.json --value-per-engagement 2.5:
{
"verdict": "FIX 2 issues",
"campaign_metrics": {
"total_engagements": 1521,
"avg_engagement_rate": 8.36,
"ctr": 1.55
},
"roi_metrics": {
"total_spend": 500,
"cost_per_engagement": 0.33,
"cost_per_click": 1.16,
"value_per_engagement": 2.5,
"roi_percentage": 660.5
},
"insights": {
"overall_health": "excellent",
"benchmark_comparison": {
"engagement_status": "excellent",
"engagement_benchmark": "1.22%",
"engagement_actual": "8.36%"
}
}
}
The short sample shows:
references/platform-benchmarks.md contains:
| When you ask for... | You get... |
|---|---|
| "Social media audit" | Performance analysis across platforms with benchmarks |
| "What's performing?" | Top content analysis with patterns and recommendations |
| "Competitor social analysis" | Competitive social media comparison with gaps |
| "Campaign ROI" | Full ROI calculation with engagement value estimates |
All output passes quality verification:
| Problem | Likely Cause | Solution |
|---|---|---|
| Engagement rate appears unrealistically high (>50%) | Reach value is too low relative to engagements, or reach/impressions data is swapped | Verify that reach represents unique users reached (not impressions). Engagement rate = (likes + comments + shares + saves) / reach. If using Instagram data from 2025+, note that Instagram shifted from "impressions" to "views" as primary metric -- ensure you are using the correct field |
| Benchmark comparison shows "no_benchmark_available" | Platform name in input JSON does not match expected values | Use exact lowercase platform names: instagram, facebook, twitter, linkedin, tiktok. The analyzer matches against these exact strings |
| ROI calculation shows negative despite good engagement | Engagement value estimates are too conservative for your industry | ROI is only as good as the value per engagement you pass with --value-per-engagement (or value_per_engagement in the input). Set it from your own data (e.g. pipeline value of social-sourced leads divided by engagements); the tools never assume one |
| TikTok metrics show low engagement compared to benchmarks | Using reach-based calculation on a platform where view-based metrics are standard | TikTok's 2026 benchmark engagement rate of 2.50-3.70% is calculated against views, not reach. Ensure your TikTok data uses video views in the reach field for accurate comparison. TikTok engagement rates rose 49% YoY in 2025 |
| LinkedIn engagement appears lower than expected | Comparing against outdated benchmarks | LinkedIn's 2026 median engagement rate is approximately 3.85-6.1%, significantly higher than other platforms. Carousel/document posts earn the highest engagement (up to 21.77% median). If your rate is below 2%, focus on conversation-starting content rather than corporate announcements |
| Instagram metrics declining despite consistent content quality | Algorithm and metric definition changes in 2025-2026 | Instagram shifted to "Views" as its primary metric across all formats (Reels, Stories, posts), replacing "Impressions" and "Plays." Carousel posts now earn the most engagement. Meta plans to replace reach with "Viewers" metric in Graph API by June 2026. Adapt your data collection accordingly |
| Campaign analysis has too few posts for reliable insights | Small sample size produces unreliable averages | Minimum 10 posts recommended for meaningful analysis. analyze_performance.py flags campaigns with fewer than 10 posts (low-post-volume). For statistical reliability, aim for 30+ posts per analysis period |
In Scope:
Out of Scope:
Platform API Changes (2025-2026):
| Integration | Purpose | How to Connect |
|---|---|---|
| Meta Business Suite | Export Instagram and Facebook campaign data | Export post-level metrics (likes, comments, shares, reach, impressions, clicks) as JSON for calculate_metrics.py and analyze_performance.py. Note: "Views" is replacing "Impressions" in 2026 |
| LinkedIn Campaign Manager | Export LinkedIn ad and organic performance data | Export engagement metrics per post. LinkedIn's native analytics now includes "Viewer" demographics and AI search visibility data |
| TikTok Business Center | Export TikTok campaign performance data | Export video-level metrics. Use video views as the reach equivalent for engagement rate calculation |
| Google Analytics 4 (GA4) | Track social traffic and conversions on your website | Connect social campaign UTM parameters to GA4 to measure downstream conversions. Use campaign-analytics skill for full attribution |
| campaign-analytics skill | Cross-channel ROI comparison | Feed social media ROI data into campaign_roi_calculator.py alongside other channels for unified portfolio analysis |
| content-creator skill | Content optimization based on performance data | Use top-performing post analysis to inform content strategy. Apply brand_voice_analyzer.py to ensure social content matches brand voice |
| marketing-demand-acquisition skill | Social as demand gen channel | Integrate social performance data into demand gen channel mix evaluation. Use CAC data from social alongside other acquisition channels |
Type: CLI command and importable module (python3 scripts/calculate_metrics.py <campaign.json> [--value-per-engagement N] [--format text|json])
Classes:
SocialMediaMetricsCalculator(campaign_data: Dict, value_per_engagement: float = None)Constructor Input: {"platform": "instagram", "total_spend": 500, "value_per_engagement": 2.5, "posts": [{"post_id": "str", "content_type": "str", "likes": int, "comments": int, "shares": int, "saves": int, "reach": int, "impressions": int, "clicks": int}]}
Key Methods:
| Method | Parameters | Returns |
|---|---|---|
calculate_engagement_rate() | post: Dict (likes, comments, shares, saves, reach) | Engagement rate as percentage (float), or None when reach is missing or 0. Formula: (likes + comments + shares + saves) / reach * 100 |
calculate_ctr() | clicks: int, impressions: int | CTR as percentage (float), or None when impressions is 0 |
calculate_campaign_metrics() | None (uses constructor data) | Dict with platform, total_posts, total_engagements (incl. saves), total_reach, total_impressions, total_clicks, avg_engagement_rate (posts with reach only), ctr, posts_in_engagement_rate, posts_in_ctr |
calculate_roi_metrics() | None (uses constructor data) | Dict with total_spend, cost_per_engagement, cost_per_click, value_per_engagement, estimated_value and roi_percentage (both None unless a value per engagement is supplied) |
identify_top_posts() | metric: str = 'engagement_rate', limit: int = 5 | Sorted list of top posts by specified metric. Supported metrics: engagement_rate, likes, comments, shares, clicks |
analyze_all() | None | Combined dict of campaign_metrics, roi_metrics, and top_posts |
Type: CLI command and importable module (python3 scripts/analyze_performance.py <campaign.json> [--value-per-engagement N] [--benchmark-er PCT] [--benchmark-ctr PCT] [--max-cpc N] [--format text|json]); imports calculate_metrics.py
Classes:
PerformanceAnalyzer(campaign_metrics: Dict, roi_metrics: Dict, benchmark_er=None, benchmark_ctr=None, posts=None, max_cpc=1.00)Built-in reference values: engagement rate and CTR for facebook, instagram, twitter, linkedin, tiktok (source not recorded: labelled as a heuristic in output).
Key Methods:
| Method | Parameters | Returns |
|---|---|---|
benchmark_performance() | None | Dict with engagement_status, engagement_benchmark, engagement_actual, ctr_status, ctr_benchmark, ctr_actual. Status values: excellent (>=1.5x benchmark), good (>=benchmark), below_average |
generate_findings() | None | List of findings (rule, value, threshold, message, fix) for engagement rate, CTR, CPC, ROI and post volume |
generate_recommendations() | None | The fix string of each finding |
generate_insights() | None | Dict with overall_health (excellent/good/needs_improvement), benchmark_comparison, recommendations, key_strengths, areas_for_improvement |
HOW_TO_USE.md (opens in a new tab)assets/contract.json (opens in a new tab)assets/expected_output.json (opens in a new tab)assets/flawed_campaign.json (opens in a new tab)assets/malformed_campaign.json (opens in a new tab)assets/sample_campaign.json (opens in a new tab)assets/sample_input.json (opens in a new tab)references/platform-benchmarks.md (opens in a new tab)scripts/analyze_performance.py (opens in a new tab)scripts/calculate_metrics.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.
npx claudepluginhub borghei/claude-skills --plugin marketing-skillsOther plugins' skills for the same job