Skip to content

sergebulaev/linkedin-skills / .codex-marketplace/linkedin-skills/skills/linkedin-reply-handler

linkedin-reply-handler

Verified

Draft a reply to one LinkedIn comment from its URL, or sweep a whole thread from just the post URL and draft a reply to every comment worth answering, in one batch. Use for replying to a comment, following an author reply, or clearing all comments on a post. Resolves the correct parentComment (LinkedIn flattens threads to 2 levels), filters low-value comments before a sweep, and posts via Publora on approval. Not for top-level comments (use linkedin-comment-drafter).

FileKindSize
SKILL.mdskill md14.4 KB
references/examples.mdmarkdown1.3 KB
references/filtering-rules.mdmarkdown2.6 KB
references/reply-templates.mdmarkdown2.2 KB
references/threading-rules.mdmarkdown2.9 KB

references/threading-rules.md

View on GitHub
# LinkedIn Comment Threading Rules

## Two-level flattening

LinkedIn's UI shows replies two levels deep. Every reply, no matter how many logical turns into a conversation, is stored with `parentComment` pointing to the TOP-level comment.

```
Post (urn:li:activity:P)
│
├─ Comment A (id: 111)             ← top-level
│    parentComment: none
│    URN: urn:li:comment:(urn:li:activity:P, 111)
│
│  ├─ Reply B (id: 222)             ← 2nd-level
│  │    parentComment: urn:li:comment:(urn:li:activity:P, 111)
│  │
│  └─ Reply C (id: 333)             ← STILL 2nd-level (under Comment A)
│       parentComment: urn:li:comment:(urn:li:activity:P, 111)
│       (NOT under Reply B, even if logically C replies to B)
│
└─ Comment D (id: 444)             ← top-level
     parentComment: none
```

## Posting rule

When calling `POST /linkedin-comments` with `parentComment`:
- If you're replying to a top-level comment → `parentComment` = that comment's URN
- If you're replying to a 2nd-level reply → `parentComment` = the TOP-level comment's URN (walk up the tree)
- If `parentComment` is omitted, the comment posts as top-level

## Why this matters

Wrong parentComment URN causes one of these:
- 400 Bad Request (some posts reject it outright)
- Comment silently posted under the wrong parent (user sees it in the wrong place)
- Comment gets orphaned if the 2nd-level URN is rejected

## Deriving the TOP-level comment URN

When given a 2nd-level reply's URN, fetch the post's comment tree and walk up:

```python
def find_top_comment_urn(post_urn: str, comment_id: str, post_comments: list) -> str:
    for top in post_comments:  # each element is a top-level comment dict
        if top["id"] == comment_id:
            return f"urn:li:comment:({post_urn},{comment_id})"
        for reply in top.get("replies", []):
            if reply["id"] == comment_id:
                return f"urn:li:comment:({post_urn},{top['id']})"
    raise ValueError("Comment not found in tree")
```

## URL formats the skill accepts

**Direct top-level comment permalink:**
```
https://www.linkedin.com/feed/update/urn:li:activity:P?commentUrn=urn%3Ali%3Acomment%3A%28activity%3AP%2C111%29
```

**Reply permalink (notice `replyUrn` query):**
```
https://www.linkedin.com/feed/update/urn:li:activity:P?commentUrn=urn%3Ali%3Acomment%3A%28activity%3AP%2C111%29&replyUrn=urn%3Ali%3Acomment%3A%28activity%3AP%2C222%29
```

When `replyUrn` is present, that's the specific comment being replied to (for reactions). The `commentUrn` is already the top-level parent.

## Reaction targets

Reactions can be placed on:
- The post itself (`post_urn` passed to `create_reaction`)
- Any comment or reply (pass the comment's URN as `post_urn` — yes, confusingly named)

Default flow: react on the specific comment being replied to. Never skip the reaction — a pure reply with no reaction reads as transactional.
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 197kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall