# LinkedIn Studio Plugin for Claude Code

> Turn your expertise into LinkedIn authority — without the blank page, the guesswork, or the generic AI slop.

> **Solo-maintained, fork-and-own.** This plugin is a starting point, not a vendor product. Issues are welcome as signals; pull requests are not accepted. See [GOVERNANCE.md](GOVERNANCE.md) for the full model and what upstream provides.

*AI-generated: all code produced by Claude Code through dialog-driven development. [Full disclosure →](../../README.md#ai-generated-code-disclosure)*

![Version](https://img.shields.io/badge/version-4.1.0-blue)
![Platform](https://img.shields.io/badge/platform-Claude_Code_Plugin-purple)
![Commands](https://img.shields.io/badge/commands-29-green)
![Agents](https://img.shields.io/badge/agents-19-orange)
![Hooks](https://img.shields.io/badge/hooks-9-red)
![Reference Docs](https://img.shields.io/badge/reference_docs-25-teal)
![License](https://img.shields.io/badge/license-MIT-lightgrey)

Most experts know they *should* post on LinkedIn — and quietly don't. The blank editor wins. LinkedIn Studio turns that chore into a system: structured workflows that take you from idea to published, in your own voice, calibrated to how LinkedIn's **topic-relevance** ranking model (2026) actually distributes content. Two engines under one surface — a **feed engine** for short-form posts, carousels, and video scripts, and a **long-form engine** that runs newsletter editions and essays through a serious editorial pipeline before they ever lock. 29 commands organized into five journeys (Start · Create · Engage · Measure · Grow), 19 specialized agents, 9 automated quality hooks, and a 25-document knowledge base grounded in the algorithm's real signals.

This is not a shortcut. Hand the wheel to the AI and you land where everyone who did the same lands — the forgettable middle. The plugin removes the friction; the judgment, the genuine engagement, and the effort that make content worth reading remain entirely yours.

---

## Table of Contents

- [Why LinkedIn Studio Exists](#why-linkedin-studio-exists)
- [What Is This?](#what-is-this)
- [Two Engines](#two-engines)
- [Quick Start](#quick-start)
- [Commands](#commands)
- [Agent Architecture](#agent-architecture)
- [Knowledge Base](#knowledge-base)
- [Skills](#skills)
- [Hooks & Automation](#hooks--automation)
- [Analytics System](#analytics-system)
- [Personalization Engine](#personalization-engine)
- [Workflow Examples](#workflow-examples)
- [Content Quality Rules](#content-quality-rules)
- [Configuration](#configuration)
- [What This Plugin Does Not Cover](#what-this-plugin-does-not-cover)
- [Version History](#version-history)
- [License](#license)

---

## Why LinkedIn Studio Exists

For most professionals, the hard part of LinkedIn isn't writing — it's everything around it. You have the expertise. What you don't have is a repeatable way to get it out the door, consistently, in a form the algorithm actually rewards.

**The recognizable pattern of pain:**

- **The blank editor wins.** You open LinkedIn to post, stare at the box, and close it. The idea was there; the activation energy wasn't.
- **You post in bursts, then go quiet.** Three posts one week, nothing for a month. The algorithm reads inconsistency as "not a creator" and quietly throttles you.
- **You can't see why anything works.** One post reaches 12,000 people; the next, near-identical one, reaches 200. With no model of the ranking signals, every post is a coin flip.
- **Generic AI output sounds like generic AI.** It doesn't sound like you, it leans on buzzwords, and LinkedIn's classifiers increasingly suppress exactly that register. "AI-assisted" only helps if it protects your voice.
- **The ground moved in 2026.** LinkedIn's **topic-relevance** model now validates your *profile* before distributing your *content* — an off-topic post or an unoptimized profile caps reach regardless of how good the writing is. Most "LinkedIn tips" predate this and are now actively misleading.

**What the plugin does about it:**

| The pain | The plugin's answer |
|----------|---------------------|
| Blank-page paralysis | Guided workflows — from a 5-minute `/linkedin:quick` to a full `/linkedin:pipeline` — so you start from structure, not a void |
| Inconsistency | A scheduling queue, streak tracking, batch creation, and proactive posting reminders that keep cadence visible |
| Algorithm opacity | Every command is calibrated to documented topic-relevance signals; hooks gate hook-length, link-suppression, buzzwords, and topic rotation *before* you publish |
| Generic slop | Voice training learns your authentic style and flags drift; a voice-guardian hook catches AI register on the way out |
| The topic-relevance shift | `/linkedin:profile` aligns your profile to the new model first, because content distribution now depends on it |

The result is not "AI writes your posts." It's a system that holds the structure, the discipline, and the algorithmic knowledge so you can focus on the one thing only you can supply — the expertise.

> [!TIP]
> New here? Run `/linkedin:onboarding` — it walks you through profile optimization, personalization, and your first published post in one guided flow (~10 minutes).

---

## What Is This?

LinkedIn Studio is a complete LinkedIn content engine inside Claude Code. Instead of an empty post editor, you work through structured workflows that handle ideation, drafting, optimization, scheduling, publishing, and post-publish analytics — all calibrated to how LinkedIn's algorithm actually distributes content.

Key capabilities:

- **profile/topic-relevance optimization** aligned with LinkedIn's AI-first content distribution (2026 update)
- **Content angle system** that generates post ideas from a single topic using 8 universal thought-leadership angles
- **Full content pipeline** from ideation through post-publish 48-hour monitoring
- **Long-form editorial pipeline** — newsletter editions and essays run through skeleton, voice, fact-check, craft, resonance, and cold adversarial review gates *before* they lock
- **Batch content creation** — produce a full week of posts in one session
- **Analytics pipeline** — import LinkedIn CSV exports, parse into structured JSON, generate performance reports
- **Voice training** — learns your authentic writing style and flags drift
- **Growth strategy** — phase-specific guidance from foundation (0–1K followers) through authority (10K+)
- **Monetization and outreach** — readiness assessment, lead magnets, conference CFP templates, collaboration formats and partner pitches
- **Video scripting** — structured scripts for 30s/60s/90s/2min LinkedIn video
- **Multi-platform repurposing** — adapt LinkedIn content for Twitter/X, newsletters, blogs, slides
- **A/B testing framework** — design and track content experiments

---

## Two Engines

LinkedIn Studio is really two content engines sharing one surface. They have different speeds, different gates, and different goals.

### ⚡ The Feed Engine — short-form, fast, frictionless

For everyday presence. The point is *velocity without losing quality*: every content command auto-copies the result to your clipboard, asks at most two questions, and runs your draft through the same algorithm-aware quality gates before it ever leaves your editor.

| Want to… | Command | Time |
|----------|---------|------|
| React to an article or observation | `/linkedin:quick` | ~5 min |
| Write a substantial post | `/linkedin:post` | 10–15 min |
| Turn a URL into a reaction post | `/linkedin:react` | ~5 min |
| Build a carousel (highest engagement format) | `/linkedin:carousel` | ~15 min |
| Script a video | `/linkedin:video` | ~10 min |
| Fill a whole week in one sitting | `/linkedin:batch` | ~30 min |

### 📖 The Long-Form Engine — `/linkedin:newsletter`

For the pieces that build authority — newsletter editions, essays, series articles. This is what sets LinkedIn Studio apart from "AI writes your post" tools: a **16-phase pipeline where the draft has to survive a gauntlet of quality gates *before it locks*.**

```
skeleton gate ──▶ voice scrub ──▶ fact-check ──▶ editorial craft gate ──▶
persona resonance ──▶ cold adversarial review ──▶ visual assets ──▶ LOCK ──▶ hook conversion
   (before prose)      (de-AI)     (sources)        (is it well-made?)
                                                  (does it land?)   (cold, headless)
```

Each gate exists because skipping it is expensive:

- **Skeleton before prose** — spine errors get caught in 15 minutes at the outline stage instead of a full day post-draft.
- **Fact-check before lock** — claims after the model's knowledge cutoff *must* be web-searched; the more convincing a draft reads, the more verification, not less.
- **Editorial craft gate** — an editor (not a reader) judges prose craft and narrative architecture: the blind spots a resonance sweep structurally cannot see.
- **Cold adversarial review** — before lock, the draft can be frozen and re-read by reviewers carrying *no* drafting-session context (argument integrity, language, facts, and reader-fit), so a cold pass catches what the framing-biased in-session gates miss. Run it inline (Step 6.5) or in a fresh session via `/linkedin:headless-review` for maximum independence.

The cost of fixing an error in a published edition is too high — so the gates run upstream, where fixes are cheap.

> Short-form lives in `/linkedin:post`, `:quick`, `:react`, `:carousel`, `:video`. Long-form lives in `/linkedin:newsletter`. `/linkedin:multiplatform` adapts short-form across platforms; long-form repurposing routes back to `/linkedin:newsletter`.

---

## Quick Start

### Prerequisites

- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) with plugin support enabled
- Node.js 18+ (for hooks and analytics CLI; analytics requires `tsx`: `cd scripts/analytics && npm install`)

### Installation

Add the marketplace and browse plugins with `/plugin`:

```bash
claude plugin marketplace add https://git.fromaitochitta.com/open/ktg-plugin-marketplace.git
```

Or enable directly in `~/.claude/settings.json`:

```json
{
  "enabledPlugins": {
    "linkedin-studio@ktg-plugin-marketplace": true
  }
}
```

### Get Started (5 minutes)

Run the onboarding wizard — it walks you through profile, setup, and your first post in one flow:

```
/linkedin:onboarding
```

The wizard handles everything: topic-relevance profile checklist, voice and user profile setup, and a guided first post.

### Already Set Up?

| Goal | Command |
|------|---------|
| Write a post | `/linkedin:post` |
| Quick 5-min post | `/linkedin:quick` |
| React to an article | `/linkedin:react` |
| Write a long-form edition | `/linkedin:newsletter` |
| View your stats | `/linkedin:report` |
| See all commands | `/linkedin` |

---

## Commands

All 29 commands use colon notation: `/linkedin:post`, `/linkedin:quick`, etc. The surface is organized into five journeys (Start · Create · Engage · Measure · Grow); `/linkedin:create` and `/linkedin:measure` are guided front-doors that route you to the right command when you know the journey but not the exact command.

### Onboarding

| Command | Description |
|---------|-------------|
| `/linkedin:onboarding` | Multi-step onboarding wizard — guides you through profile optimization, plugin personalization, and your first post in one flow. |
| `/linkedin:first-post` | First-post accelerator — zero to published in 10 minutes with guided hand-holding. |
| `/linkedin:setup` | Guided setup to populate empty asset templates with your real voice, case studies, and audience data. |

### Content Creation

| Command | Description |
|---------|-------------|
| `/linkedin:create` | **Create front-door.** Guided "what do you want to make?" — routes you to the creation command that owns the format (post, quick, react, carousel, video, multiplatform, batch, or the long-form newsletter). Delegates only. |
| `/linkedin:post` | Full interactive post creation with angle selection, format choice, and refinement. Best for substantial posts (1,200-1,800 characters). |
| `/linkedin:quick` | 5-minute quick post using the 3-line formula. Target: 150-500 characters. Best for reactions, observations, tips, and questions. Also the single entry point for the 8 post-type templates (fill-in-the-blank structures). |
| `/linkedin:newsletter` | Long-form orchestrator — newsletter edition, essay, or series article end-to-end at series quality. Multi-session 16-phase pipeline with skeleton + spine-prose gates BEFORE prose, an editorial-craft gate, fact-check, persona resonance, a cold adversarial review package, and visual assets — all BEFORE lock. |
| `/linkedin:headless-review` | Cold adversarial review package — runs the 3 headless archetypes (`content-reviewer`, `language-reviewer`, `fact-reviewer`) + `persona-reviewer` (resonance/conversion) on a FROZEN draft with no drafting-session context. Step 6.5's standalone surface; run in a fresh session for maximum isolation. |
| `/linkedin:pivot` | Re-open a long-form edition after a substantive late change so cleared gates (fact-check → editorial → persona → headless) re-run before lock. Includes the pivot-detection heuristic (> 20 % word-count change or > 2 new sections). |
| `/linkedin:pipeline` | Full end-to-end content pipeline from idea to published post. Guides through ideation, drafting, optimization, scheduling, pre-engagement, publishing, and post-analysis. |
| `/linkedin:batch` | Create a full week of LinkedIn content in one session. Input one theme, output 3-5 posts with varying angles and formats. Writes to scheduling queue. |
| `/linkedin:calendar` | View and manage the post scheduling queue — upcoming, overdue, published — and run the publish action (mark a scheduled post as published, update state + streak tracking, surface the first-hour engagement plan). |
| `/linkedin:firsthour` | Post-publish first-hour / reply-loop sprint. Delegates to `engagement-coach` for a timestamped target list, draft comments, and a timeline; persists the plan to state (`recordFirstHourPlan`) and hands off to `post-feedback-monitor`. |
| `/linkedin:carousel` | Structured multi-slide carousel generator with slide-by-slide copy and visual layout guidance. Optionally generates slide images via `mcp-image`. |
| `/linkedin:video` | Video script generator for 30s, 60s, 90s, or 2-minute LinkedIn videos with pacing and visual cues. |
| `/linkedin:multiplatform` | Adapt LinkedIn content for Twitter/X threads, newsletter sections, blog posts, presentation slides, and YouTube scripts. |
| `/linkedin:react` | URL-to-post pipeline — paste an article, research paper, or news link and generate a reaction post. |

### Analytics

| Command | Description |
|---------|-------------|
| `/linkedin:measure` | **Measure front-door.** Guided "how am I doing?" — routes you to the analytics command you need (import, report, analyze, audit, or ab-test). Delegates only. |
| `/linkedin:analyze` | Analyze content performance and troubleshoot engagement issues. Diagnoses algorithm penalties, profile-content mismatches, and reach drops. |
| `/linkedin:audit` | Periodic content strategy audit. Reviews top/bottom posts, topic distribution, format mix, and engagement trends. Run quarterly. |
| `/linkedin:report` | Generate weekly performance report from imported analytics data. Shows key metrics, top performers, trends, and actionable alerts. |
| `/linkedin:import` | Import LinkedIn analytics CSV export into structured JSON. Auto-detects files in ~/Downloads, parses CSV, detects anomalies. |
| `/linkedin:competitive` | Competitive analysis of other thought leaders in your niche. Analyzes posting frequency, content types, hooks, and identifies differentiation opportunities. |
| `/linkedin:ab-test` | Design and manage A/B content tests. Track experiments across post variations. |

### Strategy

| Command | Description |
|---------|-------------|
| `/linkedin:strategy` | Growth strategy + authority building. Phase-specific guidance from foundation (0-1K) through authority establishment (10K+), trajectory-aware adjustments, and signature-content compounding for Phase 2+. The single growth/authority entry point — `/linkedin:profile` owns topic-relevance alignment. |
| `/linkedin:monetize` | Monetization strategy with scored readiness assessment, stage-specific action plans, lead magnet blueprints, DM conversion workflows, and revenue dashboards. |
| `/linkedin:outreach` | Outreach orchestrator covering both collaborations and speaking opportunities under one paradigm: readiness assessment (collab thresholds + 100-pt speaker scorecard), partner scoring (25-pt rubric), event/CFP search with Nordic/European conference calendar, 12 collaboration formats across 4 maturity tiers, 4 talk abstract templates, speaker bio variants, co-creation production workflow, unified pipeline tracker, and quarterly results dashboard. |

### Profile & Setup

| Command | Description |
|---------|-------------|
| `/linkedin:profile` | profile/topic-relevance optimization checklist. Audits About section, Experience, Headline, content history alignment, and network patterns. |
| `/linkedin:setup` | Guided setup to populate asset templates with real data. 6 sub-workflows: voice samples, case studies, frameworks, post analysis, demographics, user profile. Calculates personalization score. |
| `/linkedin` | Main router. Shows posting status (streak, weekly progress) and lists all available commands with contextual guidance. |

---

## Agent Architecture

The plugin delegates specialized work to 19 purpose-built agents. Each agent has its own model assignment, color identity, and focused responsibility.

| Agent | Model | Color | Primary Responsibility |
|-------|-------|-------|----------------------|
| `content-optimizer` | Sonnet | Blue | Optimize posts against algorithm signals, hooks, CTAs |
| `strategy-advisor` | Sonnet | Green | Growth strategy and phase-specific guidance |
| `analytics-interpreter` | Sonnet | Yellow | Pattern discovery + weekly/monthly performance reports (interpret/report modes) |
| `engagement-coach` | Sonnet | Magenta | 5x5x5 + first-hour tactics + CEA commenting + target selection |
| `content-planner` | Sonnet | Cyan | Weekly/monthly content calendars and mix enforcement |
| `network-builder` | Sonnet | Teal | Strategic networking, connection scoring, DM templates |
| `content-repurposer` | Sonnet | Purple | Format conversion and evergreen content refresh |
| `trend-spotter` | Sonnet | White | Trending topics, opportunity scoring, first-mover assessment |
| `voice-trainer` | Sonnet | Pink | Voice profile building and drift detection |
| `differentiation-checker` | Sonnet | Gray | Originality scoring and commodity content detection |
| `post-feedback-monitor` | Opus | Lime | Post-publish 48h monitoring and real-time interventions |
| `video-scripter` | Sonnet | Violet | Video script creation with pacing and visual cues |
| `fact-checker` | Opus | Brown | Factual-claim verification against primary/credible sources, post-cutoff web-search mandate (longform) |
| `editorial-reviewer` | Opus | Orange | Editor's craft gate (Step 5.5, before persona sweep): **prosa-håndverk** + **narrativ-arkitektur**, ≤10 flags BLOCK/REWORK/NICE as direction, operator-gated via `SendUserFile`; mirrors Maskinrommet §C2 (longform) |
| `persona-reviewer` | Opus | Olive | Reader-persona **skeleton** (before prose) + **resonance** (before lock) + **hook-conversion** (after lock) gate, blocking hard-fail list (longform) |
| `voice-scrubber` | Opus | Red | De-AI scrub + Norwegian-chronicle voice-drift correction; gold standard = approved Norwegian editions, not the English post corpus (longform) |
| `content-reviewer` | Opus | Maroon | (Step 6.5 — cold/headless) Argument integrity: logical holes · unsupported assumptions · contradiction · missing concretization · unanswered objection; ≤8 flags; refuses drafting-session framing as context pollution (longform) |
| `language-reviewer` | Opus | Navy | (Step 6.5 — cold/headless) Norwegian language: verbatim repetition · anglicisms · stiff register · self-contradiction · clang/rhythm; ≤10 flags; deliberate cold re-take of editorial's prose axis (longform) |
| `fact-reviewer` | Opus | Gold | (Step 6.5 — cold/headless) Cold re-verification on the frozen/pivoted version (web search): verifiable claims · quote precision · number attribution · source quality; 🔴/🟡/🟢 + pivot-risk; deliberate redundancy with `fact-checker` (longform) |

### Content Pipeline

Agents collaborate across the end-to-end content lifecycle:

```
trend-spotter --> content-planner --> differentiation-checker --> content-optimizer --> [PUBLISH]
                       |                                                                    |
                  voice-trainer                                                    engagement-coach
                                                                                  (5x5x5 + first-hour
                                                                                   + CEA commenting)
                  analytics-interpreter
                  (interpret + report modes)
```

Parallel support agents: `strategy-advisor`, `analytics-interpreter`, `network-builder`, `content-repurposer`, `video-scripter`.

Longform quality gates (newsletter): **`persona-reviewer` (skjelett) run BEFORE prose** (Step 2.5) → `voice-scrubber` de-AI / chronicle-voice scrub (Step 4) → `fact-checker` (Step 5) → **`editorial-reviewer` craft gate run BEFORE the persona sweep** (Step 5.5) → `persona-reviewer` (resonance) run BEFORE lock (Step 6) → **headless adversarial review package run COLD BEFORE lock** (Step 6.5: `content-reviewer` + `language-reviewer` + `fact-reviewer` + `persona-reviewer`) → `persona-reviewer` (conversion) run AFTER lock on the hook (Step 9).

> **Note (agent invocation + reload):** Commands invoke agents by their **namespaced**
> type — `subagent_type: linkedin-studio:<name>`, never the bare name. And a
> **newly added** agent file under `agents/` only becomes invokable after a Claude Code
> **session reload** (the plugin agent set is built at session start). Add the agent, then
> reload before invoking it.

### Which Agent Do I Need?

| Scenario | Agent |
|----------|-------|
| "Make this post better" | content-optimizer |
| "What should I post about?" | content-planner, trend-spotter |
| "Is this original enough?" | differentiation-checker |
| "Plan my week's content" | content-planner |
| "How did I do this week?" | analytics-interpreter (report mode) |
| "Analyze my LinkedIn data" | analytics-interpreter (interpret mode) |
| "Help me engage more" | engagement-coach |
| "Who should I comment on?" | engagement-coach |
| "Build my network" | network-builder |
| "Does this sound like me?" | voice-trainer |
| "Repurpose my best post" | content-repurposer |
| "What's trending in my field?" | trend-spotter |
| "How do I monetize?" | strategy-advisor |
| "How is my latest post doing?" | post-feedback-monitor |
| "How personalized is my plugin?" | `/linkedin:setup` |
| "Write a LinkedIn video script" | video-scripter |

---

## Knowledge Base

The plugin includes **25 reference documents** covering the full LinkedIn thought leadership domain:

| Category | Document | When to Use |
|----------|----------|-------------|
| Algorithm | `algorithm-signals-reference.md` | Profile setup, troubleshooting reach |
| Angles | `thought-leadership-angles.md` | Choosing post angle (8 universal angles) |
| Engagement | `engagement-frameworks.md` | Writing hooks, CTAs, 5x5x5 method |
| Formats | `linkedin-formats.md` | Choosing content format |
| Growth | `linkedin-growth-playbook-2025-2026.md` | Strategy deep-dive |
| Monetization | `linkedin-monetization-strategies.md` | Revenue planning |
| Newsletter | `newsletter-strategy-guide.md` | Newsletter strategy (5,000+ followers) |
| Articles | `articles-strategy-guide.md` | Long-form content |
| Long-form Quality | `longform-quality-rules.md` | Long-form editorial gates and quality bar |
| Roadmaps | `growth-roadmaps.md` | Monthly planning |
| Low-frequency | `low-frequency-posting-strategy.md` | 2-3x/week strategy |
| Collaborations | `collaborations-guide.md` | Partnership strategy |
| Opportunities | `opportunity-generation.md` | Business development |
| Analytics | `analytics-tools-guide.md` | Finding your edge |
| Troubleshooting | `troubleshooting-guide.md` | When reach drops |
| URLs | `url-processing-templates.md` | Converting external content |
| AI Content | `ai-content-framework.md` | AI-specific angles |
| First Comment | `first-comment-strategy.md` | Comment templates and timing |
| Visual Style | `linkedin-visual-style.md` | Image and carousel specs |
| Polls | `poll-strategy-guide.md` | Poll question types and follow-up |
| A/B Testing | `ab-testing-framework.md` | Content experiment design |
| Scheduling | `scheduling-strategy.md` | Optimal posting times and rotation |
| Trajectory | `trajectory-strategy-adjustments.md` | Growth trajectory adjustments |
| Video | `video-strategy-guide.md` | LinkedIn video best practices |
| Glossary | `glossary.md` | 38 plugin-specific terms |

---

## Skills

Six domain-specific skills organize the plugin's knowledge and route commands to the right context:

| Skill | Domain | Commands Routed |
|-------|--------|-----------------|
| `linkedin-studio` | Router + shared knowledge (algorithm, quality rules) | `/linkedin`, `/linkedin:setup` |
| `linkedin-content-creation` | Posts, batch, pipeline, video, calendar, newsletter | `/linkedin:post`, `:quick`, `:pipeline`, `:batch`, `:calendar`, `:video`, `:multiplatform`, `:newsletter`, `:carousel` |
| `linkedin-analytics` | Analysis, reporting, import, A/B testing | `/linkedin:analyze`, `:audit`, `:import`, `:report`, `:ab-test` |
| `linkedin-strategy` | Growth, authority (absorbed), competitive, monetization | `/linkedin:strategy`, `:competitive`, `:monetize` |
| `linkedin-networking` | Engagement, collaborations, speaking (all in `outreach`) | `/linkedin:outreach` |
| `linkedin-voice` | Voice training, profile optimization, differentiation | `/linkedin:profile` |

---

## Hooks & Automation

9 hooks across 7 events provide automated quality gates, state management, and proactive reminders. All hooks are Node.js (.mjs) for cross-platform support.

| Event | Type | Purpose |
|-------|------|---------|
| `SessionStart` | command | Load persistent state, posting metrics, REMEMBER.md context, and 10K milestone tracker |
| `PreToolUse` (Write\|Edit) | command | **Content quality gate** — hook length, link check, tone, post length |
| `PreToolUse` (Write\|Edit) | command | **Voice guardian** — AI authenticity check and voice matching |
| `PreToolUse` (Write\|Edit) | command | **Topic rotation gate** — no back-to-back same pillar, no pillar >50% in 14-day window |
| `Stop` | command | Update state file with posting metrics and pre-publish reminders |
| `UserPromptSubmit` | command | LinkedIn context enrichment based on prompt keywords (two-tier matching) |
| `PostToolUse` (Write) | command | Post-creation automation: alternative hooks, posting time, 5x5x5 reminder |
| `PreCompact` | command | Preserve critical LinkedIn context during context compaction |
| `Notification` (idle_prompt) | command | Proactive posting reminders: streak risk, weekly goals, optimal windows (rate-limited 30min) |

### How Hooks Collaborate

PreToolUse hooks use a shared **content-gatekeeper** (`content-gatekeeper.mjs`) that first checks `isLinkedInContent()` before injecting the relevant prompt. This prevents false positives on non-LinkedIn file edits.

Session markers (`/tmp/linkedin-hooks/session-active`) are set when LinkedIn content is detected. The Stop hook only fires state updates if this marker exists (max 12h staleness). The Notification hook rate-limits via a separate marker with a 30-minute cooldown.

> [!NOTE]
> Prompt content lives in `hooks/prompts/*.md` and is loaded dynamically at runtime. The compiled `hooks.json` is generated from `hooks.template.json` — do not edit it directly.

---

## Analytics System

A Node.js CLI tool for parsing LinkedIn CSV exports into structured JSON.

### Workflow

1. Export analytics CSV from LinkedIn
2. Place in `assets/analytics/exports/` (or use auto-detect from ~/Downloads)
3. Run `/linkedin:import` to parse into structured JSON
4. Run `/linkedin:report` to generate weekly performance reports

### CLI Usage

```bash
ANALYTICS_ROOT="${CLAUDE_PLUGIN_ROOT}/assets/analytics" \
  node --import tsx "${CLAUDE_PLUGIN_ROOT}/scripts/analytics/src/cli.ts" import <file>

ANALYTICS_ROOT="${CLAUDE_PLUGIN_ROOT}/assets/analytics" \
  node --import tsx "${CLAUDE_PLUGIN_ROOT}/scripts/analytics/src/cli.ts" report --week <W>

ANALYTICS_ROOT="${CLAUDE_PLUGIN_ROOT}/assets/analytics" \
  node --import tsx "${CLAUDE_PLUGIN_ROOT}/scripts/analytics/src/cli.ts" trends --period <P> --metric <M>
```

### Storage

```
assets/analytics/
├── exports/         # Raw CSV from LinkedIn (drop files here)
├── posts/           # Imported post data as JSON
└── weekly-reports/  # Generated weekly reports
```

Agents that consume analytics data: `analytics-interpreter` (interpret/report modes).

---

## Boundaries (as of 2026-05)

LinkedIn Studio is honest about what it can and cannot do for a **personal
profile**. As of 2026-05:

- **Post-level analytics via API** — exists, but is **partner-gated** (a vetted
  Community Management API app + a verified organization + a Page). It is **not
  self-serve** for a solo personal profile, so the practical floor is the **CSV
  export** you drop into `/linkedin:import`. Per-post **saves** are visible in your
  **native** LinkedIn post analytics (count-only, since ~Sept 2025) but are absent
  from the CSV export, and there is no self-serve API to pull them. The tool does
  **not** auto-track saves — but you can record them **manually**: add a `Saves`
  column to the CSV with the counts you read off LinkedIn, and `/linkedin:import`
  ingests them and surfaces them in the weekly/monthly reports (omit the column and
  saves simply stays unknown — never counted as 0, never folded into engagement
  rate).
- **Auto-publish** — technically **possible** self-serve via the `w_member_social`
  scope, so this is **not** an API limitation. LinkedIn Studio **deliberately does
  not** post for you: the OAuth/token overhead plus LinkedIn's terms on automated
  posting make copy-to-clipboard + you-paste the right default. This is a **design
  choice**, not an impossibility. The calendar's "publish" action marks a post
  **you** posted as published — it never posts on your behalf.
- **Dwell time** — internal to LinkedIn for organic posts; not exportable. The tool
  does not measure it.

---

## Personalization Engine

The plugin tracks how well you've populated asset templates with your own data. A higher personalization score means more tailored content output.

### Scoring Categories (100 points total)

| Category | Weight | Source |
|----------|--------|--------|
| Voice samples | 25 | `assets/voice-samples/` |
| User profile | 20 | `config/user-profile.local.md` |
| Case studies | 15 | `assets/case-studies/` |
| Frameworks | 10 | `assets/frameworks/` |
| High-engagement posts | 10 | `assets/examples/` |
| Demographics | 8 | `assets/audience-insights/` |
| Engagement patterns | 7 | `assets/audience-insights/` |
| Post templates | 5 | `assets/templates/` |

Run `/linkedin:setup` to see your current score and walk through guided workflows for each category. The score is also displayed in your session status line at startup.

### Assets Directory

| Directory | Contents |
|-----------|----------|
| `templates/` | Post type templates, carousel blueprints, article template, content calendar |
| `checklists/` | Quality scorecard for pre-publish checks |
| `examples/` | High-engagement post examples |
| `voice-samples/` | Your authentic voice reference (add your own) |
| `audience-insights/` | Demographics and engagement patterns |
| `case-studies/` | Case study template for your real stories |
| `frameworks/` | Framework template for your methodologies |
| `analytics/` | Imported data, weekly reports (gitignored) |
| `drafts/` | Post scheduling queue and weekly drafts (gitignored) |

---

## Workflow Examples

### 1. Sunday Content Prep

```
/linkedin:batch
> Theme: AI adoption in government IT

# Creates 3-5 posts with varying angles and formats
# Posts are added to the scheduling queue

/linkedin:calendar
# Review the upcoming week's schedule
```

### 2. Quick React Post (5 minutes)

```
/linkedin:quick
> Just saw Microsoft announce Copilot Studio autonomous agents —
> this changes everything for low-code teams
```

### 3. A Long-Form Edition, Done Right

```
/linkedin:newsletter
> Write the next edition of my series on AI governance in the public sector

# Multi-session: skeleton gate → spine prose → voice scrub → fact-check →
# editorial craft gate → persona resonance → cold adversarial review →
# visual assets → lock → hook conversion. Resumes by phase across sessions.
```

### 4. Import Analytics and Review Performance

```
/linkedin:import
> ~/Downloads/linkedin-analytics-2026-02.csv

/linkedin:report
> Show me last week's performance

/linkedin:audit
> Full quarterly review
```

### 5. Grow from 2K to 5K Followers

```
/linkedin:strategy
> I have about 2,500 followers and want to reach 5K

/linkedin:competitive
> Analyze the top 5 thought leaders in Microsoft AI for government
```

### 6. Repurpose a Viral Post

```
/linkedin:multiplatform
> Take my best-performing post and adapt it for a Twitter thread
> and 3 presentation slides
```

---

## Content Quality Rules

The plugin enforces quality standards through hooks and agent behavior:

| Rule | Threshold | Enforcement |
|------|-----------|-------------|
| Hook length | 110-140 characters | PreToolUse quality gate |
| Post length (standard) | 1,200-1,800 characters | PreToolUse quality gate |
| Post length (quick) | 150-500 characters | PreToolUse quality gate |
| No external links in body | 0 links | PreToolUse quality gate (body links correlate with lower reach) |
| No corporate buzzwords | Blocklist: leverage, synergy, paradigm shift, thought leader, disruptive, value proposition, ecosystem, holistic approach | PreToolUse quality gate |
| Topic alignment | Must align with 5 core expertise areas | topic-relevance signal check |
| Topic rotation | No back-to-back same pillar; no pillar >50% in 14 days | Topic rotation gate (warn-only) |
| Voice consistency | AI authenticity check + voice matching | Voice guardian hook |

---

## Configuration

### User Profile

```bash
cp config/user-profile.template.md config/user-profile.local.md
```

Edit with your name, expertise areas, target audience, voice preferences, and LinkedIn goals. The more detail you provide, the more personalized the output.

### State File

The plugin tracks posting metrics in `~/.claude/linkedin-studio.local.md`:

```yaml
---
last_post_date: 2026-01-28
posts_this_week: 2
weekly_goal: 3
current_streak: 12
current_week: "2026-W05"
follower_count: 0
follower_target: 10000
target_date: "2026-12-31"
next_planned_topic: ""
---
```

State is automatically initialized on first session start (from `config/state-file.template.md`) and updated by the Stop hook after each content session.

### Post Queue

Scheduled posts are tracked in `assets/drafts/queue.json`:

- Managed by `queue-manager.mjs` (imported by session-start, posting-reminder, and commands)
- Status flow: `draft` -> `scheduled` -> `published` (or `cancelled`)
- Created by `/linkedin:batch` and `/linkedin:pipeline`
- Viewed via `/linkedin:calendar`
- Transitioned (marked as published) via the `/linkedin:calendar` publish action

---

## What This Plugin Does Not Cover

| Area | Why | Alternative |
|------|-----|-------------|
| LinkedIn API integration | No official API for content posting | Copy/paste from generated drafts (auto-copied to clipboard) |
| Real-time analytics | LinkedIn doesn't provide streaming data | Periodic CSV import via `/linkedin:import` |
| Engagement automation | Automated commenting violates LinkedIn ToS | Manual engagement guided by `/linkedin:outreach` |
| Profile editing | Plugin generates recommendations, not API calls | Apply changes manually on LinkedIn |
| Team/multi-user workflows | Designed for individual thought leaders | Enterprise LinkedIn tools |
| Content scheduling via API | No official scheduling API | Queue management with manual posting via `/linkedin:calendar` (publish action) |

---

## Version History

| Version | Date | Highlights |
|---------|------|-----------|
| **4.1.0** | 2026-05-30 | **Journey layer over the command surface.** 14a's cold command-rationalization audited all 27 commands and found **zero redundancy** (over-grown in count, not duplication) → no merges/cuts. Instead, a journey layer is added: two new guided front-doors — **`/linkedin:create`** (routes to the right creation command) and **`/linkedin:measure`** (routes to the right analytics command) — and the router re-tiered into five journeys (Start · Create · Engage · Measure · Grow), with `onboarding`/`strategy` elevated as the Start/Grow front-doors and the 27 atomic commands kept as the execution tier (→ 29 commands). Router now lists `/linkedin:firsthour`; `calendar` cross-links to it. **Minor / additive** — no command removed, renamed, or behavior-changed; reload registers the two new commands. |
| **4.0.0** | 2026-05-30 | **Audit-remediation release (Voyage Phase 0–3).** A critical self-review found overclaiming (tracking/analytics/review-independence the plugin couldn't deliver), dormant capability (11 agents never invoked by any command), and structural rot (a dead lint, a self-contradicting algorithm claim, an unpublishable model brand/date in user copy). The fix: every claim made honest or removed; **all 11 orphaned agents wired** (no deletions → 19 agents); new **`/linkedin:firsthour`** command (→ 27 commands) + short-form de-AI gate + video quality gate; `post-feedback-monitor` → Opus; honest newsletter-distribution / profile-SEO / outreach surfaces; **algorithm signals reconciled to one sourced statement** (no model name/date) with `references/algorithm-signals-reference.md` as the single source of truth; analytics fresh-clone crash fixed; **voice-profile leak closed** (placeholder + sentinel + gitignore); structure lint rebuilt with version/count/stat/model-consistency + render-chain-propagation + `$`-safety guards (post-release remediation S8–S13); 7-gate long-form review stack measured → no gate trimmed. **Breaking — reinstall/reload required** for the newly-wired agents; consolidates the v3.0.0 identity break. |
| **3.1.0** | 2026-05-29 | Adversarial review package (Endring 9). New **`/linkedin:headless-review`** command + **Step 6.5 (headless-review)** in `/linkedin:newsletter`: three cold/headless archetypes — **`content-reviewer`** (argument), **`language-reviewer`** (Norwegian), **`fact-reviewer`** (cold re-verification + pivot-risk) — plus `persona-reviewer` (resonance/conversion), all with NO drafting-session context. New **`/linkedin:pivot`** command + pivot-detection gate (> 20 % word-count / > 2 new sections re-opens cleared gates before lock). **Per-artifact personas** (`articles.NN.personas`). Pipeline 15 → 16 phases; 24 → 26 commands; 16 → 19 agents; additive `personas`/`pivots`/`headlessReview` state. Backward-compatible; reload required for the new agents. |
| **3.0.0** | 2026-05-29 | **Renamed** `linkedin-thought-leadership` → `linkedin-studio` ("LinkedIn Thought Leadership" → **LinkedIn Studio**). Breaking (slug + agent namespace `linkedin-studio:<agent>` + runtime state path `~/.claude/linkedin-studio.local.md` all change; reinstall required, state migrated in place), but **functionality byte-identical to v2.4.0**. The `/linkedin:*` commands are unchanged (frontmatter-namespaced, slug-independent). Catch-all skill dir renamed to match (`skills/linkedin-studio/`); the five functional skills unchanged. |
| **2.4.0** | 2026-05-29 | Editor's craft gate as an explicit pipeline phase. New **`editorial-reviewer` agent** (Opus) + **Step 5.5 — Editorial review** in `/linkedin:newsletter` (between fact-check and the persona sweep): two axes — **prosa-håndverk** (em-dash density, verbatim repetition, postulated numbers, contradictions, versal-tic) + **narrativ-arkitektur** (concrete instantiation, theory-anchored hypotheses, series-title symmetry, equal action per addressee, un-overloaded conclusion); ≤10 flags BLOCK/REWORK/NICE as direction; operator-gated via `SendUserFile`; mirrors Maskinrommet §C2. Motivated by Del 4 (every persona PASS, yet 8 fresh editor points, ~6/8 craft/architecture blind spots). `editorial-review` phase + additive `editorialReview` state. Pipeline 14 → 15 phases; 15 → 16 agents. New agent + fasit fixture + lint test the only new files; commands (24) unchanged. |
| **2.3.0** | 2026-05-28 | Visual assets as an explicit pipeline phase. New **Step 7.5 — Visual assets** in `/linkedin:newsletter` (between annotation and lock): cover (+ optional inline figures) or carousel deck, generated (default `mcp-image`; external `cover-raw.png` accepted) and operator-gated via `SendUserFile` BEFORE lock so `build-linkedin.mjs` picks up `cover.png` without a post-lock re-render. Explicit `format: "carousel"` branch reusing `build-carousel.mjs`. New `config/image-credit-caption.template.md`; additive `visualAssets` state + naming convention (`cover.png` / `cover-v<N>-kandidat.png` / `cover-raw.png` / `fig<N>.png`). Pipeline 13 → 14 phases. Doc/orchestration-only (no new code); commands (24) + agents (15) unchanged. |
| **2.2.0** | 2026-05-28 | Longform gates hardened (2nd production run). Persona gate blocking with explicit hard-fail list (primær mistet meg / doesn't own action / sjargong-mur / modell-navne-katalog → BLOCK; «JA med forbehold» = NEI). Fact-check post-cutoff web-search mandate + high-frequency-error checklist. New `voice-scrubber` agent (Opus): de-AI scrub + Norwegian-chronicle voice-drift, gold standard = approved Norwegian editions (NOT the English post corpus). Render+annotate operator gates (Steps 2.5/3a). Edition state reconciled with STATE.md (ONE-system); `edition-HANDOVER.template.md` deleted. 14 → 15 agents; commands unchanged (24). |
| **2.1.0** | 2026-05-28 | Skeleton gate BEFORE prose in `/linkedin:newsletter`. New Step 2.5 (skeleton + section pitch, operator-gate + persona-skjelett-sweep) and Step 3a (spine prose, operator-gate) split the old Step 3 into pre-prose stages with their own gates. New `persona-reviewer` mode (`skjelett`). Pipeline grows 11 → 13 phases; commands and agents unchanged in count (24, 14). Encodes the Maskinrommet writing-contract §A discipline (premiss / problem / anbefaling / gevinst / vei videre) into the pipeline. Empirically motivated by the Seres-serien Del 3 + Del 4 spine-rework cost. |
| **2.0.0** | 2026-05-28 | Full-spectrum content engine. `/linkedin:newsletter` long-form orchestrator with multi-session edition-state, fact-check + persona-sweep gates BEFORE lock. New agents: `fact-checker`, `persona-reviewer` (both Opus). Render pipeline migrated in-plugin with self-hosted OFL-1.1 fonts. Net-fewer surface: 27 → 24 commands (5 removed, 2 added), 16 → 14 agents (4 merged, 2 added). Router gating on monetize/outreach (unlocks at ~1K). `/linkedin:import` delegates analysis to `/linkedin:report`. |
| **1.2.0** | 2026-04-11 | Friction reduction release. Auto-clipboard on all content commands, reduced interactive steps (max 2 per post), deterministic state management (`state-updater.mjs`), MCP image carousel pipeline, progressive onboarding, iCal calendar integration for batch scheduling, auto-prune content history (90 days). |
| **1.1.0** | 2026-04-08 | Q2 feature release. 27 commands (+onboarding, +carousel). Week-rollover automation, voice drift scoring, industry content matrix, multi-URL react, day-of-week heatmap, month-over-month reports. |
| **1.0.0** | 2026-04-07 | Public release. 25 commands, 16 agents, 9 hooks, 6 skills, 24 reference docs. Agent model tiering (Sonnet/Haiku), all scripts Node.js, comprehensive documentation. |
| **0.6.0** | 2026-02-07 | First formal version. 20 commands, 15 agents, 8 hooks, analytics system, profile/topic-relevance optimization, content matrix system, personalization engine, 20 reference documents. |

See [CHANGELOG.md](CHANGELOG.md) for full details and known gaps.

---

## License

This project is licensed under the [MIT License](LICENSE).

The plugin architecture, content strategies, and algorithm analysis are original work. LinkedIn is a trademark of LinkedIn Corporation.

---

*The algorithm rewards expertise, consistency, and authenticity. Everything else is noise.*
