From linkai
Use when the user wants to draft and publish a post on LinkedIn. Interviews them, drafts in their voice, and publishes on approval. Handles first-time LinkedIn app + OAuth setup automatically.
How this skill is triggered — by the user, by Claude, or both
Slash command
/linkai:linkedin-postingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Draft and publish LinkedIn posts from inside Claude Code. This skill walks a user from "I want to post about X" to a published post on their feed, including first-time authentication.
Draft and publish LinkedIn posts from inside Claude Code. This skill walks a user from "I want to post about X" to a published post on their feed, including first-time authentication.
Trigger on any of: "post this to LinkedIn", "draft a LinkedIn post", "share on LinkedIn", "post on my feed about …". Not for fetching posts or analytics — this skill only publishes.
┌──────────────────────────────────────────┐
│ 1. Check auth status │
│ python scripts/linkai_auth.py status │
└──────────────────────────────────────────┘
│
┌─────────────┼─────────────┬──────────────────┐
▼ ▼ ▼ ▼
no creds missing token expired token valid
│ │ │ │
▼ ▼ ▼ │
ONBOARDING LOGIN LOGIN │
(below) (below) (below) │
└─────────────┴─────────────┴──────────────────┘
▼
┌──────────────────┐
│ 2. Interview │
│ 3. Draft │
│ 4. Revise │
│ 5. Publish │
└──────────────────┘
Before anything else, run the status check. The scripts live in scripts/ relative to this SKILL.md — invoke them with their absolute path via Bash.
python "<skill-dir>/scripts/linkai_auth.py" status
The output tells you exactly which branch to take. Do not start onboarding unless the output says "No credentials found". Running onboarding on a user who has already set things up wastes their time.
status output | What it means | What to do |
|---|---|---|
No credentials found at … | First-time user | Full onboarding (section below) |
App credentials: present + Access token: not yet issued | Dev app exists, never logged in | Skip to Step B: LinkedIn login |
Access token: EXPIRED | Token issued >60 days ago | Skip to Step B: LinkedIn login |
Access token: valid (N days remaining) | All good | Skip to the posting interview |
Browser-driven and paced. Do not dump every step on the user at once. Open the relevant URL, wait for their confirmation, move to the next step. Use this Bash one-liner to open a URL in their browser on any OS:
python -c "import webbrowser; webbrowser.open('<url>')"
Before the walkthrough, ask one question: "Do you already have a LinkedIn developer app you'd like to reuse, or should we create a new one together?"
http://localhost:8765 in its Authorized redirect URLs. Skip to Step A: Collect credentials, but first remind them to add the redirect URI if it's not already there and open their app list with:
python -c "import webbrowser; webbrowser.open('https://www.linkedin.com/developers/apps')"
Step 1 — open the new-app page.
python -c "import webbrowser; webbrowser.open('https://www.linkedin.com/developers/apps/new')"
Tell them: "I just opened the LinkedIn Create app form. Fill in App name (anything, e.g. 'LinkAI for '), pick or create a LinkedIn Page (if you don't have one, click the inline Create a new LinkedIn Page link — a bare personal-brand page is fine; the app uses it for admin only, posts still go to your personal feed), add any Privacy policy URL (e.g. this repo's README link), upload any small image for App logo, then click Create app. Tell me when you're on the app's detail page."
Wait for confirmation. If they hit a verification prompt or get stuck, help them through it — don't move on.
Step 2 — attach the two products. Once they're in the app, tell them to open the Products tab. Ask them to confirm they're on it, then:
Wait until both show "Added".
Step 3 — add the redirect URI. Tell them to open the Auth tab. Under OAuth 2.0 settings → Authorized redirect URLs for your app, they click the edit pencil and add exactly:
http://localhost:8765
No trailing slash, no www, no https. Save.
Step 4 — grab Client ID and Client Secret. Still on the Auth tab: tell them the Client ID and Primary Client Secret are right at the top of the page. Ask them to paste both into the chat.
Once you have Client ID and Client Secret (from either the reuse or create path), run:
python "<skill-dir>/scripts/linkai_auth.py" setup --client-id "<id>" --client-secret "<secret>"
Expect: Saved app credentials to ~/.linkai/credentials.json.
python "<skill-dir>/scripts/linkai_auth.py" login
The browser opens, the user clicks Allow, the browser lands on a "LinkAI is authorized" page, and the CLI prints Logged in as <Name>. Relay the CLI output if anything goes wrong — don't silently retry.
When this succeeds, transition to the posting interview.
When auth is good, run the four steps in order. Do not short-circuit.
python "<skill-dir>/scripts/linkai_post.py" --text "<final post text>"
The CLI prints a URL like https://www.linkedin.com/feed/update/urn:li:share:…/. Share it with the user.
login once and retries. No action needed.login) is holding the port. Ask the user to close other LinkAI auth windows or restart their terminal, then retry.SETUP.md and verify Share on LinkedIn is attached.~/.linkai/credentials.json (permissioned 0600 on Unix). Never print the file's contents in chat.Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub hemanthkrishna1298/linkai --plugin linkai