You are an installer. Read this file end-to-end, then guide the user through setting up a weekly LinkedIn analytics agent. Be conversational and efficient — this should take 2-3 messages back and forth.
The user has just told you something like "install this for me" or "follow install.md and set up the LinkedIn analytics workflow". Treat that as the trigger. Don't make them re-read what's below — you do the reading, you do the work.
A Cowork scheduled task that, once a week, opens LinkedIn analytics via the Claude in Chrome extension, clicks Export, parses the resulting xlsx, writes a snapshot file to the user's project folder, and sends them a digest in chat.
Three parts: a scheduled prompt, a connected-folder pair (~/Downloads
- the user's project folder), and the Claude in Chrome extension. No code, no third-party automation tools.
Ask the user in one message (all three at once):
Before I install this, three quick checks:
- Is
~/Downloads
connected to Cowork as a project folder? (Settings → Connected folders)- Do you have a project folder where the analytics should live, also connected to Cowork?
- Is Claude in Chrome extension installed, and is Chrome currently logged into your LinkedIn account? If any of these is "no", let me know which one and I'll explain how to set it up.
If any answer is "no" — , explain that specific prerequisite, wait for confirmation, then re-ask the missing items. Do not proceed to Step 1 until all three are confirmed.
Once prerequisites are confirmed, ask in one message (all three questions at once):
Three questions to customize the agent for your setup:
Project folder path— the absolute path where analytics snapshots and post files should live. Example:~/Documents/Projects/LinkedinAnalytics
Schedule— when should the agent fire? Examples:Monday 12:00
,Friday 17:00
,Sunday 20:00
Digest language— what language for the chat digest? (English
,Russian
, your choice)
Store the answers as:
${PROJECT_FOLDER}
— absolute path string${SCHEDULE}
— day-of-week + time, to be converted to cron in Step 4${LANGUAGE}
— language name string
If the user gives partial answers, ask follow-ups for the missing values before continuing.
Run silently. Don't narrate to the user — just confirm at the end with a one-line summary if anything was created.
mkdir -p "${PROJECT_FOLDER}"
mkdir -p "${PROJECT_FOLDER}/analytics/snapshots"
mkdir -p "${PROJECT_FOLDER}/analytics/posts"
The weekly prompt references three context files in Step 2 and updates them in Step 4. Create empty templates for each, only if the file does not already exist. Do not overwrite an existing file.
${PROJECT_FOLDER}/analytics/themes_and_patterns.md
:
Observed patterns across posts. Evidence-driven only — add an entry only when 2+ posts confirm a pattern or a single datapoint contradicts an existing one.
## Patterns
(populated by weekly analysis over time)
${PROJECT_FOLDER}/analytics/idea_bank.md
:
Post ideas queued for future. Append at next free `#`. Never renumber.
| # | status | idea | rationale |
|---|---------|------|-----------|
${PROJECT_FOLDER}/analytics/follow_ups.md
:
Dated watch list. Add items when a post needs a re-check (e.g., "promising at 72h, re-check at 7d"). Move resolved items to the Resolved section — don't delete.
## Active
## Resolved
${PROJECT_FOLDER}/linkedin_analytics.md
(INDEX):
Curated map of this project. Keep under 10KB.
## Latest snapshots
(populated by weekly analysis)
## Active follow-ups
(populated by weekly analysis)
## File map
- `analytics/snapshots/` — one .md per week
- `analytics/posts/` — one .md per post
- `analytics/themes_and_patterns.md` — observed patterns
- `analytics/idea_bank.md` — post idea queue
- `analytics/follow_ups.md` — dated watch list
Confirm to the user with a single line: "Project structure ready at ${PROJECT_FOLDER} — analytics/ subfolders created, knowledge-base templates added." Skip mentioning any file that already existed and wasn't touched.
Check if ${PROJECT_FOLDER}/CLAUDE.md
already exists.
If it exists: skip this step entirely.
If it doesn't exist, ask the user:
You don't have a
CLAUDE.md
with your rules yet. The scheduled prompt references it — thresholds for breakout/underperformed posts, voice rules, file conventions. Want me to create a starter template you can adapt later? (yes / no)
If yes: write the template from the## CLAUDE.md template
section at the bottom of this file to${PROJECT_FOLDER}/CLAUDE.md
. Confirm to the user:"Created${PROJECT_FOLDER}/CLAUDE.md
— edit it later to tune thresholds and voice rules."If no: skip, but flag to the user that they'll need to either edit Step 0 of the scheduled prompt (remove theRead CLAUDE.md
line) or create the file later.
Use Cowork's create_scheduled_task
tool with these arguments:
Name:Weekly LinkedIn analytics
Description:Auto-export LinkedIn analytics, parse weekly metrics, write snapshot + digest.
Schedule (cron expression): convert${SCHEDULE}
to standard cron format. Examples:Monday 12:00
→0 12 * * 1
Tuesday 09:00
→0 9 * * 2
Friday 17:00
→0 17 * * 5
Sunday 20:00
→0 20 * * 0
Prompt: take the entire text inside the fenced block in the## Prompt body
section at the bottom of this file. Before passing it to the tool, do two find-replace operations on the string:- Replace every occurrence of
~/Projects/LinkedinAnalytics/
with${PROJECT_FOLDER}
(be careful with trailing slashes) - Replace
Russian, no fluff
with${LANGUAGE}, no fluff
- Replace every occurrence of
Verify the scheduled task created successfully before moving on.
Tell the user:
Installed. Scheduled task
Weekly LinkedIn analytics
is set to fire${SCHEDULE}
. Want me to run it once now as a dry-run, to verify everything works end-to-end? (yes / no)
If yes: trigger the task immediately via Cowork's run-now mechanism. Surface anything that fails (no Chrome, wrong path, missing folder mount). If the dry-run succeeds, the user should see a chat digest within ~30-90 seconds.If no: stop. Tell them the agent will fire at the scheduled time and they'll see the digest then.
User says they don't want CLAUDE.md and don't want to edit the prompt— write a minimal CLAUDE.md anyway with# Hard rules: TODO
as a placeholder, so theRead CLAUDE.md
line doesn't fail. Tell the user.User's schedule answer is ambiguous(e.g., justMonday
) — ask for a specific time before generating cron.User wants to schedule more than once a week— that's outside this installer's scope, but you can offer:*"This installer sets one weekly run. If you want daily or multiple times per week, I can adjust the cron after — just let me know what cadence."*User wants the digest in multiple languages— pick the primary language for the prompt, mention they can edit Step 5 of the scheduled prompt later to add a translation pass.
Write this exact content to ${PROJECT_FOLDER}/CLAUDE.md
:
These are the project-level rules the weekly analytics agent follows. Tune to your taste.
## Thresholds
- **Breakout:** impressions ≥ 3,000 OR engagement rate ≥ 2% in first 72h
- **Underperformed:** impressions < 1,000 OR engagement rate < 0.3% in first 72h
- **Normal:** everything between
- **Promising:** below 1K impressions but ER ≥ 1.5% at <72h with positive trajectory
## Voice rules
- Hook in line 1, no warmup
- Numbers over adjectives
- Short paragraphs (1-3 lines)
- No "I'm excited to announce" energy
- Banned constructions: "Not just X, but also Y", trailing `-ing` clauses, em-dashes as decoration
## File conventions
- Snapshots: `analytics/snapshots/YYYY-MM-DD.md`
- Posts: `analytics/posts/YYYY-MM-DD_<slug>.md`
- Idea bank: `analytics/idea_bank.md` (append-only, never renumber)
- Follow-ups: `analytics/follow_ups.md` (move resolved items to "Resolved" section, don't delete)
## Frontmatter schemas
(Add your own snapshot + post frontmatter schemas here when you have them.)
You are running my weekly LinkedIn analytics review. The xlsx export from LinkedIn is the source of truth.
Read `~/Projects/LinkedinAnalytics/CLAUDE.md` first. It has all hard rules: thresholds, voice rules, frontmatter schemas, file ownership, workflow conventions. Don't restate them here — follow them.
Then read `~/Projects/LinkedinAnalytics/linkedin_analytics.md` (INDEX) if it exists. It has the file map, last 2 snapshots, and active follow-ups.
Check `~/Projects/LinkedinAnalytics/` for the newest `AggregateAnalytics_*.xlsx`. Newest by export date (the second date in the filename) = source of truth.
If older than 24 hours:
1. `mcp__Claude_in_Chrome__list_connected_browsers`
2. If no browser — message me ("Chrome not running, export manually and I'll parse") and stop.
3. Navigate to `https://www.linkedin.com/analytics/creator/content/`, wait 3 seconds.
4. Confirm "7 days" period. Set if not.
5. Click **Export** → confirm in the modal. LinkedIn drops `AggregateAnalytics_<date>.xlsx` into `~/Downloads`.
6. Move it into the project: `mv ~/Downloads/AggregateAnalytics_*.xlsx ~/Projects/LinkedinAnalytics/`
7. If still no fresh file — message me and stop.
- **Always:** `analytics/themes_and_patterns.md`, `analytics/idea_bank.md`, `analytics/follow_ups.md` (skip any that don't exist)
- **Conditional:** `analytics/competitors.md` if a competitor name surfaces in this week's data
- **Per-post:** grep frontmatter of `analytics/posts/*.md` for lane rollups. Don't load bodies unless you need the hook or format text
- **Snapshots:** newest 2-4 in `analytics/snapshots/` for week-over-week and 4-week-avg math
Install if needed: `pip install pandas openpyxl --break-system-packages`.
Sheets in the LinkedIn export:
- **DISCOVERY** — 7d Impressions + Members reached
- **ENGAGEMENT** — Daily Date / Impressions / Engagements
- **TOP POSTS** — per-post: URL / Publish Date / Engagements (left), URL / Publish Date / Impressions (right)
- **FOLLOWERS** — Total + daily new
- **DEMOGRAPHICS** — Top Companies / Locations / Company size / Seniority / Job title / Industry %
Compute the 12 parameters:
**Volume**
1. Impressions 7d week-over-week + vs 4-week avg
2. Members reached
3. Followers Δ vs 4-week avg
4. Profile views + Search appearances (if present)
**Engagement quality**
5. ER aggregate
6. Comments/impression
7. Saves/impression
**Per-post**
8. Classification per your thresholds (breakout / underperformed / normal)
9. Lane tagging + lane-level ER rollup (grep frontmatter)
10. Hook/format pattern: first-sentence length, closing question, format
**Timing & reputation**
11. Best posting slot (grep all post dates → weekday/hour buckets → median ER)
12. Notable engagers (founder, CEO, Head of, journalist, VC titles in reactor/commenter lists)
**New snapshot:** `analytics/snapshots/YYYY-MM-DD.md` using your snapshot frontmatter schema. Body mirrors existing snapshot files.
**New post files:** for each post URL not yet in `analytics/posts/`, grab the body via Chrome (` navigate` → `get_page_text` → scroll if needed). Create `analytics/posts/YYYY-MM-DD_<short-slug>.md` with your post frontmatter schema.
**Update themes / ideas / follow-ups only on real evidence:**
- `themes_and_patterns.md` — only if 2+ confirming posts or a contradicting datapoint
- `idea_bank.md` — append at next free `#`, never renumber
- `follow_ups.md` — move resolved items to a "Resolved" section, don't delete
Compact, fits one screen, Russian, no fluff:
**LinkedIn week N — <date range>**
<one-line headline with concrete numbers>
| Metric | This week | WoW | vs 4w avg |
| Impressions | X | ±N% | ±M% |
| Members reached | ... |
| Engagement rate | ... |
| Comments/imp | ... |
| Followers Δ | +N | (prev +N) | +N |
**Top posts this week**
1. <hook 50 chars> — X imp, Y% ER, lane: Z. <one-line why>
**Underperformed** (if any)
- <hook> — <reason in one phrase>
**Pattern of the week**
<one concrete observation by lane / format / hook>
**For next week**
1. <concrete action>
2. <concrete action>
3. <concrete action>
- 0 original posts this week → still produce a snapshot + flag "0 originals → followers velocity drops without supply"
- Chrome export failed → digest from the last valid xlsx, mark "STALE DATA" at top
- New post fetched but body unavailable → log with body marked `TBD (scrape next session)`, don't block the digest
- Headline includes 2+ concrete numbers?
- Recommendations are actionable in 7 days (specific lane / format / timing)?
- Every new post tagged to a lane?
- New snapshot file written with frontmatter per CLAUDE.md?
- INDEX embed refreshed (if INDEX file exists)?
If any "no" — fix before sending.