Install
$ agentstack add skill-librefang-librefang-registry-linkedin ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ● Network access Used
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
LinkedIn Management Expert Knowledge
LinkedIn API Reference
Authentication
LinkedIn API uses OAuth 2.0 with bearer tokens.
Bearer Token:
Authorization: Bearer $LINKEDIN_ACCESS_TOKEN
Core Endpoints
Get authenticated user info:
curl -s -H "Authorization: Bearer $LINKEDIN_ACCESS_TOKEN" \
-H "LinkedIn-Version: 202405" \
"https://api.linkedin.com/rest/userinfo"
Create a text post (Posts API):
curl -s -X POST "https://api.linkedin.com/rest/posts" \
-H "Authorization: Bearer $LINKEDIN_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "LinkedIn-Version: 202405" \
-d '{
"author": "urn:li:person:MEMBER_ID",
"lifecycleState": "PUBLISHED",
"commentary": "Your post content here",
"visibility": "PUBLIC",
"distribution": {
"feedDistribution": "MAIN_FEED"
}
}'
Comment on a post:
curl -s -X POST "https://api.linkedin.com/rest/socialActions/URN/comments" \
-H "Authorization: Bearer $LINKEDIN_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "LinkedIn-Version: 202405" \
-d '{
"actor": "urn:li:person:MEMBER_ID",
"message": {"text": "Your comment here"}
}'
Like a post:
curl -s -X POST "https://api.linkedin.com/rest/socialActions/URN/likes" \
-H "Authorization: Bearer $LINKEDIN_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "LinkedIn-Version: 202405" \
-d '{
"actor": "urn:li:person:MEMBER_ID"
}'
Rate Limits
| Endpoint | Limit | Window | |----------|-------|--------| | Posts | 25 posts | 24 hours | | Comments | 10 comments | 1 minute | | Likes | 20 likes | 1 minute | | API calls (general) | 100 requests | 1 day |
LinkedIn Content Strategy
The LinkedIn Algorithm (2024-2025)
Key factors that affect reach:
- Dwell time: How long people spend reading your post. LinkedIn tracks both "read dwell" (time spent on post text) and "click dwell" (time spent after clicking "see more"). Longer posts that hold attention get amplified. Ideal: 800-1300 characters that reward reading to the end.
- Early engagement: Comments in the first 60-90 minutes are weighted heavily. The algorithm decides distribution tiers within 2 hours of posting.
- Meaningful comments: Long comments (3+ sentences) signal quality far more than likes. One thoughtful comment is worth ~10 likes in the algorithm. Reply-to-reply threads (nested comments) further boost the post.
- No external links: Posts with links get 40-50% less reach. The algorithm deprioritizes anything that drives users off-platform.
- Personal stories: Narrative content outperforms promotional content. The algorithm favors "knowledge and advice" posts from individuals over brand content.
Engagement signal weighting (approximate relative impact on distribution): | Signal | Relative Weight | Why | |--------|----------------|-----| | Comment (3+ sentences) | 10x | Strongest indicator of quality content | | Repost with commentary | 8x | Shows content worth sharing and adding to | | Save/bookmark | 6x | High-intent signal — user wants to revisit | | Reply in comment thread | 5x | Sustained conversation signals value | | Share (plain repost) | 4x | Distribution signal but lower intent | | Reaction (any emoji) | 1x | Baseline engagement, lowest weight | | Click "see more" | 0.5x | Curiosity signal, but no follow-through guarantee |
Algorithm penalty signals:
- Editing a post within 10 minutes of publishing can reset distribution
- Deleting and reposting gets flagged and suppressed
- Posting more than once per 18 hours splits your audience
- Engagement pods (coordinated likes/comments) are detected and penalized
- Hashtag stuffing (>5) triggers spam signals
Content Pillars
Define 3-4 content pillars:
Example for a tech leader:
Pillar 1: Engineering Leadership (40%)
Pillar 2: Industry Trends & Analysis (30%)
Pillar 3: Career Growth & Mentoring (20%)
Pillar 4: Personal Lessons (10%)
Post Formats That Work
| Format | Avg Engagement | Best For | |--------|---------------|----------| | Personal story with lesson | High | Connection, authenticity | | Contrarian take | High | Discussion, visibility | | Step-by-step guide | Medium-High | Authority, saves | | Data + insight | Medium | Credibility | | Question/poll | Medium | Engagement | | Industry news + analysis | Medium | Thought leadership |
Optimal Posting Times (UTC-based)
| Day | Best Times | Why | |-----|-----------|-----| | Tuesday | 8-10 AM | Peak professional engagement | | Wednesday | 8-10 AM | Mid-week content consumption | | Thursday | 8-10 AM, 12 PM | Second-best engagement day | | Monday | 8-10 AM | Start of work week | | Friday | 8-9 AM only | Engagement drops after morning | | Weekend | Avoid | 60-70% lower engagement |
Post Writing Best Practices
The Hook (First 2 Lines)
The first 2 lines appear before the "see more" fold. They must compel a click.
Hooks that work:
- Bold statement: "I fired my best employee last week. Here's why it was the right call."
- Surprising data: "Only 3% of engineering managers do this. It changes everything."
- Confession: "I made a $500K mistake in my first year as CTO."
- Question: "Why do 90% of digital transformations fail?"
- Contrarian: "Unpopular opinion: Stand-ups are a waste of time."
Writing Rules
- One idea per post -- don't try to cover everything
- Short paragraphs -- 1-2 sentences max, lots of white space
- Use line breaks -- make it scannable
- End with a question -- drives comments which boost reach
- No links in the post body -- put links in the first comment
- 3-5 relevant hashtags -- at the bottom of the post
- 1000-1300 characters -- sweet spot for engagement
- Be authentic -- personal stories outperform corporate speak
Comment Strategy
When commenting on others' posts:
- Add a new perspective or data point
- Share a relevant personal experience
- Ask a thoughtful follow-up question
- Keep comments 2-4 sentences (meaningful but concise)
- Avoid generic comments ("Great post!", "Thanks for sharing!")
Networking Best Practices
Connection Requests
- Always add a personal note (not the default message)
- Reference something specific (their content, mutual connection, shared interest)
- Keep it under 300 characters
- Don't pitch in the connection request
Relationship Building
- Consistently engage with connections' content before asking for anything
- Share others' content with genuine commentary
- Celebrate connections' achievements publicly
- Offer help or resources without expecting anything in return
Safety & Compliance
Content Guidelines
NEVER post:
- Confidential business information
- Discriminatory or offensive content
- False credentials or experience claims
- Defamatory statements about competitors or individuals
- Content that violates LinkedIn's Professional Community Policies
- Misleading data or fabricated statistics
Content Moderation Rules
Before posting any content, classify it:
Auto-REJECT (never post):
- Content containing hate speech, discrimination, or harassment
- Unverified claims about competitors or individuals
- Confidential or proprietary business information
- Content that could be interpreted as financial or legal advice
- Anything with profanity or inappropriate language
- Political or religious debate content
Flag for REVIEW (queue for human approval):
- Controversial industry opinions or contrarian takes
- Content mentioning specific companies or individuals by name
- Posts discussing salary, compensation, or workplace issues
- Content referencing current news events
- Posts with strong emotional tone or personal vulnerability
Safe to POST (can auto-publish if approval_mode is off):
- Educational how-to content and professional tips
- Industry trend analysis with cited sources
- Career development advice and frameworks
- Engagement posts (professional questions, polls)
- Celebration of team or industry achievements
Professional Standards
- Maintain professional tone even in casual posts
- Fact-check all claims and statistics
- Credit sources and tag collaborators
- Disclose affiliations when discussing products or services
- Respect intellectual property and copyright
Crisis Management for Negative Engagement
When a post receives significant negative attention (hostile comments, public disagreements, misinterpretation):
Severity levels and response:
| Level | Indicators | Action | |-------|-----------|--------| | Low | 1-2 disagreeing comments, professional tone | Respond thoughtfully; treat as healthy discussion | | Medium | Multiple negative comments, some personal attacks, post being quote-shared critically | Pause auto-engagement; draft a measured clarification comment; queue for user review | | High | Viral negative attention, accusations of misinformation, brand/employer reputation risk | Alert user immediately via eventpublish "linkedincrisis_alert"; do NOT auto-respond; prepare a response draft for human approval |
Response playbook:
- Never delete a post that has active engagement -- it signals guilt and people screenshot first
- Never argue in comment threads -- one measured response per critic, then disengage
- Acknowledge valid criticism gracefully: "That's a fair point -- I should have been clearer about [X]. Here's what I meant: ..."
- For factual errors in your post: Add a correction comment pinned at the top: "Update: [correction]. Thanks to @Name for pointing this out."
- For personal attacks: Do not respond. Hide the comment (LinkedIn allows this) and move on. If persistent, report to LinkedIn.
- For misinterpretation at scale: Write a follow-up post (not an edit) that clarifies the original point without being defensive
After a crisis: Log the incident in memory, note what triggered it, and update content moderation rules to prevent recurrence.
Advanced API Patterns
Image Post Creation (Media Upload Flow)
Posting an image requires a 3-step flow: register upload, upload binary, then create post.
Step 1 -- Register the upload:
curl -s -X POST "https://api.linkedin.com/rest/images?action=initializeUpload" \
-H "Authorization: Bearer $LINKEDIN_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "LinkedIn-Version: 202405" \
-d '{
"initializeUploadRequest": {
"owner": "urn:li:person:MEMBER_ID"
}
}'
Response contains uploadUrl and image URN (e.g., urn:li:image:C4E...).
Step 2 -- Upload the binary:
curl -s -X PUT "$UPLOAD_URL" \
-H "Authorization: Bearer $LINKEDIN_ACCESS_TOKEN" \
-H "Content-Type: image/png" \
--data-binary "@/path/to/image.png"
Step 3 -- Create post with image:
curl -s -X POST "https://api.linkedin.com/rest/posts" \
-H "Authorization: Bearer $LINKEDIN_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "LinkedIn-Version: 202405" \
-d '{
"author": "urn:li:person:MEMBER_ID",
"lifecycleState": "PUBLISHED",
"commentary": "Check out our Q3 results!",
"visibility": "PUBLIC",
"distribution": {"feedDistribution": "MAIN_FEED"},
"content": {
"media": {
"id": "urn:li:image:IMAGE_URN",
"title": "Q3 Performance Summary"
}
}
}'
Document Post Creation (PDF/Carousel)
LinkedIn "document posts" (carousels) follow the same register-upload-post pattern but use the documents API.
Register document upload:
curl -s -X POST "https://api.linkedin.com/rest/documents?action=initializeUpload" \
-H "Authorization: Bearer $LINKEDIN_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "LinkedIn-Version: 202405" \
-d '{
"initializeUploadRequest": {
"owner": "urn:li:person:MEMBER_ID"
}
}'
Upload the PDF and create post (same pattern as image -- PUT binary, then POST with content.media.id set to the document URN).
Article Publishing via API
Create an article post (link article hosted externally):
curl -s -X POST "https://api.linkedin.com/rest/posts" \
-H "Authorization: Bearer $LINKEDIN_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "LinkedIn-Version: 202405" \
-d '{
"author": "urn:li:person:MEMBER_ID",
"lifecycleState": "PUBLISHED",
"commentary": "I wrote about why most engineering teams get incident response wrong.\n\nKey insight: the 5-minute rule changes everything.",
"visibility": "PUBLIC",
"distribution": {"feedDistribution": "MAIN_FEED"},
"content": {
"article": {
"source": "https://yourblog.com/incident-response",
"title": "The 5-Minute Rule for Incident Response",
"description": "A practical framework for engineering teams"
}
}
}'
> Note: Article-link posts get reduced reach vs native text posts. Prefer putting links in the first comment.
Analytics Endpoints
Get post statistics (organic):
curl -s -H "Authorization: Bearer $LINKEDIN_ACCESS_TOKEN" \
-H "LinkedIn-Version: 202405" \
"https://api.linkedin.com/rest/organizationalEntityShareStatistics?q=organizationalEntity&organizationalEntity=urn:li:organization:ORG_ID&timeIntervals.timeGranularityType=DAY&timeIntervals.timeRange.start=1704067200000&timeIntervals.timeRange.end=1706745600000"
Get share statistics for a specific post:
curl -s -H "Authorization: Bearer $LINKEDIN_ACCESS_TOKEN" \
-H "LinkedIn-Version: 202405" \
"https://api.linkedin.com/rest/organizationalEntityShareStatistics?q=organizationalEntity&organizationalEntity=urn:li:organization:ORG_ID&shares=urn:li:share:SHARE_ID"
Response fields: | Field | Description | |-------|-------------| | totalShareStatistics.impressionCount | Total times the post appeared in feeds | | totalShareStatistics.uniqueImpressionsCount | Unique viewers | | totalShareStatistics.clickCount | Total clicks (content + read more) | | totalShareStatistics.likeCount | Total likes/reactions | | totalShareStatistics.commentCount | Total comments | | totalShareStatistics.shareCount | Total reposts | | totalShareStatistics.engagement | Engagement rate (decimal) |
Get follower statistics (organization pages):
curl -s -H "Authorization: Bearer $LINKEDIN_ACCESS_TOKEN" \
-H "LinkedIn-Version: 202405" \
"https://api.linkedin.com/rest/organizationalEntityFollowerStatistics?q=organizationalEntity&organizationalEntity=urn:li:organization:ORG_ID"
Webhook / Notification Patterns
LinkedIn does not offer real-time webhooks for most events. Use polling instead:
Polling strategy:
- Post engagement: Poll every 15 minutes for first 4 hours after posting
- Mentions/comments: Poll every 5 minutes during engagement_hours
- Follower counts: Poll once per day
- Analytics: Poll once per day (data lags 24-48 hours)
Error Handling and Rate Limit Retry
Rate limit response headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1706745600
HTTP 429 response:
{"status": 429, "message": "Resource level throttle limit..."}
Retry strategy:
1. On HTTP 429: Read X-RateLimit-Reset header
2. Calculate wait_seconds = reset_timestamp - current_timestamp
3. Sleep for wait_seconds + 1 (buffer)
4. Retry the request (max 3 retries)
5. On 3 consecutive 429s: back off for 15 minutes
On HTTP 5xx (server error):
1. Retry with exponential backoff: 1s, 2s, 4s
2. Max 3 retries
3. Log failure and queue for later retry
On HTTP 401 (expired token):
1. Trigger OAuth 2.0 refresh flow
2. Update stored token
3. Retry original request once
Content Calendar Template
Monthly Content Planning Framework
Organize content around weekly themes that rotate through your content pillars.
MONTH: [Month Year]
THEME ROTATION:
Week 1: [Pillar
…
## Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- **Author:** [librefang](https://github.com/librefang)
- **Source:** [librefang/librefang-registry](https://github.com/librefang/librefang-registry)
- **License:** MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.