Manual posting workflow: opportunity queue, draft review, one-click post, manual handoff #9

Closed
opened 2026-04-21 16:25:33 -07:00 by pyr0ball · 0 comments
Owner

Summary

Add a human-in-the-loop posting workflow to the Magpie UI, modelled on the Peregrine review-and-approve pattern. Covers both platforms Magpie can automate (Reddit via Playwright) and platforms it cannot (Lemmy, LinkedIn, etc.) where the workflow becomes a copy-to-clipboard handoff.

Flow

Signal detected → Claude drafts reply/post → Human reviews → Approve → Post fires (or manual handoff)

UI Components

Opportunities Queue

  • Flagged threads from monitored communities (magpie#7 signal extraction feeds this)
  • Each entry: platform, community, why flagged (keyword match / pain-point signal), link to original thread
  • Status: pending_review | approved | posted | dismissed
  • Sortable by flagged date, community, product relevance

Draft Review Panel

  • Side-by-side: original thread context (title + body + top comments) + proposed reply/post draft
  • Inline edit before approving
  • Product tag (peregrine / kiwi / snipe / circuitforge)
  • Post type: reply_to_thread | new_post

Post Actions

  • Auto-post: fires trigger_sub_post for Reddit campaigns where Playwright can handle it
  • Manual handoff: for Lemmy, LinkedIn, etc. — copy draft to clipboard + open thread URL in browser. Records a manual_posted status so the post still lands in history.
  • Dismiss: removes from queue with optional note

Backend

New DB table: opportunities

CREATE TABLE opportunities (
    id            INTEGER PRIMARY KEY AUTOINCREMENT,
    platform      TEXT NOT NULL DEFAULT 'reddit',
    community     TEXT NOT NULL,
    thread_url    TEXT NOT NULL,
    thread_title  TEXT,
    thread_body   TEXT,
    signal_reason TEXT,
    product       TEXT,
    draft_title   TEXT,
    draft_body    TEXT,
    post_type     TEXT NOT NULL DEFAULT 'reply_to_thread',
    status        TEXT NOT NULL DEFAULT 'pending_review',
    campaign_id   INTEGER REFERENCES campaigns(id),
    created_at    TEXT NOT NULL DEFAULT (datetime('now')),
    updated_at    TEXT NOT NULL DEFAULT (datetime('now'))
);

New endpoints

  • GET /opportunities — list with status filter
  • POST /opportunities — create (manual add or signal-extraction auto-create)
  • PATCH /opportunities/{id} — update draft, status
  • POST /opportunities/{id}/approve — approve + trigger post or return manual-handoff payload
  • POST /opportunities/{id}/dismiss — mark dismissed

Manual handoff payload

{
  "type": "manual_handoff",
  "draft_body": "...",
  "thread_url": "https://lemmy.world/post/45849526",
  "instructions": "Copy the draft and reply to this thread manually. Mark as posted when done."
}

MCP Tools

Add create_opportunity and list_opportunities to mcp/server.js so Claude can flag threads directly from a conversation (e.g. user pastes a Lemmy URL, Claude creates the opportunity with a draft).

Example trigger

User: pastes https://lemmy.world/post/45849526 (LSC meme about broken job search)
Claude: creates opportunity, drafts a reply in Peregrine voice, queues it for review.
User: opens Magpie, reviews draft, edits one line, clicks "Copy + Open" for manual handoff.

Out of scope

  • Lemmy API authentication (manual handoff covers this for now)
  • LinkedIn automation (policy risk; manual handoff only)
  • AI re-drafting within the UI (draft comes from Claude at creation time)

References

  • magpie#1 (reddit-poster migration) — campaign system this builds on
  • magpie#7 (signal extraction) — upstream source of auto-flagged opportunities
  • Lemmy thread that triggered this: https://lemmy.world/post/45849526
## Summary Add a human-in-the-loop posting workflow to the Magpie UI, modelled on the Peregrine review-and-approve pattern. Covers both platforms Magpie can automate (Reddit via Playwright) and platforms it cannot (Lemmy, LinkedIn, etc.) where the workflow becomes a copy-to-clipboard handoff. ## Flow ``` Signal detected → Claude drafts reply/post → Human reviews → Approve → Post fires (or manual handoff) ``` ## UI Components ### Opportunities Queue - Flagged threads from monitored communities (magpie#7 signal extraction feeds this) - Each entry: platform, community, why flagged (keyword match / pain-point signal), link to original thread - Status: `pending_review` | `approved` | `posted` | `dismissed` - Sortable by flagged date, community, product relevance ### Draft Review Panel - Side-by-side: original thread context (title + body + top comments) + proposed reply/post draft - Inline edit before approving - Product tag (peregrine / kiwi / snipe / circuitforge) - Post type: `reply_to_thread` | `new_post` ### Post Actions - **Auto-post**: fires `trigger_sub_post` for Reddit campaigns where Playwright can handle it - **Manual handoff**: for Lemmy, LinkedIn, etc. — copy draft to clipboard + open thread URL in browser. Records a `manual_posted` status so the post still lands in history. - **Dismiss**: removes from queue with optional note ## Backend ### New DB table: `opportunities` ```sql CREATE TABLE opportunities ( id INTEGER PRIMARY KEY AUTOINCREMENT, platform TEXT NOT NULL DEFAULT 'reddit', community TEXT NOT NULL, thread_url TEXT NOT NULL, thread_title TEXT, thread_body TEXT, signal_reason TEXT, product TEXT, draft_title TEXT, draft_body TEXT, post_type TEXT NOT NULL DEFAULT 'reply_to_thread', status TEXT NOT NULL DEFAULT 'pending_review', campaign_id INTEGER REFERENCES campaigns(id), created_at TEXT NOT NULL DEFAULT (datetime('now')), updated_at TEXT NOT NULL DEFAULT (datetime('now')) ); ``` ### New endpoints - `GET /opportunities` — list with status filter - `POST /opportunities` — create (manual add or signal-extraction auto-create) - `PATCH /opportunities/{id}` — update draft, status - `POST /opportunities/{id}/approve` — approve + trigger post or return manual-handoff payload - `POST /opportunities/{id}/dismiss` — mark dismissed ### Manual handoff payload ```json { "type": "manual_handoff", "draft_body": "...", "thread_url": "https://lemmy.world/post/45849526", "instructions": "Copy the draft and reply to this thread manually. Mark as posted when done." } ``` ## MCP Tools Add `create_opportunity` and `list_opportunities` to `mcp/server.js` so Claude can flag threads directly from a conversation (e.g. user pastes a Lemmy URL, Claude creates the opportunity with a draft). ## Example trigger User: pastes https://lemmy.world/post/45849526 (LSC meme about broken job search) Claude: creates opportunity, drafts a reply in Peregrine voice, queues it for review. User: opens Magpie, reviews draft, edits one line, clicks "Copy + Open" for manual handoff. ## Out of scope - Lemmy API authentication (manual handoff covers this for now) - LinkedIn automation (policy risk; manual handoff only) - AI re-drafting within the UI (draft comes from Claude at creation time) ## References - magpie#1 (reddit-poster migration) — campaign system this builds on - magpie#7 (signal extraction) — upstream source of auto-flagged opportunities - Lemmy thread that triggered this: https://lemmy.world/post/45849526
Sign in to join this conversation.
No labels
bug
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Circuit-Forge/magpie#9
No description provided.