sergebulaev/linkedin-linkedin-reply-handler
Draft a reply to a specific existing LinkedIn comment from its URL. Use when the user wants to reply to a comment on any post, or follow up after an author replied to them. Parses the commentUrn, resolves the correct parentComment target (LinkedIn flattens threads to 2 levels), and posts via Publora on approval. Not for top-level comments (use linkedin-comment-drafter).
This is a copy. The original lives at sergebulaev/linkedin-reply-handler.
npx skills add https://github.com/sergebulaev/linkedin-skills --skill linkedin-reply-handler
Drafts a reply to a specific LinkedIn comment. Correctly handles LinkedIn's 2-level thread flattening: if you're replying to a reply, the Publora API needs the TOP-level comment URN as parentComment, not the reply's URN.
?commentUrn=...) and says "reply to this"A LinkedIn URL containing commentUrn=urn:li:comment:(activity:POST,COMMENT_ID) — either the direct comment permalink or a feed URL with the query fragment.
Voice profile first (all drafts). If ../../references/voice-profile.md has filled: yes, load it and match the user's voice fingerprint, hard rules, and CTA/link style throughout. If it is not filled, mention once that linkedin-humanizer --mode profile can learn their voice from a few posts, then proceed with the generic voice rules.
lib.url_parser.parse_linkedin_url returns post_urn, comment_id, comment_urn.APIFY_TOKEN is set, call lib.ApifyClient.fetch_post_comments(post_id=post_urn, max_items=50, scrape_replies=True) and locate the comment by comment_id. Otherwise ask the user to paste the relevant slice of the thread. Figure out whether the target is:references/reply-templates.md. If the counterpart asked a question, answer it directly. If they pushed back, concede then sharpen.lib.publish(kind="reply", draft_text=<approved>, target_url=<comment_url>, post_urn=<urn>, platform_id=<id>, parent_comment=<top_level_comment_urn>, reaction_type=<chosen>). The wrapper handles Publora / manual / diy routing.LinkedIn only nests replies two levels deep. Visually the thread looks like:
Top comment by Alice (id: 111)
└─ Reply by Bob (id: 222) ← parentComment: urn:li:comment:(activity:POST, 111)
└─ Reply by Carol (id: 333) ← parentComment: STILL urn:li:comment:(activity:POST, 111)
Carol's reply doesn't nest under Bob's — it's pinned at level 2 to the same top comment. If you pass urn:li:comment:(activity:POST, 222) as parentComment, the API returns 400 on some paths or silently misplaces the reply.
Rule in this skill: always use the TOP-level comment's URN as parentComment. If you're replying to a 2nd-level reply, we walk up the tree to find the top comment.
references/reply-templates.md)Global voice rules: see root SKILL.md §Voice rules. Additional skill-specific rules:
linkedin-thread-monitor).> User: "Reply to this: https://www.linkedin.com/feed/update/urn:li:activity:7449018753880834048?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7449018753880834048%2C7449758545140453376%29"
>
> Skill: parses → post 7449018753880834048, comment 7449758545140453376. Fetches thread. Sees: post-author's post → Serge's comment ("moat moved to taste") → author's reply ("How are you building that conviction muscle with your team?"). Drafts R1 Answer-Their-Question variant. Shows approval card.
>
> User: "post"
>
> Skill: react APPRECIATION on the author's reply → pause 12s → post reply with parentComment set to Serge's original comment URN (the TOP level, not the author's reply).
SKILL.md — this filereferences/reply-templates.md — 5 reply templates with examplesreferences/threading-rules.md — LinkedIn's 2-level flattening explained with edge casesTake sergebulaev/linkedin-linkedin-reply-handler from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.