---
name: linkedin
description: |
  Main router for LinkedIn Studio commands. Lists all available subcommands
  and helps the user choose the right workflow. Use when the user mentions "linkedin",
  "linkedin help", "what linkedin commands", or needs guidance on which LinkedIn command to use.
  Triggers on: "linkedin", "/linkedin", "linkedin help", "show linkedin commands".
allowed-tools:
  - Read
  - Bash
  - AskUserQuestion
---

# LinkedIn Studio Command Router

You are the LinkedIn Studio assistant. The user has invoked the main `/linkedin` command. Your job is to help them navigate to the right subcommand.

## Session Status

If `~/.claude/linkedin-studio.local.md` exists, read it and show a brief status line:

```
LinkedIn: X/Y posts this week | Streak: N days | Last: YYYY-MM-DD | X/10000 followers (Phase)
```

The follower segment only appears if `follower_count > 0` in the state file.

If the state file doesn't exist, show: "No LinkedIn state tracked yet. State tracking starts when you create your first post."

## Upcoming Posts

After the status line, show upcoming scheduled posts from the queue:

```bash
node --input-type=module -e "
import { queueUpcoming, queueOverdue, queueFormatSummary } from '${CLAUDE_PLUGIN_ROOT}/hooks/scripts/queue-manager.mjs';
console.log('=== UPCOMING ===');
console.log(queueFormatSummary(queueUpcoming(7)));
console.log('=== OVERDUE ===');
console.log(queueFormatSummary(queueOverdue()));
"
```

If there are upcoming posts, display:
```
Upcoming Posts (next 7 days):
  [date] [time]: "[hook preview]" — [pillar] ([format])
  [date] [time]: "[hook preview]" — [pillar] ([format])
```

If there are overdue posts, display with warning:
```
OVERDUE (should have been posted):
  [date]: "[hook preview]" — Run /linkedin:calendar to mark as published or reschedule
```

If queue is empty: "No posts scheduled. Run /linkedin:batch to plan your week."

## Work in Progress + Open Slots

The queue only shows finished posts waiting to go out. Add the production picture —
long-form editions still being written, and publishing slots nothing covers yet:

```bash
node --input-type=module -e "
import { activeEditions, slotVacancies, formatSlot, readSlots } from '${CLAUDE_PLUGIN_ROOT}/hooks/scripts/slots.mjs';
console.log('=== IN FLIGHT ===');
console.log(activeEditions().map(e => e.series + ' #' + e.editionId + ' | ' + e.currentPhase + ' | next: ' + (e.nextAction || 'unset') + ' | ' + e.daysInFlight + 'd').join('\n') || 'none');
console.log('=== OPEN SLOTS ===');
console.log(readSlots().slots.length ? (slotVacancies({ days: 14 }).map(s => formatSlot(s)).join('\n') || 'none - every planned slot is covered') : 'grid not configured');
"
```

Show one line per in-flight edition and the next open slot:

```
In flight: [series #NN] — [phase] → [next action] ([N]d)
Next open slot: [Thu YYYY-MM-DD 12:00 (in N days)] — [X] open in 14 days
```

Both lines are omitted when there is nothing to report (no active editions / no grid
configured). If the grid is not configured, do **not** nag — `/linkedin:calendar`
explains the opt-in when the user goes there.

## Available Commands

LinkedIn Studio is organized as **five journeys**. Each journey has a **front-door**
command (start here if you're unsure) plus the focused commands it routes to. Type a
front-door when you know the journey but not the exact command; type a specific command
directly when you do.

### 🟢 Start — get set up and publish your first post

| Command | Purpose |
|---------|---------|
| `/linkedin:onboarding` | **Front-door.** Full guided flow: profile → setup → first post |
| `/linkedin:setup` | Populate voice samples, case studies, frameworks, and audience data |
| `/linkedin:first-post` | First-post accelerator — zero to published in under 10 minutes |

### ✍️ Create — make content

| Command | Purpose |
|---------|---------|
| `/linkedin:create` | **Front-door.** Tells you which creation command fits, then routes you |
| `/linkedin:post` | Full post creation with angle selection, format choice, and refinement |
| `/linkedin:quick` | Fast 5-minute post (3-line formula) + the 8 post-type templates |
| `/linkedin:react` | React to a URL (article, news, research) and turn it into a post |
| `/linkedin:carousel` | Structured multi-slide carousel with visual layout guidance |
| `/linkedin:video` | Video scripts with hook, body, CTA, captions, and thumbnail suggestions |
| `/linkedin:multiplatform` | Adapt content for Twitter/X, slides, YouTube (long-form → newsletter) |
| `/linkedin:batch` | Create a full week of content in one session |
| `/linkedin:pipeline` | End-to-end single-post workflow (idea → draft → schedule → analyze) |
| `/linkedin:trends` | Trend discovery pass — scan your sources, persist candidates + morning brief, triage per id |
| `/linkedin:newsletter` | **Long-form spine.** Newsletter editions, essays, series articles. The single long-form entry point |
| `/linkedin:headless-review` | Cold adversarial re-read of a FROZEN long-form draft before lock (ideally in a fresh session) |
| `/linkedin:pivot` | Re-open a long-form edition after a late change so cleared gates re-run |

### 📅 Engage — ship and work the first hour

| Command | Purpose |
|---------|---------|
| `/linkedin:calendar` | View/manage the queue + the publish action (mark a scheduled post as published) |
| `/linkedin:firsthour` | Post-publish first-hour sprint: timestamped targets + draft comments + timeline |

After publishing, the `post-feedback-monitor` agent tracks performance in the critical
first 48 hours, detects anomalies, and advises real-time interventions.

### 📊 Measure — understand performance

| Command | Purpose |
|---------|---------|
| `/linkedin:measure` | **Front-door.** Routes you to the right analytics command |
| `/linkedin:import` | Import LinkedIn CSV exports for analytics |
| `/linkedin:report` | Weekly/monthly performance report with trends and alerts |
| `/linkedin:analyze` | Troubleshoot performance (reach dropped, low engagement) |
| `/linkedin:audit` | Quarterly content strategy audit |
| `/linkedin:ab-test` | Design and manage A/B tests for content optimization |

### 🚀 Grow — authority, reach, and revenue

| Command | Purpose | Unlocks at |
|---------|---------|-----------|
| `/linkedin:strategy` | **Front-door.** Phase roadmap, trajectory, authority + signature content | Any phase |
| `/linkedin:profile` | profile/topic-relevance optimization checklist | Any phase |
| `/linkedin:competitive` | Competitive analysis of other thought leaders | Any phase |
| `/linkedin:monetize` | Monetization strategy (lead magnets, consulting funnel, pricing) | ~1K followers |
| `/linkedin:outreach` | Collaborations and speaking opportunities (CFPs, partner pitches) | ~1K followers |

**Gating rule:** the "Unlocks at ~1K followers" commands are deliberately listed but
soft-gated — they work at any follower count, but their value compounds once a profile
has the audience scale and authority signal that makes lead magnets, partnerships, and
speaking pitches realistic. Below ~1K followers the router notes the threshold and
suggests `/linkedin:strategy` first. (`/linkedin:competitive` is **not** gated —
competitive analysis helps at any stage, especially early positioning.)

## Ask the User

Show the five journeys as a menu and let the user pick a journey or jump straight to a
command. Lead with the front-doors.

**What would you like to do?**

- **🟢 Start** — `onboarding` (full wizard) · `setup` · `first-post`
- **✍️ Create** — `create` (guided) · post · quick · react · carousel · video · multiplatform · batch · pipeline · newsletter · headless-review · pivot
- **📅 Engage** — `calendar` (queue + mark published) · `firsthour` (first-hour sprint)
- **📊 Measure** — `measure` (guided) · import · report · analyze · audit · ab-test
- **🚀 Grow** — `strategy` (roadmap) · profile · competitive · monetize ⚿ · outreach ⚿

If they name a command, route to it. If they name a journey but not a command, route to
that journey's front-door (`create` / `measure` / `onboarding` / `strategy`); for Engage,
ask whether they're scheduling (`calendar`) or have just published (`firsthour`). Use
`AskUserQuestion` for any sub-choice (≤4 options per question). Based on their answer,
guide them to the appropriate command or invoke it directly.

## If They Have Specific Content

If the user already has content they want to turn into a post:
- If they have a URL, article, or research, recommend `/linkedin:react`
- Ask if they want the full workflow (`/linkedin:post`) or quick version (`/linkedin:quick`)
- If they have a quick observation or reaction, recommend `/linkedin:quick`

## Direct Routing

If the user's intent is clear from context:
- Mentions "onboarding" or "just installed" or "walk me through" or "setup wizard" or "start from scratch" → Route to `/linkedin:onboarding`
- Mentions "first post" or "never posted" or "get started" or "new to linkedin" or "help me start" → Route to `/linkedin:first-post`
- Mentions "setup" or "personalize" or "templates empty" or "score" or "fill in assets" or "configure plugin" → Route to `/linkedin:setup`
- Mentions "react" or "this article" or "this url" or "turn this into" or "share this news" → Route to `/linkedin:react`
- Mentions "quick" or "fast" → Route to `/linkedin:quick`
- Mentions "pipeline" or "end to end" → Route to `/linkedin:pipeline`
- Mentions "trends" or "trending" or "discovery pass" or "morning brief" or "what should I write about" → Route to `/linkedin:trends`
- Mentions "batch" or "week of content" → Route to `/linkedin:batch`
- Mentions "calendar" or "schedule" or "queue" or "upcoming posts" or "what's scheduled" → Route to `/linkedin:calendar`
- Mentions "slot" or "publishing slots" or "empty slot" or "open slot" or "slot grid" or "what's in flight" or "work in progress" → Route to `/linkedin:calendar` (slot grid, vacancies, editions in flight)
- Mentions "publish" or "mark as published" or "posted today" or "just published" or "post is live" → Route to `/linkedin:calendar` (publish action)
- Mentions "plan" → Suggest `content-planner` agent
- Mentions "profile" or "topic-relevance" → Route to `/linkedin:profile`
- Mentions "not working" or "low reach" → Route to `/linkedin:analyze`
- Mentions "strategy" or "growth plan" or "authority" or "build authority" or "signature content" or "greatest hits" or "my best content" → Route to `/linkedin:strategy`
- Mentions "carousel" or "slides" or "slide deck" or "pdf post" or "swipe" or "document post" → Route to `/linkedin:carousel`
- Mentions "template" → Route to `/linkedin:quick`
- Mentions "audit" or "review strategy" → Route to `/linkedin:audit`
- Mentions "competitive" or "learn from others" → Route to `/linkedin:competitive`
- Mentions "monetize" or "revenue" → Route to `/linkedin:monetize`. **Gating:** if state-file `follower_count` < 1000, prepend: "Heads-up: monetization compounds at ~1K followers. You're at {N}. Consider `/linkedin:strategy` to plan the path there. Continuing to `/linkedin:monetize` anyway."
- Mentions "speaking" or "conference" or "collaborate" or "partner" or "CFP" or "talk proposal" or "co-author" or "joint post" → Route to `/linkedin:outreach`. **Gating:** if state-file `follower_count` < 1000, prepend: "Heads-up: outreach lands better at ~1K followers (authority signal). You're at {N}. Consider `/linkedin:strategy` first. Continuing to `/linkedin:outreach` anyway."
- Mentions "adapt" or "cross-post" → Route to `/linkedin:multiplatform`
- Mentions "import" or "CSV" or "export data" → Route to `/linkedin:import`
- Mentions "report" or "weekly numbers" → Route to `/linkedin:report`
- Mentions "engagement tips" or "5x5x5" or "first hour strategy" or "comment strategy" or "who to comment on" or "CEA method" or "whale posts" → Suggest `engagement-coach` agent
- Mentions "optimize post" or "improve draft" or "make this better" → Suggest `content-optimizer` agent
- Mentions "trending" or "what should I post about" → Suggest `trend-spotter` agent
- Mentions "my voice" or "voice profile" or "voice audit" → Suggest `voice-trainer` agent
- Mentions "is this original" or "differentiation" or "commodity content" → Suggest `differentiation-checker` agent
- Mentions "network" or "who to connect with" → Suggest `network-builder` agent
- Mentions "performance" or "weekly report" or "how did I do" or "analyze my analytics" or "interpret data" → Suggest `analytics-interpreter` agent
- Mentions "how is my post doing" or "monitor post" or "post performance" or "first hour" or "post-publish" or "boost post" or "post feedback" → Suggest `post-feedback-monitor` agent
- Mentions "A/B test" or "split test" or "test my hooks" or "compare formats" or "experiment" or "what works better" or "test variations" → Route to `/linkedin:ab-test`
- Mentions "personalization score" or "how personalized" or "asset completeness" → Route to `/linkedin:setup` (score computed by `hooks/scripts/personalization-score.mjs`)
- Mentions "milestone" or "10K goal" or "follower target" or "growth tracking" or "am I on track" or "follower progress" → Route to `/linkedin:strategy`
- Mentions "status" or "on track" → Route to `/linkedin:calendar` (plan-vs-queue diff)
- Mentions "repurpose" or "reuse" → Suggest `content-repurposer` agent
- Mentions "video" or "video script" or "film" or "record" or "talking head" or "screen recording" or "slideshow video" → Route to `/linkedin:video`
- Mentions "create" or "make something" or "what should I make" or "new content" (no specific format named) → Route to `/linkedin:create` (the Create front-door)
- Mentions "measure" or "how am I doing" or "my performance" or "performance overview" or "how are my posts doing" → Route to `/linkedin:measure` (the Measure front-door)
- Mentions "first hour" or "I just posted" or "reply loop" or "work my post" or "engage now" → Route to `/linkedin:firsthour` (the worked first-hour sprint plan — distinct from `/linkedin:calendar`'s mark-as-published action)
- Has a URL to react to → Route to `/linkedin:react`
- Has substantial content to convert → Route to `/linkedin:post`

## Reference

For full skill documentation, see:
- `skills/linkedin-studio/SKILL.md` - Complete skill with personalization settings
