linkedin-marketing

Create, optimize, and automate LinkedIn content for personal branding, lead generation, and B2B marketing. Use when someone asks to "write a LinkedIn post", "grow on LinkedIn", "LinkedIn content strategy", "LinkedIn API integration", "automate LinkedIn posting", "LinkedIn carousel", "LinkedIn analytics", or "LinkedIn outreach". Covers content creation with platform-specific formatting, API integration, analytics, and growth strategies.

26 stars

Best use case

linkedin-marketing is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Create, optimize, and automate LinkedIn content for personal branding, lead generation, and B2B marketing. Use when someone asks to "write a LinkedIn post", "grow on LinkedIn", "LinkedIn content strategy", "LinkedIn API integration", "automate LinkedIn posting", "LinkedIn carousel", "LinkedIn analytics", or "LinkedIn outreach". Covers content creation with platform-specific formatting, API integration, analytics, and growth strategies.

Teams using linkedin-marketing should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/linkedin-marketing/SKILL.md --create-dirs "https://raw.githubusercontent.com/TerminalSkills/skills/main/skills/linkedin-marketing/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/linkedin-marketing/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How linkedin-marketing Compares

Feature / Agentlinkedin-marketingStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Create, optimize, and automate LinkedIn content for personal branding, lead generation, and B2B marketing. Use when someone asks to "write a LinkedIn post", "grow on LinkedIn", "LinkedIn content strategy", "LinkedIn API integration", "automate LinkedIn posting", "LinkedIn carousel", "LinkedIn analytics", or "LinkedIn outreach". Covers content creation with platform-specific formatting, API integration, analytics, and growth strategies.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# LinkedIn Marketing

## Overview

This skill helps AI agents create high-performing LinkedIn content and integrate with the LinkedIn API. It covers platform-specific content rules, post formatting, carousel creation, API-based publishing, analytics tracking, and growth strategies tailored to LinkedIn's algorithm and audience behavior.

## Instructions

### Platform Rules & Algorithm

LinkedIn's algorithm in 2025-2026 prioritizes:

- **Dwell time** — how long people spend reading your post (long-form > short)
- **Early engagement** — first 60-90 minutes are critical for distribution
- **Comments > reactions** — comments weight 5-8x more than likes
- **Native content** — no external links in post body (kills reach 40-50%)
- **Relevance** — content shown to people interested in the topic, not just connections
- **Consistency** — 3-5 posts/week beats 1 viral post/month

What kills reach:
- External links in post body (put in comments instead)
- Editing post within first hour
- Engagement pods (LinkedIn detects and suppresses)
- Hashtag stuffing (3-5 max)
- Tagging people who don't engage back

### Content Formats & Best Practices

#### Text Posts (Highest organic reach)
```
[Hook — first 2 lines are everything, must stop the scroll]

[Line break after every 1-2 sentences for mobile readability]

[Body — story, insight, or framework. 800-1300 characters optimal]

[Each paragraph is 1-3 short sentences max]

[CTA — question to drive comments, not "like if you agree"]

[3-5 relevant hashtags at the bottom]
```

**Formatting rules:**
- First 2 lines show before "...see more" — make them irresistible
- Use line breaks aggressively — wall of text = scroll past
- 800-1300 characters is the sweet spot (long enough for dwell time, short enough to finish)
- Emojis sparingly as bullet markers (🔹, →, ✅), not decoration
- No markdown — LinkedIn doesn't render it. Use CAPS or emojis for emphasis
- End with a question to drive comments (open-ended, not yes/no)

#### Carousels (PDF documents — highest save rate)
- Upload as PDF (each page is a slide)
- Slide size: 1080x1350px (4:5 ratio) or 1080x1080px (1:1)
- 8-12 slides optimal
- First slide = hook/title (bold, minimal text)
- Last slide = CTA + profile summary
- One idea per slide, large text (24-32pt minimum)
- Brand colors and consistent design
- File size: under 100MB, max 300 pages

#### Polls (High engagement, low effort)
- 2 weeks duration optimal
- 3-4 options (not 2 — too binary)
- Add context in the post body explaining why you're asking
- Follow up with results analysis post

#### Articles & Newsletters
- Articles: 1000-2000 words, SEO-indexed by Google
- Newsletters: subscribers get email + in-app notification
- Good for long-form thought leadership
- Lower viral potential but higher authority building
- Include images every 300-400 words

#### Video
- Native video (not YouTube links)
- Vertical (9:16) or square (1:1) — NOT widescreen
- Under 2 minutes for feed (30-90s optimal)
- Captions mandatory (80%+ watch without sound)
- Hook in first 3 seconds
- Max file size: 5GB, max duration: 15 minutes

### LinkedIn API Integration

#### Authentication (OAuth 2.0)
```typescript
// LinkedIn uses OAuth 2.0 with 3-legged flow
const LINKEDIN_AUTH_URL = 'https://www.linkedin.com/oauth/v2/authorization';
const LINKEDIN_TOKEN_URL = 'https://www.linkedin.com/oauth/v2/accessToken';

// Step 1: Redirect user to authorize
const authUrl = new URL(LINKEDIN_AUTH_URL);
authUrl.searchParams.set('response_type', 'code');
authUrl.searchParams.set('client_id', process.env.LINKEDIN_CLIENT_ID);
authUrl.searchParams.set('redirect_uri', process.env.LINKEDIN_REDIRECT_URI);
authUrl.searchParams.set('scope', 'openid profile email w_member_social');
// Redirect user to authUrl.toString()

// Step 2: Exchange code for token
const tokenResponse = await fetch(LINKEDIN_TOKEN_URL, {
  method: 'POST',
  headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  body: new URLSearchParams({
    grant_type: 'authorization_code',
    code: authorizationCode,
    client_id: process.env.LINKEDIN_CLIENT_ID,
    client_secret: process.env.LINKEDIN_CLIENT_SECRET,
    redirect_uri: process.env.LINKEDIN_REDIRECT_URI,
  }),
});
const { access_token, expires_in } = await tokenResponse.json();
// Token valid for 60 days, refresh before expiry
```

#### Post Content via API
```typescript
// Get user profile URN
const profileRes = await fetch('https://api.linkedin.com/v2/userinfo', {
  headers: { Authorization: `Bearer ${access_token}` },
});
const { sub: personUrn } = await profileRes.json();

// Create a text post
const postRes = await fetch('https://api.linkedin.com/v2/posts', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${access_token}`,
    'Content-Type': 'application/json',
    'X-Restli-Protocol-Version': '2.0.0',
    'LinkedIn-Version': '202401',
  },
  body: JSON.stringify({
    author: `urn:li:person:${personUrn}`,
    commentary: 'Your post text here...',
    visibility: 'PUBLIC',
    distribution: {
      feedDistribution: 'MAIN_FEED',
      targetEntities: [],
      thirdPartyDistributionChannels: [],
    },
    lifecycleState: 'PUBLISHED',
  }),
});

// Create a post with image
// Step 1: Initialize upload
const uploadRes = await fetch('https://api.linkedin.com/v2/images?action=initializeUpload', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${access_token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    initializeUploadRequest: {
      owner: `urn:li:person:${personUrn}`,
    },
  }),
});
const { value: { uploadUrl, image: imageUrn } } = await uploadRes.json();

// Step 2: Upload image binary
await fetch(uploadUrl, {
  method: 'PUT',
  headers: { 'Content-Type': 'image/png' },
  body: imageBuffer,
});

// Step 3: Create post with image
await fetch('https://api.linkedin.com/v2/posts', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${access_token}`,
    'Content-Type': 'application/json',
    'LinkedIn-Version': '202401',
  },
  body: JSON.stringify({
    author: `urn:li:person:${personUrn}`,
    commentary: 'Post with image...',
    visibility: 'PUBLIC',
    distribution: {
      feedDistribution: 'MAIN_FEED',
    },
    content: {
      media: {
        id: imageUrn,
        title: 'Image title',
      },
    },
    lifecycleState: 'PUBLISHED',
  }),
});
```

#### Company Page Posting
```typescript
// Post as company page (requires r_organization_admin + w_organization_social)
await fetch('https://api.linkedin.com/v2/posts', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${access_token}`,
    'Content-Type': 'application/json',
    'LinkedIn-Version': '202401',
  },
  body: JSON.stringify({
    author: 'urn:li:organization:12345678',
    commentary: 'Company update...',
    visibility: 'PUBLIC',
    distribution: { feedDistribution: 'MAIN_FEED' },
    lifecycleState: 'PUBLISHED',
  }),
});
```

#### Analytics
```typescript
// Get post analytics (requires r_organization_social scope for org posts)
const analyticsRes = await fetch(
  `https://api.linkedin.com/v2/organizationalEntityShareStatistics?q=organizationalEntity&organizationalEntity=urn:li:organization:12345678&timeIntervals.timeGranularityType=DAY&timeIntervals.timeRange.start=1704067200000&timeIntervals.timeRange.end=1706745600000`,
  { headers: { Authorization: `Bearer ${access_token}` } }
);

// Personal post metrics via ugcPosts
const ugcRes = await fetch(
  `https://api.linkedin.com/v2/socialMetadata/${postUrn}`,
  { headers: { Authorization: `Bearer ${access_token}` } }
);
```

### Growth Strategy

**Posting schedule:** 3-5x/week (Tue-Thu peak engagement, 8-10 AM local time)

**Content mix:**
- 40% educational (frameworks, how-tos, lessons learned)
- 25% stories (personal experiences, behind-the-scenes)
- 20% opinion/contrarian takes (drives comments)
- 10% engagement posts (polls, questions)
- 5% promotional (product, hiring, announcements)

**Comment strategy:**
- Reply to every comment on your posts within 2 hours
- Leave 5-10 thoughtful comments/day on posts in your niche
- Comments on big accounts get you visibility to their audience
- Ask follow-up questions in comments to extend threads

## Examples

### Example 1: Write a LinkedIn post announcing a product launch
**User prompt:** "Write a LinkedIn post for me. I'm the CTO of Meridian Analytics and we just launched a real-time data pipeline product called StreamFlow that processes 2 million events per second. Target audience is engineering leaders at mid-size SaaS companies."

The agent will draft a LinkedIn text post optimized for the algorithm. The first two lines hook with: "We spent 14 months building something we couldn't find anywhere else.\n\nToday we're launching StreamFlow — a real-time data pipeline that handles 2M events/sec with sub-10ms latency." The body tells the story of the problem (batch processing delays costing customers $40K/month in stale dashboards), the solution, and early results from beta customers. It ends with an open-ended question: "What's the biggest bottleneck in your data pipeline today?" followed by 4 hashtags: #DataEngineering #RealTimeAnalytics #SaaS #ProductLaunch. The link to the product page goes in a separate first comment, not in the post body.

### Example 2: Automate posting to a LinkedIn company page via API
**User prompt:** "Build a TypeScript function that posts a weekly engineering blog summary to our LinkedIn company page (Meridian Analytics, org ID 91847362) every Monday at 9 AM EST."

The agent will create a TypeScript module that authenticates with LinkedIn OAuth 2.0 using `LINKEDIN_CLIENT_ID` and `LINKEDIN_CLIENT_SECRET` from environment variables, obtains an access token with `w_organization_social` scope, then calls `POST /v2/posts` with `author: "urn:li:organization:91847362"`, the formatted blog summary as `commentary`, `visibility: "PUBLIC"`, and `lifecycleState: "PUBLISHED"`. The function is wrapped in a cron scheduler using `node-cron` with the pattern `0 9 * * 1` (Mondays at 9 AM). It includes token refresh logic to handle the 60-day expiry and logs each post's success or failure to a `linkedin-posts.log` file.

## Guidelines

- Put links in the FIRST COMMENT, never in the post body
- Write for mobile — 60%+ of LinkedIn users are on phones
- Don't edit posts in the first hour — it resets distribution
- Use "I" not "we" for personal posts — LinkedIn is personal-first
- Tag max 3-5 people per post, only if they'll actually engage
- Post consistently at the same times — your audience learns when to expect you
- Repurpose high-performing posts after 3-4 months — new followers haven't seen them
- Save carousels as PDF at 1080x1350px for optimal mobile display

Related Skills

youtube-marketing

26
from TerminalSkills/skills

Create, optimize, and manage YouTube content for channel growth, audience building, and monetization. Use when someone asks to "grow on YouTube", "optimize YouTube videos", "YouTube SEO", "YouTube Shorts strategy", "YouTube API integration", "automate YouTube uploads", "YouTube analytics", "YouTube thumbnail", or "YouTube content strategy". Covers long-form video, Shorts, SEO, thumbnail design, YouTube Data API, analytics, monetization, and growth strategies.

twitter-x-marketing

26
from TerminalSkills/skills

Create, optimize, and automate content for Twitter/X including tweets, threads, Spaces, and API automation. Use when someone asks to "write a tweet", "create a Twitter thread", "grow on X", "Twitter API integration", "automate tweeting", "Twitter analytics", "Twitter bot", or "X content strategy". Covers platform-specific formatting, X API v2 integration, thread creation, analytics, and growth tactics.

tiktok-marketing

26
from TerminalSkills/skills

Create, optimize, and automate TikTok content for brand awareness, audience growth, and conversions. Use when someone asks to "grow on TikTok", "create TikTok content", "TikTok marketing strategy", "TikTok API integration", "automate TikTok posting", "TikTok analytics", or "TikTok for business". Covers short-form video strategy, trending sounds, TikTok Content Posting API, analytics, and growth tactics.

product-marketing-context

26
from TerminalSkills/skills

When the user wants to create or update their product marketing context document. Also use when the user mentions 'product context,' 'marketing context,' 'set up context,' 'positioning,' or wants to avoid repeating foundational information across marketing tasks. Creates `.claude/product-marketing-context.md` that other marketing skills reference.

marketing-psychology

26
from TerminalSkills/skills

When the user wants to apply psychological principles, mental models, or behavioral science to marketing. Also use when the user mentions 'psychology,' 'mental models,' 'cognitive bias,' 'persuasion,' 'behavioral science,' 'why people buy,' 'decision-making,' or 'consumer behavior.' This skill provides 70+ mental models organized for marketing application.

marketing-plan

26
from TerminalSkills/skills

Create a comprehensive marketing plan — channels, messaging, content strategy, and growth tactics. Use when: planning marketing for a product launch, creating a content calendar, designing a go-to-market strategy.

marketing-ideas

26
from TerminalSkills/skills

When the user needs marketing ideas, inspiration, or strategies for their SaaS or software product. Also use when the user asks for 'marketing ideas,' 'growth ideas,' 'how to market,' 'marketing strategies,' 'marketing tactics,' 'ways to promote,' or 'ideas to grow.' This skill provides 139 proven marketing approaches organized by category.

instagram-marketing

26
from TerminalSkills/skills

Create, optimize, and automate Instagram content including Reels, Stories, carousels, and feed posts. Use when someone asks to "grow on Instagram", "create Instagram Reels", "Instagram content strategy", "Instagram API integration", "automate Instagram posting", "Instagram analytics", or "Instagram marketing". Covers Reels-first strategy, visual content guidelines, Instagram Graph API, and growth tactics.

facebook-marketing

26
from TerminalSkills/skills

Create, optimize, and automate Facebook content for Pages, Groups, and Ads. Use when someone asks to "grow Facebook page", "create Facebook ads", "manage Facebook group", "Facebook API integration", "automate Facebook posting", "Facebook analytics", or "Facebook marketing strategy". Covers Pages, Groups, Graph API publishing, Ads Manager API, Messenger bots, and growth strategies.

zustand

26
from TerminalSkills/skills

You are an expert in Zustand, the small, fast, and scalable state management library for React. You help developers manage global state without boilerplate using Zustand's hook-based stores, selectors for performance, middleware (persist, devtools, immer), computed values, and async actions — replacing Redux complexity with a simple, un-opinionated API in under 1KB.

zoho

26
from TerminalSkills/skills

Integrate and automate Zoho products. Use when a user asks to work with Zoho CRM, Zoho Books, Zoho Desk, Zoho Projects, Zoho Mail, or Zoho Creator, build custom integrations via Zoho APIs, automate workflows with Deluge scripting, sync data between Zoho apps and external systems, manage leads and deals, automate invoicing, build custom Zoho Creator apps, set up webhooks, or manage Zoho organization settings. Covers Zoho CRM, Books, Desk, Projects, Creator, and cross-product integrations.

zod

26
from TerminalSkills/skills

You are an expert in Zod, the TypeScript-first schema declaration and validation library. You help developers define schemas that validate data at runtime AND infer TypeScript types at compile time — eliminating the need to write types and validators separately. Used for API input validation, form validation, environment variables, config files, and any data boundary.