Skip to content

KrishanuB26/competitive-intel

Repository files navigation

Competitive-intel plugin

A Claude Code plugin that runs a weekly competitive intelligence pipeline — scrapes LinkedIn posts, scans news and sitemaps, writes a structured brief, and emails it to you every Monday morning.

Built with Claude Code, Apify, and Gmail.

Install

claude plugin add github:KrishanuB26/competitive-intel

Then follow the configuration steps below to add your API keys and competitors.


What it does

Every week it automatically:

  1. Scrapes your competitors' LinkedIn company pages for recent posts
  2. Searches Google News and checks competitor sitemaps for pages published in the last 7 days
  3. Crawls the most relevant pages for full content
  4. Writes a structured competitive brief with exec summary, competitor snapshots, opportunities & threats, and recommended actions
  5. Emails the brief to you with clean formatting

Architecture

.claude/
  agents/
    linkedin-researcher.md   # Scrapes LinkedIn posts, returns structured JSON
    news-scanner.md          # Google search + sitemap check + targeted crawl
    brief-writer.md          # Synthesizes findings into Markdown brief
  commands/
    run-intel.md             # /run-intel — triggers the full pipeline
  skills/
    competitive-analysis.md  # Auto-activates on competitor-related questions
  settings.json              # MCP server config

mcp/apify/
  index.js                   # MCP server — exposes 5 tools to Claude
  package.json

competitors.json             # Your competitor list (edit this)
scripts/
  weekly-run.sh              # Cron script for automated Monday runs

MCP Tools

Tool What it does
linkedin_posts Scrapes a company's LinkedIn posts via Apify
check_sitemap Fetches sitemap.xml and filters URLs by publish date — fast, no Apify
crawl_website Full-page text extraction via Apify browser crawler
google_search Google search via Apify or SerpAPI
send_email Sends the brief as a styled HTML email via Gmail

Setup

Prerequisites

1. Clone the repo

git clone https://github.com/KrishanuB26/competitive-intel.git
cd competitive-intel

2. Install dependencies

cd mcp/apify && npm install

3. Set environment variables

Add to your ~/.zshrc (or ~/.bashrc):

export APIFY_TOKEN="apify_api_your_token_here"
export GMAIL_USER="you@gmail.com"
export GMAIL_APP_PASSWORD="xxxx xxxx xxxx xxxx"

Then reload: source ~/.zshrc

Gmail App Password: Go to myaccount.google.com/apppasswords → create one named "competitive-intel". Use this instead of your real password.

4. Register the MCP server

claude mcp add apify node "/absolute/path/to/competitive-intel/mcp/apify/index.js" \
  -e APIFY_TOKEN=$APIFY_TOKEN \
  -e GMAIL_USER=$GMAIL_USER \
  -e GMAIL_APP_PASSWORD=$GMAIL_APP_PASSWORD

5. Add your competitors

Edit competitors.json:

{
  "competitors": [
    {
      "name": "Acme Corp",
      "domain": "acmecorp.com",
      "linkedin": "https://www.linkedin.com/company/acme-corp"
    }
  ]
}

Find a company's LinkedIn URL by going to their LinkedIn page and copying the URL from the browser.

6. Test it

Open Claude Code in this directory and run:

/run-intel

7. Set up weekly automation

# Make the script executable
chmod +x scripts/weekly-run.sh

# Add to crontab — runs every Monday at 9am
(crontab -l; echo "0 9 * * 1 /absolute/path/to/competitive-intel/scripts/weekly-run.sh") | crontab -

Check logs at scripts/run.log.


Usage

Interactive

In a Claude Code session in this directory:

/run-intel

Asks for time window, focus area, and output format then runs the full pipeline.

Auto-trigger

The skill activates automatically when you ask competitor-related questions:

What is HubSpot doing in AI this week?
What are our competitors announcing?
Compare Salesforce vs HubSpot on pricing

Automated weekly email

Once the cron job is set up, you'll receive a brief every Monday morning without doing anything.


Output

The brief is saved to output/brief-YYYY-MM-DD-to-YYYY-MM-DD.md and emailed with this structure:

  • Executive Summary — 3–5 specific, evidence-backed bullets
  • Competitor Snapshots — activity level, positioning shift, notable moves, watch items
  • Cross-Competitor Themes — category-level signals across all competitors
  • Opportunities & Threats — grounded in the week's evidence
  • Recommended Actions — this week and this quarter
  • Sources — every URL cited

Configuration

Variable Required Description
APIFY_TOKEN Yes Apify API token — get one here
GMAIL_USER Yes Your Gmail address
GMAIL_APP_PASSWORD Yes Gmail App Password (not your real password)
SERP_API_KEY No SerpAPI key — improves Google search quality

Sharing with your team

Anyone with Claude Code can install it with one command:

claude plugin add github:KrishanuB26/competitive-intel

Then each person:

  1. Sets their own API keys (Apify + Gmail)
  2. Edits competitors.json with their companies
  3. Runs /run-intel or sets up the weekly cron

Or nominate one person to run it and forward the weekly email to the team.


Built with

About

A claude agent that does competitive intel for you.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors