{"slug": "install-md-weekly-linkedin-analytics-agent-installer", "title": "install.md — Weekly LinkedIn analytics agent installer", "summary": "A developer has created an installer for a weekly LinkedIn analytics agent that runs as a Cowork scheduled task. The agent opens LinkedIn analytics via the Claude in Chrome extension, exports data, parses the resulting xlsx file, writes a snapshot to the user's project folder, and sends a digest in chat. The installer guides users through prerequisite checks and customization questions before setting up the project folder structure and template files.", "body_md": "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.\n\nThe 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.\n\nA 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.\n\nThree parts: a scheduled prompt, a connected-folder pair (`~/Downloads`\n\n+ the user's project folder), and the Claude in Chrome extension. No code, no third-party automation tools.\n\nAsk the user **in one message** (all three at once):\n\nBefore I install this, three quick checks:\n\n- Is\n`~/Downloads`\n\nconnected to Cowork as a project folder? (Settings → Connected folders)- Do you have a project folder where the analytics should live, also connected to Cowork?\n- Is Claude in Chrome extension installed, and is Chrome currently logged into your LinkedIn account?\nIf any of these is \"no\", let me know which one and I'll explain how to set it up.\n\nIf any answer is \"no\" — pause, explain that specific prerequisite, wait for confirmation, then re-ask the missing items. **Do not proceed to Step 1 until all three are confirmed.**\n\nOnce prerequisites are confirmed, ask **in one message** (all three questions at once):\n\nThree questions to customize the agent for your setup:\n\nProject folder path— the absolute path where analytics snapshots and post files should live. Example:`~/Documents/Projects/LinkedinAnalytics`\n\nSchedule— when should the agent fire? Examples:`Monday 12:00`\n\n,`Friday 17:00`\n\n,`Sunday 20:00`\n\nDigest language— what language for the chat digest? (`English`\n\n,`Russian`\n\n, your choice)\n\nStore the answers as:\n\n`${PROJECT_FOLDER}`\n\n— absolute path string`${SCHEDULE}`\n\n— day-of-week + time, to be converted to cron in Step 4`${LANGUAGE}`\n\n— language name string\n\nIf the user gives partial answers, ask follow-ups for the missing values before continuing.\n\nRun silently. Don't narrate to the user — just confirm at the end with a one-line summary if anything was created.\n\n```\nmkdir -p \"${PROJECT_FOLDER}\"\nmkdir -p \"${PROJECT_FOLDER}/analytics/snapshots\"\nmkdir -p \"${PROJECT_FOLDER}/analytics/posts\"\n```\n\nThe 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.\n\n`${PROJECT_FOLDER}/analytics/themes_and_patterns.md`\n\n:\n\n```\n# Themes and patterns\n\nObserved patterns across posts. Evidence-driven only — add an entry only when 2+ posts confirm a pattern or a single datapoint contradicts an existing one.\n\n## Patterns\n(populated by weekly analysis over time)\n```\n\n`${PROJECT_FOLDER}/analytics/idea_bank.md`\n\n:\n\n```\n# Idea bank\n\nPost ideas queued for future. Append at next free `#`. Never renumber.\n\n| # | status  | idea | rationale |\n|---|---------|------|-----------|\n```\n\n`${PROJECT_FOLDER}/analytics/follow_ups.md`\n\n:\n\n```\n# Follow-ups\n\nDated 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.\n\n## Active\n\n## Resolved\n```\n\n`${PROJECT_FOLDER}/linkedin_analytics.md`\n\n(INDEX):\n\n```\n# LinkedIn analytics — INDEX\n\nCurated map of this project. Keep under 10KB.\n\n## Latest snapshots\n(populated by weekly analysis)\n\n## Active follow-ups\n(populated by weekly analysis)\n\n## File map\n- `analytics/snapshots/` — one .md per week\n- `analytics/posts/` — one .md per post\n- `analytics/themes_and_patterns.md` — observed patterns\n- `analytics/idea_bank.md` — post idea queue\n- `analytics/follow_ups.md` — dated watch list\n```\n\nConfirm 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.\n\nCheck if `${PROJECT_FOLDER}/CLAUDE.md`\n\nalready exists.\n\n**If it exists:** skip this step entirely.\n\n**If it doesn't exist**, ask the user:\n\nYou don't have a\n\n`CLAUDE.md`\n\nwith 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)\n\n**If yes**: write the template from the`## CLAUDE.md template`\n\nsection at the bottom of this file to`${PROJECT_FOLDER}/CLAUDE.md`\n\n. Confirm to the user:*\"Created*`${PROJECT_FOLDER}/CLAUDE.md`\n\n— 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 the`Read CLAUDE.md`\n\nline) or create the file later.\n\nUse Cowork's `create_scheduled_task`\n\ntool with these arguments:\n\n**Name:**`Weekly LinkedIn analytics`\n\n**Description:**`Auto-export LinkedIn analytics, parse weekly metrics, write snapshot + digest.`\n\n**Schedule (cron expression):** convert`${SCHEDULE}`\n\nto standard cron format. Examples:`Monday 12:00`\n\n→`0 12 * * 1`\n\n`Tuesday 09:00`\n\n→`0 9 * * 2`\n\n`Friday 17:00`\n\n→`0 17 * * 5`\n\n`Sunday 20:00`\n\n→`0 20 * * 0`\n\n**Prompt:** take the entire text inside the fenced block in the`## Prompt body`\n\nsection at the bottom of this file. Before passing it to the tool, do two find-replace operations on the string:- Replace every occurrence of\n`~/Projects/LinkedinAnalytics/`\n\nwith`${PROJECT_FOLDER}`\n\n(be careful with trailing slashes) - Replace\n`Russian, no fluff`\n\nwith`${LANGUAGE}, no fluff`\n\n- Replace every occurrence of\n\nVerify the scheduled task created successfully before moving on.\n\nTell the user:\n\nInstalled. Scheduled task\n\n`Weekly LinkedIn analytics`\n\nis set to fire`${SCHEDULE}`\n\n. Want me to run it once now as a dry-run, to verify everything works end-to-end? (yes / no)\n\n**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.\n\n**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`\n\nas a placeholder, so the`Read CLAUDE.md`\n\nline doesn't fail. Tell the user.**User's schedule answer is ambiguous**(e.g., just`Monday`\n\n) — 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.\n\nWrite this exact content to `${PROJECT_FOLDER}/CLAUDE.md`\n\n:\n\n```\n# LinkedIn analytics — hard rules\n\nThese are the project-level rules the weekly analytics agent follows. Tune to your taste.\n\n## Thresholds\n- **Breakout:** impressions ≥ 3,000 OR engagement rate ≥ 2% in first 72h\n- **Underperformed:** impressions < 1,000 OR engagement rate < 0.3% in first 72h\n- **Normal:** everything between\n- **Promising:** below 1K impressions but ER ≥ 1.5% at <72h with positive trajectory\n\n## Voice rules\n- Hook in line 1, no warmup\n- Numbers over adjectives\n- Short paragraphs (1-3 lines)\n- No \"I'm excited to announce\" energy\n- Banned constructions: \"Not just X, but also Y\", trailing `-ing` clauses, em-dashes as decoration\n\n## File conventions\n- Snapshots: `analytics/snapshots/YYYY-MM-DD.md`\n- Posts: `analytics/posts/YYYY-MM-DD_<slug>.md`\n- Idea bank: `analytics/idea_bank.md` (append-only, never renumber)\n- Follow-ups: `analytics/follow_ups.md` (move resolved items to \"Resolved\" section, don't delete)\n\n## Frontmatter schemas\n(Add your own snapshot + post frontmatter schemas here when you have them.)\nYou are running my weekly LinkedIn analytics review. The xlsx export from LinkedIn is the source of truth.\n\n# Step 0 — Load the rules\nRead `~/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.\n\nThen read `~/Projects/LinkedinAnalytics/linkedin_analytics.md` (INDEX) if it exists. It has the file map, last 2 snapshots, and active follow-ups.\n\n# Step 1 — Get fresh xlsx\nCheck `~/Projects/LinkedinAnalytics/` for the newest `AggregateAnalytics_*.xlsx`. Newest by export date (the second date in the filename) = source of truth.\n\nIf older than 24 hours:\n1. `mcp__Claude_in_Chrome__list_connected_browsers`\n2. If no browser — message me (\"Chrome not running, export manually and I'll parse\") and stop.\n3. Navigate to `https://www.linkedin.com/analytics/creator/content/`, wait 3 seconds.\n4. Confirm \"7 days\" period. Set if not.\n5. Click **Export** → confirm in the modal. LinkedIn drops `AggregateAnalytics_<date>.xlsx` into `~/Downloads`.\n6. Move it into the project: `mv ~/Downloads/AggregateAnalytics_*.xlsx ~/Projects/LinkedinAnalytics/`\n7. If still no fresh file — message me and stop.\n\n# Step 2 — Load context efficiently\n- **Always:** `analytics/themes_and_patterns.md`, `analytics/idea_bank.md`, `analytics/follow_ups.md` (skip any that don't exist)\n- **Conditional:** `analytics/competitors.md` if a competitor name surfaces in this week's data\n- **Per-post:** grep frontmatter of `analytics/posts/*.md` for lane rollups. Don't load bodies unless you need the hook or format text\n- **Snapshots:** newest 2-4 in `analytics/snapshots/` for week-over-week and 4-week-avg math\n\n# Step 3 — Parse xlsx with pandas\nInstall if needed: `pip install pandas openpyxl --break-system-packages`.\n\nSheets in the LinkedIn export:\n- **DISCOVERY** — 7d Impressions + Members reached\n- **ENGAGEMENT** — Daily Date / Impressions / Engagements\n- **TOP POSTS** — per-post: URL / Publish Date / Engagements (left), URL / Publish Date / Impressions (right)\n- **FOLLOWERS** — Total + daily new\n- **DEMOGRAPHICS** — Top Companies / Locations / Company size / Seniority / Job title / Industry %\n\nCompute the 12 parameters:\n\n**Volume**\n1. Impressions 7d week-over-week + vs 4-week avg\n2. Members reached\n3. Followers Δ vs 4-week avg\n4. Profile views + Search appearances (if present)\n\n**Engagement quality**\n5. ER aggregate\n6. Comments/impression\n7. Saves/impression\n\n**Per-post**\n8. Classification per your thresholds (breakout / underperformed / normal)\n9. Lane tagging + lane-level ER rollup (grep frontmatter)\n10. Hook/format pattern: first-sentence length, closing question, format\n\n**Timing & reputation**\n11. Best posting slot (grep all post dates → weekday/hour buckets → median ER)\n12. Notable engagers (founder, CEO, Head of, journalist, VC titles in reactor/commenter lists)\n\n# Step 4 — Write atomic files\n\n**New snapshot:** `analytics/snapshots/YYYY-MM-DD.md` using your snapshot frontmatter schema. Body mirrors existing snapshot files.\n\n**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.\n\n**Update themes / ideas / follow-ups only on real evidence:**\n- `themes_and_patterns.md` — only if 2+ confirming posts or a contradicting datapoint\n- `idea_bank.md` — append at next free `#`, never renumber\n- `follow_ups.md` — move resolved items to a \"Resolved\" section, don't delete\n\n# Step 5 — Send a chat digest\n\nCompact, fits one screen, Russian, no fluff:\n\n**LinkedIn week N — <date range>**\n\n<one-line headline with concrete numbers>\n\n| Metric          | This week | WoW    | vs 4w avg |\n| Impressions     | X         | ±N%    | ±M%       |\n| Members reached | ...       |\n| Engagement rate | ...       |\n| Comments/imp    | ...       |\n| Followers Δ     | +N        | (prev +N) | +N     |\n\n**Top posts this week**\n1. <hook 50 chars> — X imp, Y% ER, lane: Z. <one-line why>\n\n**Underperformed** (if any)\n- <hook> — <reason in one phrase>\n\n**Pattern of the week**\n<one concrete observation by lane / format / hook>\n\n**For next week**\n1. <concrete action>\n2. <concrete action>\n3. <concrete action>\n\n# Edge cases\n- 0 original posts this week → still produce a snapshot + flag \"0 originals → followers velocity drops without supply\"\n- Chrome export failed → digest from the last valid xlsx, mark \"STALE DATA\" at top\n- New post fetched but body unavailable → log with body marked `TBD (scrape next session)`, don't block the digest\n\n# Self-check before sending\n- Headline includes 2+ concrete numbers?\n- Recommendations are actionable in 7 days (specific lane / format / timing)?\n- Every new post tagged to a lane?\n- New snapshot file written with frontmatter per CLAUDE.md?\n- INDEX embed refreshed (if INDEX file exists)?\n\nIf any \"no\" — fix before sending.\n```\n\n", "url": "https://wpnews.pro/news/install-md-weekly-linkedin-analytics-agent-installer", "canonical_source": "https://gist.github.com/risingrising/0eeffc299cb02ca10c563337a443c8b5", "published_at": "2026-05-27 18:23:01+00:00", "updated_at": "2026-05-27 18:42:34.125124+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "artificial-intelligence"], "entities": ["LinkedIn", "Claude in Chrome", "Cowork"], "alternates": {"html": "https://wpnews.pro/news/install-md-weekly-linkedin-analytics-agent-installer", "markdown": "https://wpnews.pro/news/install-md-weekly-linkedin-analytics-agent-installer.md", "text": "https://wpnews.pro/news/install-md-weekly-linkedin-analytics-agent-installer.txt", "jsonld": "https://wpnews.pro/news/install-md-weekly-linkedin-analytics-agent-installer.jsonld"}}