xs.dev

LinkedIn launch

Takes a finished article with its media and gets it onto LinkedIn: a feed post with the video, the full article as a draft, and a separate post for each other channel.

Status
trying
Updated
17 November 2026
Needs
Claude Code, Claude in Chrome, Python 3
Reading
2 min read
Share

What it does

This is a Claude skill for the last step of writing an article: getting it onto LinkedIn. I point it at a folder that holds the article as Markdown, a cover image, the animations as GIFs and one video. It then works in three steps.

  1. It writes a short feed post from the article and posts it with the video.
  2. It builds the full LinkedIn article as a draft: the cover, the title, the formatted text, and each GIF in its place with its caption.
  3. It writes a separate post for each other channel, so the same text is never pasted everywhere.

Nothing goes public without my yes. The skill shows me the exact text first, every time, for each item.

When I use it

When an article is finished and its media pack is ready. I say “launch this” in Claude Code, or I point it at the folder.

How it works

The skill is two files. SKILL.md is the instruction Claude follows. md2chunks.py is a small Python script that needs nothing installed.

This is the folder the skill expects:

<pack>/
  article-linkedin.md
  cover/*.png
  gif/NN-*.gif
  mp4/00-hero.mp4

The article file marks where each animation goes with a line like [ANIMATION 1: ...], followed by a line that starts with Caption:. The script turns the Markdown into HTML and cuts it into chunks at those markers. It also collects the captions.

Claude then works through the LinkedIn article editor in the browser. It pastes one chunk, uploads one GIF, types its caption, and goes on to the next chunk. The skill waits until each upload has finished before it continues. A slow upload would otherwise put the caption and the text in the wrong place.

Before it asks me to publish, it checks that the GIFs are really animated and not stills.

The browser work is done with Claude in Chrome, in a browser where I am already signed in. The skill never creates accounts and never types passwords.

Example run

The article I launched with it is Let the Code Do the Legwork. It has a cover and eight animations. It is on LinkedIn as an article, and the same text is a note on this site.

The part that can be shown here is the script. This is a small sample file in the format the skill expects:

# A title

[COVER: the cover image]

An opening paragraph with one **bold** word.

## First section

Some text.

[ANIMATION 1: the first animation]
Caption: What the first animation shows.

## Second section

- one point
- another point

This is the command:

python3 -I md2chunks.py article-linkedin.md chunks.json

It prints one line: the number of chunks, the number of captions, and the length of each chunk.

2 1 [103, 72]

And this is what it writes to chunks.json:

{"chunks": ["<p>An opening paragraph with one <strong>bold</strong> word.</p><h1>First section</h1><p>Some text.</p>", "<h1>Second section</h1><ul><li>one point</li><li>another point</li></ul>"], "captions": ["What the first animation shows."]}

Two chunks and one caption. Claude pastes the first chunk, uploads the first GIF, types the caption, and pastes the second chunk.

Install

One line puts the files where Claude Code looks for skills. Claude then finds the skill by itself.

Terminal
mkdir -p ~/.claude/skills/linkedin-launch && cd ~/.claude/skills/linkedin-launch && curl -fsSL -O https://xs.dev/skills/linkedin-launch/SKILL.md -O https://xs.dev/skills/linkedin-launch/md2chunks.py

It makes the folder ~/.claude/skills/linkedin-launch and downloads the 2 files below into it. Read them first if you like: they are plain text.

Files

These are the files the line above downloads. Names of people and private paths are taken out; the skill works the same.

  • SKILL.md73 lines, 6.2 KB
    Contents
    ---
    name: linkedin-launch
    description: "Launch a finished article on LinkedIn end to end: condense it into a feed post with the hero video, build the full LinkedIn article draft (cover, title, formatted text, GIFs with captions), then prepare a separate post for each channel to spread it. Use when the user says \"launch this\", \"publish this on LinkedIn\", or points at a media pack folder."
    argument-hint: "[path to media pack folder]"
    ---
    
    # LinkedIn launch
    
    Takes a media pack folder (default: the current folder) and launches it on LinkedIn.
    The publishing rule: **nothing goes public without the user's explicit "yes" in chat for that specific item.** Show the exact text first, every time.
    
    ## Expected folder layout
    
    ```
    <pack>/
      article-linkedin.md     # "# Title", sections with ##/###, [COVER: ...], [ANIMATION n: ...] + "Caption: ..." lines
      cover/*.png             # 1920x1080 article cover
      gif/NN-*.gif            # in-article animations, in marker order
      mp4/00-hero.mp4         # feed video
    ```
    
    If something is missing, say what and continue with what exists.
    
    ## Step 1: Feed post (video)
    
    1. Read `article-linkedin.md` in full.
    2. Write `post-linkedin.txt`: plain text (no markdown), under 3,000 characters, strongest idea in the first two lines, short paragraphs, → bullets for evidence, numbered list for "why it matters", one line on how to try it, closing question, 3 to 5 hashtags. No links in the post body.
    3. Show it to the user and ask: post now, edit, or skip. Only on "yes":
       - Claude in Chrome → linkedin.com/feed → click **Video** → `file_upload` mp4/00-hero.mp4 to the hidden file input → click the pencil (Edit) on the video → Thumbnail → upload cover/00-cover.png (never rely on the first frame, it can be black) → Next → click the text box → type the text → Post → wait until "Post successful".
    
    ## Step 2: Article draft
    
    1. Convert the article: `python3 -I ~/.claude/skills/linkedin-launch/md2chunks.py <pack>/article-linkedin.md <scratchpad>/chunks.json`
       It returns one HTML chunk per section between animations, plus the captions. `##` becomes `<h1>` (LinkedIn "Heading 1"), `###` stays `<h3>`.
    2. Open https://www.linkedin.com/article/new/ and dismiss any welcome dialog.
    3. Before clicking any upload button, patch the file picker so no native dialog opens:
       ```js
       window.__ccOrig = window.__ccOrig || HTMLInputElement.prototype.click;
       HTMLInputElement.prototype.click = function(){ if(this.type==='file'){ if(!this.isConnected){this.style.display='none';document.body.appendChild(this);} return;} return window.__ccOrig.call(this); };
       ```
    4. Cover: click "Upload from computer" → `find` the file input → `file_upload` the cover → Next. Title: click the Title box and type the `# ` heading.
    5. Install the helpers (editor is ProseMirror, and a synthetic paste keeps headings, bold, links, lists and code):
       ```js
       window.__paste = h => { const ed=document.querySelector('.ProseMirror'); ed.focus(); const dt=new DataTransfer(); dt.setData('text/html',h); dt.setData('text/plain',h.replace(/<[^>]+>/g,' ')); ed.dispatchEvent(new ClipboardEvent('paste',{clipboardData:dt,bubbles:true,cancelable:true})); };
       window.__toEnd = async () => { const ed=document.querySelector('.ProseMirror'), p=ed.lastElementChild; ed.focus(); const r=document.createRange(); r.setStart(p,0); r.collapse(true); const s=getSelection(); s.removeAllRanges(); s.addRange(r); await new Promise(r=>setTimeout(r,200)); };
       window.__next = async () => { for(let i=0;i<40;i++){ const b=[...document.querySelectorAll('[role=dialog] button')].find(b=>b.textContent.trim()==='Next'); if(b&&!b.disabled){b.click();return true;} await new Promise(r=>setTimeout(r,500)); } return false; };
       window.__waitFig = async n => { for(let i=0;i<40;i++){ const ed=document.querySelector('.ProseMirror'); if(ed.querySelectorAll('figure').length>n && ed.lastElementChild.tagName==='P' && ed.lastElementChild.textContent==='') return true; await new Promise(r=>setTimeout(r,500)); } return false; };
       window.__cap = () => { const t=[...document.querySelectorAll('.ProseMirror textarea.article-editor-figure-caption')].pop(); t.scrollIntoView({block:'center'}); t.focus(); return true; };
       ```
    6. Click into the body and `__paste(chunk[0])`. Then for each GIF i (1..n):
       - click the toolbar image button → `find` "file input" → `file_upload` gif i
       - `const n=document.querySelectorAll('.ProseMirror figure').length; await __next(); await __waitFig(n); __cap()`. **Never continue until `__waitFig` returns true.** A slow upload otherwise puts the caption and text in the wrong place.
       - type caption i with the `computer` type action
       - `await __toEnd(); __paste(chunk[i])`
       - verify with the list of top level tag names: each FIGURE must come right after its section.
    7. GIF check: open Manage → Preview and fetch each image. Count `0x21 0xF9` byte pairs (frames). More than 1 means animated. If they're stills, stop and offer the MP4s instead.
    8. Show the user the preview and ask before clicking **Publish**. On the publish screen, the share text must use a **different hook** from the video post (personal story or "what's in the full piece"), not the same opening. Suggest publishing a day after the video post.
    
    ## Step 3: Spread it
    
    1. Write `distribution-kit.md` in the pack, with a separate version per channel (never the same text everywhere):
       - LinkedIn: link comment on the video post (check first whether the user already posted one)
       - Reddit: a "here's what I found" post with numbers in the style of r/ClaudeAI, plus a post with a business angle for r/AI_Agents. A summary is required, not a bare link
       - X/Bluesky thread with one GIF per post
       - Hacker News title + fallback to the primary source
       - Newsletter tip (TLDR AI, Ben's Bites, The Rundown)
       - Medium import steps (keeps LinkedIn as the canonical source)
    2. Ask which channel to do next. Post only with a "yes" for each item, in a site where the user is already signed in. Never create accounts or type passwords. Draft newsletter emails in Gmail rather than sending them.
    3. Recommend spacing channels over a few days.
    
    ## Wrap up
    
    Report what is live (with links), what is drafted, and the current impressions and reactions from the activity page.
    

    Raw file

  • md2chunks.py43 lines, 1.5 KB
    Contents
    import re, json, sys, html
    
    src = open(sys.argv[1]).read().splitlines()
    
    def inline(t):
        t = html.escape(t, quote=False)
        t = re.sub(r'\[([^\]]+)\]\(([^)]+)\)', r'<a href="\2">\1</a>', t)
        t = re.sub(r'\*\*(.+?)\*\*', r'<strong>\1</strong>', t)
        t = re.sub(r'`([^`]+)`', r'<code>\1</code>', t)
        t = re.sub(r'(?<![\w*])\*([^*]+)\*(?!\w)', r'<em>\1</em>', t)
        return t
    
    chunks, captions, cur = [], [], []
    lst = None
    def close():
        global lst
        if lst: cur.append('</%s>' % lst); lst = None
    
    i = 0
    for line in src:
        s = line.strip()
        if s.startswith('# ') or s.startswith('[COVER'):
            continue
        m = re.match(r'\[ANIMATION (\d+)', s)
        if m:
            close(); chunks.append(''.join(cur)); cur = []; continue
        if s.startswith('Caption:'):
            captions.append(s[len('Caption:'):].strip()); continue
        if not s:
            close(); continue
        if s.startswith('### '):
            close(); cur.append('<h3>%s</h3>' % inline(s[4:])); continue
        if s.startswith('## '):
            close(); cur.append('<h1>%s</h1>' % inline(s[3:])); continue
        mb = re.match(r'- (.*)', s); mn = re.match(r'\d+\. (.*)', s)
        if mb or mn:
            tag = 'ul' if mb else 'ol'
            if lst != tag: close(); cur.append('<%s>' % tag); lst = tag
            cur.append('<li>%s</li>' % inline((mb or mn).group(1))); continue
        close(); cur.append('<p>%s</p>' % inline(s))
    close(); chunks.append(''.join(cur))
    json.dump({'chunks': chunks, 'captions': captions}, open(sys.argv[2], 'w'))
    print(len(chunks), len(captions), [len(c) for c in chunks])
    

    Raw file

All skills

Contents

  1. 01What it does
  2. 02When I use it
  3. 03How it works
  4. 04Example run
  5. 05Install
  6. 06Files

Contact

    ↑↓ to moveEnter to open/ opens this anywhereEsc for the resultsEsc twice to close