Skip to main content
skill Claude Code

social-media-analyzer — Claude Code skill: setup and review

Analyzes social media campaign performance, computes engagement rates, and calculates marketing ROI. Compares post metrics against benchmarks across Instagram, TikTok, LinkedIn, and Facebook.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add alirezarezvani/claude-skills
/plugin install marketing-skills@claude-code-skills
Open on GitHub

What social-media-analyzer does

The skill processes post metrics including reach, likes, comments, shares, and saves. It validates inputs before running any math. Reach must stay above zero to prevent division errors. Then it calculates Engagement Rate, CTR, Virality Rate, and Save Rate for individual posts and the overall campaign.

When you provide ad spend, the tool computes cost per engagement, cost per click, and campaign ROI. It relies on estimated engagement values: likes at $0.50, comments at $2.00, and shares at $5.00. The workflow uses Python scripts scripts/calculate_metrics.py and scripts/analyze_performance.py. They rank top performers and check numbers against industry benchmarks for Instagram, Facebook, LinkedIn, TikTok, and Twitter/X.

The skill does not pull live data from external APIs. You must prepare a local JSON file first. It suits analysts who already collect post metrics and want quick performance audits inside Claude Code.

What it helps with

  • calculate engagement rate, CTR, virality rate, and save rate from post data
  • evaluate marketing ROI, CPE, and CPC against total advertising spend
  • benchmark campaign metrics against platform averages for Instagram, TikTok, and LinkedIn
  • rank posts to identify top-performing and low-performing campaign creative

Example prompts for the agent

  • Analyze social media campaign performance from assets/sample_input.json
  • Calculate engagement rate and compare against TikTok benchmarks
  • Evaluate ROI for an Instagram campaign with total spend of 500

How to install social-media-analyzer

1Plugin marketplace

/plugin marketplace add alirezarezvani/claude-skills
/plugin install marketing-skills@claude-code-skills

This installs the whole marketing-skills plugin with all its skills

2Skills CLI (Vercel)

npx skills add alirezarezvani/claude-skills --skill social-media-analyzer -a claude-code

3Manually: put the files in place

~/.claude/skills/social-media-analyzer/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/social-media-analyzer/

From the same set349

The whole set →
engineering-skills Alireza Rezvani An engineering skill index for Claude Code that helps you select one specialist SKILL.md for the task at hand. It covers architecture, testing, DevOps, and data work. Claude Code 2,387installs finance-skills Alireza Rezvani Routes ambiguous finance prompts to the right bundled skill: financial-analyst, saas-metrics-coach, or month-end-close. Claude Code 2,312installs marketing-skills Alireza Rezvani A directory and router for marketing skills in Claude Code. It picks the right specialist skill for SEO, content, CRO, channels, and related tasks. Claude Code 2,264installs business-growth-skills Alireza Rezvani Routes growth and revenue prompts to the right specialized skill across customer success, sales engineering, RevOps, and proposals in Claude Code. Claude Code 2,189installs engineering-advanced-skills Alireza Rezvani An index of 37 engineering skills for architecture, automation, reliability, and platform work. Use it when a project needs task-specific engineering workflows. Claude Code 2,019installs product-skills Alireza Rezvani Product work orchestrator for Claude Code. Routes queries across 16 domain lanes and validates discovery trees with deterministic scripts. Claude Code 1,994installs pm-skills Alireza Rezvani Routes project-delivery requests across 8 PM sub-skills for Jira, Confluence, sprints, reporting, and team communication. Useful for controlled delivery work. Claude Code 1,975installs senior-backend Alireza Rezvani Scaffolds backend APIs, detects database bottlenecks, and runs load tests. Useful when designing Express routes, optimizing PostgreSQL, or preparing for production. Claude Code 1,674installs

Similar

social-publishing ndesv21 Publishes and schedules posts across 13 social networks through the SocialClaw API with a single key. Useful for running multi-platform campaigns without handling OAuth for each service. Claude Code CX Codex Cursor 3,600installs hermes-tweet Xquik Connects X/Twitter research and gated posting tools to Hermes Agent workflows. Claude Code CX Codex Cursor 2,600installs linkedin-post-formatter official github Formats notes and technical drafts into LinkedIn posts with Unicode bold and italic typography. Ideal for drafting copy without markdown converters. GitHub Copilot 359installs seo-audit coreyhaines31 Diagnoses technical SEO issues, indexing drops, and metadata errors. Identifies why your site is losing organic search rankings in Google. Claude Code CX Codex Cursor +1 236,800installs brand claudekit Keeps brand voice, visual rules and design tokens in one markdown file, then feeds them to your agent's prompts and to your CSS variables. Claude Code CX Codex Cursor +1 39,500installs banner-design claudekit Generates banners for social media, ads, and web hero sections using HTML/CSS. Useful when you need fast visual creative assets directly in your coding agent. Claude Code CX Codex Cursor +1 39,000installs marketing-psychology coreyhaines31 Applies behavioral science and mental models to marketing decisions. It helps teams analyze buyer motivations and solve funnel bottlenecks. Claude Code CX Codex Cursor +1 164,000installs content-strategy coreyhaines31 Plans content roadmaps, selects blog topics, and balances searchable search-intent pieces with shareable formats. Use it when deciding what to write next to bring in leads. Claude Code CX Codex Cursor +1 163,400installs

Questions about social-media-analyzer

How to install social-media-analyzer in Claude Code?

Run npx skills add alirezarezvani/claude-skills --skill social-media-analyzer -a claude-code or install it using /plugin marketplace add alirezarezvani/claude-skills.

What does social-media-analyzer do?

It calculates engagement rates, virality, CTR, and ROI from structured post metrics. Then it compares the output against platform benchmarks for Instagram, Facebook, LinkedIn, TikTok, and Twitter/X.

Does this skill connect to social media APIs?

No, it does not fetch live data from external APIs. You must supply post data in a structured JSON file for the Python analysis scripts.

Source text

SKILL.md · MIT
---
name: "social-media-analyzer"
description: Social media campaign analysis and performance tracking. Calculates engagement rates, ROI, and benchmarks across platforms. Use when analyzing social media performance, calculating engagement rate, measuring campaign ROI, comparing platform metrics, or benchmarking against industry standards. Also use when the user mentions "social media audit," "engagement rate," or "which platform performs best."
metadata:
  triggers:
    - analyze social media
    - calculate engagement rate
    - social media ROI
    - campaign performance
    - compare platforms
    - benchmark engagement
    - Instagram analytics
    - Facebook metrics
    - TikTok performance
    - LinkedIn engagement
---

# Social Media Analyzer

Campaign performance analysis with engagement metrics, ROI calculations, and platform benchmarks.

---

## Table of Contents

- [Analysis Workflow](#analysis-workflow)
- [Engagement Metrics](#engagement-metrics)
- [ROI Calculation](#roi-calculation)
- [Platform Benchmarks](#platform-benchmarks)
- [Tools](#tools)
- [Examples](#examples)

---

## Analysis Workflow

Analyze social media campaign performance:

1. Validate input data completeness (reach > 0, dates valid)
2. Calculate engagement metrics per post
3. Aggregate campaign-level metrics
4. Calculate ROI if ad spend provided
5. Compare against platform benchmarks
6. Identify top and bottom performers
7. Generate recommendations
8. **Validation:** Engagement rate < 100%, ROI matches spend data

### Input Requirements

| 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) |

### Data Validation Checks

Before analysis, verify:

- [ ] Reach > 0 for all posts (avoid division by zero)
- [ ] Engagement counts are non-negative
- [ ] Date range is valid (start < end)
- [ ] Platform is recognized
- [ ] Spend > 0 if ROI requested

---

## Engagement Metrics

### Engagement Rate Calculation

```
Engagement Rate = (Likes + Comments + Shares + Saves) / Reach × 100
```

### Metric Definitions

| 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 |

### Performance Categories

| 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 |

---

## ROI Calculation

Calculate return on ad spend:

1. Sum total engagements across posts
2. Calculate cost per engagement (CPE)
3. Calculate cost per click (CPC) if clicks available
4. Estimate engagement value using benchmark rates
5. Calculate ROI percentage
6. **Validation:** ROI = (Value - Spend) / Spend × 100

### ROI Formulas

| 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 |

### Engagement Value Estimates

| 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 Interpretation

| 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 Benchmarks

### Engagement Rate by Platform

| Platform | Average | Good | Excellent |
|----------|---------|------|-----------|
| Instagram | 1.22% | 3-6% | >6% |
| Facebook | 0.07% | 0.5-1% | >1% |
| Twitter/X | 0.05% | 0.1-0.5% | >0.5% |
| LinkedIn | 2.0% | 3-5% | >5% |
| TikTok | 5.96% | 8-15% | >15% |

### CTR by Platform

| Platform | Average | Good | Excellent |
|----------|---------|------|-----------|
| Instagram | 0.22% | 0.5-1% | >1% |
| Facebook | 0.90% | 1.5-2.5% | >2.5% |
| LinkedIn | 0.44% | 1-2% | >2% |
| TikTok | 0.30% | 0.5-1% | >1% |

### CPC by Platform

| Platform | Average | Good |
|----------|---------|------|
| Facebook | $0.97 | <$0.50 |
| Instagram | $1.20 | <$0.70 |
| LinkedIn | $5.26 | <$3.00 |
| TikTok | $1.00 | <$0.50 |

See `references/platform-benchmarks.md` for complete benchmark data.

---

## Tools

### Calculate Metrics

```bash
python scripts/calculate_metrics.py assets/sample_input.json
```

Calculates engagement rate, CTR, reach rate for each post and campaign totals.

### Analyze Performance

```bash
python scripts/analyze_performance.py assets/sample_input.json
```

Generates full performance analysis with ROI, benchmarks, and recommendations.

**Output includes:**
- Campaign-level metrics
- Post-by-post breakdown
- Benchmark comparisons
- Top performers ranked
- Actionable recommendations

---

## Examples

### Sample Input

See `assets/sample_input.json`:

```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
    }
  ]
}
```

### Sample Output

See `assets/expected_output.json`:

```json
{
  "campaign_metrics": {
    "total_engagements": 1521,
    "avg_engagement_rate": 8.36,
    "ctr": 1.55
  },
  "roi_metrics": {
    "total_spend": 500.0,
    "cost_per_engagement": 0.33,
    "roi_percentage": 660.5
  },
  "insights": {
    "overall_health": "excellent",
    "benchmark_comparison": {
      "engagement_status": "excellent",
      "engagement_benchmark": "1.22%",
      "engagement_actual": "8.36%"
    }
  }
}
```

### Interpretation

The sample campaign shows:
- **Engagement rate 8.36%** vs 1.22% benchmark = Excellent (6.8x above average)
- **CTR 1.55%** vs 0.22% benchmark = Excellent (7x above average)
- **ROI 660%** = Outstanding return on $500 spend
- **Recommendation:** Scale budget, replicate successful elements

---

## Reference Documentation

### Platform Benchmarks

`references/platform-benchmarks.md` contains:

- Engagement rate benchmarks by platform and industry
- CTR benchmarks for organic and paid content
- Cost benchmarks (CPC, CPM, CPE)
- Content type performance by platform
- Optimal posting times and frequency
- ROI calculation formulas

## Proactive Triggers

- **Engagement rate below platform average** → Content isn't resonating. Analyze top performers for patterns.
- **Follower growth stalled** → Content distribution or frequency issue. Audit posting patterns.
- **High impressions, low engagement** → Reach without resonance. Content quality issue.
- **Competitor outperforming significantly** → Content gap. Analyze their successful posts.

## Output Artifacts

| 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 |

## Communication

All output passes quality verification:
- Self-verify: source attribution, assumption audit, confidence scoring
- Output format: Bottom Line → What (with confidence) → Why → How to Act
- Results only. Every finding tagged: 🟢 verified, 🟡 medium, 🔴 assumed.

## Related Skills

- **social-content**: For creating social posts. Use this skill for analyzing performance.
- **campaign-analytics**: For cross-channel analytics including social.
- **content-strategy**: For planning social content themes.
- **marketing-context**: Provides audience context for better analysis.

© Alireza Rezvani · MIT · alirezarezvani/claude-skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor