feat(typefully): add comment-thread CRUD and comment marker handling instructions for draft updates - #22
Conversation
frankdilo
left a comment
There was a problem hiding this comment.
looks good overall, left a couple minor comments
did not test the skill in actual use
|
|
||
| comments:create <draft_id> [options] Create a new comment thread anchored on a span of a post | ||
| --social-set-id <id> Social set (uses default if omitted) | ||
| --post-index <n> Zero-based index of the post to anchor on (required) |
There was a problem hiding this comment.
wondering if this might confuse LLMs on LinkedIn posts that only have 1 post/atom, worth to test manually with the skill and see if worth chaning
There was a problem hiding this comment.
Good catch. tried it and it made comment on the right word in the first shot
|
|
||
| # PATCH a draft and accept that some stored threads weren't included in the submitted text; | ||
| # the dropped threads are resolved server-side | ||
| ./typefully.js drafts:update 456 --text "Rewritten body" --force-overwrite-comments --use-default |
There was a problem hiding this comment.
what does --use-defaults do here? not immediately clear
There was a problem hiding this comment.
This is existing. It uses the social set that has been set as the default
There was a problem hiding this comment.
It is an escape hatch in all commands that allows you to skip passing the social set id
linuz90
left a comment
There was a problem hiding this comment.
Left a couple of comments
| --- | ||
| name: typefully | ||
|
|
||
| ## name: typefully |
| ./scripts/typefully.js drafts:create --platform linkedin --text "Thanks @[Typefully](urn:li:organization:86779668) for the support." | ||
| ``` | ||
|
|
||
| ## Comments on Drafts |
There was a problem hiding this comment.
This whole section seems too big and verbose to me. The point of including a CLI in this skill is to avoid teaching LLMs about the underlying API, or at least not extensively. I'm pretty confident this part could be half as long and still achieve the same goal of enabling agents to handle comments with the skill.
Adds six `comments:*` subcommands (list, create, reply, resolve, update, delete) for managing per-draft comment threads, plus `--exclude-comment-markers` on `drafts:get`/`drafts:update` for marker-free display rendering and `--force-overwrite-comments` on `drafts:update` to intentionally drop threads when submitting text without their markers. Includes a new `tests/comments.test.js` covering all six commands and four new `drafts.test.js` cases exercising the marker-handling flags.
62aebaf to
5cc4445
Compare


TL;DR
comments:*subcommands —list,create,reply,resolve,update,deletegive the CLI full parity with the API's per-draft comment-thread endpoints, so agents can read and write reviewer feedback directly.drafts:get/drafts:update—--exclude-comment-markersrendersposts[*].textwithout<typ:comment-thread>markers (display-only), and--force-overwrite-commentsdeliberately drops threads on PATCH when the submitted text doesn't carry their markers.SKILL.mdso comments behave well: preserve every marker on PATCH, never resolve/delete a thread without explicit user instruction, after addressing a comment ask the user before resolving, and treat--force-overwrite-commentsas a strict last resort. Self-closing markers are explicitly documented as paragraph anchors (not "empty" or "resolved" comments). Includes prose guidance to talk to users about comments, not the underlying marker tags.tests/comments.test.jscovers all six new subcommands (success paths, missing-positional errors, query/body shape).tests/drafts.test.jsadds four cases for the new marker flags (--exclude-comment-markersquery string on GET/PATCH,--force-overwrite-commentsalone vs. combined with--text).What's new
CLI (
skills/typefully/scripts/typefully.js)comments:list <draft_id>— paginatescomment-threadswith optional--platform,--status,--limit,--offset.comments:create <draft_id>— creates a thread anchored on--selected-textat--post-index, with optional--platform/--occurrence.comments:reply <draft_id> <thread_id>— posts a reply on an existing thread.comments:resolve <draft_id> <thread_id>— resolves a thread (only after explicit user authorization, per skill guidance).comments:update <draft_id> <thread_id> <comment_id>— author-only edit of a comment's text.comments:delete <draft_id> <thread_id> [comment_id]— deletes either a single comment or the whole thread.drafts:get --exclude-comment-markersanddrafts:update --exclude-comment-markers— render markers out of the response (display only; the response is not safe to PATCH back).drafts:update --force-overwrite-comments— setsforce_overwrite_comments: trueon the PATCH body so missing markers no longer trigger409 COMMENTS_MARKER_MISMATCH. Skill guidance treats this as a last resort.requireDraftIdPositional,requireThreadPositional,requireCommentPositionalfor consistent positional-argument error messages with usage hints.Skill (
skills/typefully/SKILL.md)Reorganized "Comments on Drafts" into a single coherent flow, putting the mental model and core safety rules first:
selected_text,--occurrence, LinkedIn mention indivisibility, multi-platform--platformrequirement, author-onlycomments:update).--exclude-comment-markers(display only) and--force-overwrite-comments(last resort with three explicit acceptable conditions).Changelog (
skills/typefully/CHANGELOG.md)Added entry under Unreleased > Added covering the new commands and flags.
Testing
npx vitest run tests/comments.test.js tests/drafts.test.js— 61 tests pass (16 new comment-command tests + 4 new marker-flag tests + existing drafts coverage).Notes
--force-overwrite-commentsis intentionally surfaced but documented as a last resort to avoid accidental loss of reviewer comments during agent-driven edits.