Skip to content

Add X (Twitter) Articles domain skill#460

Open
changtimwu wants to merge 1 commit into
browser-use:mainfrom
changtimwu:domain-skill-x-articles
Open

Add X (Twitter) Articles domain skill#460
changtimwu wants to merge 1 commit into
browser-use:mainfrom
changtimwu:domain-skill-x-articles

Conversation

@changtimwu

@changtimwu changtimwu commented Jun 21, 2026

Copy link
Copy Markdown

Adds domain-skills/x/articles.md documenting how to publish long-form X Articles by driving the editor through the harness.

Why

There is no public API for X Articles (the v2 API only posts a plain long-form post, not the formatted Article object), so the editor has to be browser-driven. The mechanics are non-obvious and cost several exploration steps to work out.

What it captures

  • URLs: /compose/articles (list), /compose/articles/edit/<id> (editor), /preview suffix, and the /<handle>/status/<id> the post redirects to after publishing.
  • Editor structure: it's Draft.js ([data-testid="composer"]); the longform-* block-type class table; title is a separate textarea.
  • The key mechanic: inject content via a synthetic paste ClipboardEvent carrying text/html — Draft.js converts HTML → block types far more reliably than per-line toolbar clicking. Includes the verified HTML→Draft mapping.
  • Markdown conversion rules for the editor's limits: no tables (→ bold-led bullet list), no code blocks (→ blockquote / plain), inline code → bold.
  • Publish flow: the audience/reply dialog (scope selector to [role="dialog"] — two Publish buttons on screen) and dismissing the paid "Boost" promo.
  • Traps: regular Premium is enough; Cmd+A won't clear the editor (delete the draft instead); retina DPR=2 means read coords from getBoundingClientRect, not screenshots.

No run narration, pixel coordinates, or secrets — just the durable site map.

🤖 Generated with Claude Code


Summary by cubic

Adds domain-skills/x/articles.md that documents how to publish long-form X (Twitter) Articles by driving the Draft.js editor in the browser. It covers access, reliable HTML injection, markdown conversion limits, the publish flow, and UI pitfalls.

  • New Features
    • Maps key URLs: /compose/articles, /compose/articles/edit/<id>, /compose/articles/edit/<id>/preview, and final /<handle>/status/<id>; notes regular Premium access and login redirects.
    • Details the editor: Draft.js selectors, longform-* block classes, separate title textarea, and toolbar limits (no tables/code blocks).
    • Describes the robust content path: focus composer, inject text/html via synthetic paste, and the verified HTML→Draft mapping; markdown rules (inline code → bold, code blocks → blockquote, tables → bullets; H1 goes to title).
    • Covers publish flow and traps: two Publish buttons scoped to [role="dialog"], Boost promo dismissal, reliable button targeting via visible text + getBoundingClientRect (DPR-safe), delete-to-reset drafts, and cleaning throwaway drafts.

Written for commit 04d1318. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

Document publishing X Articles via the Draft.js editor, complementing
the existing x/posting.md (auth + tweets):

- URLs, longform-* block-type mapping, title textarea vs body composer
- the synthetic-paste mechanic for injecting HTML (Draft converts to blocks)
- markdown conversion rules (tables -> bullets, code -> blockquote)
- the publish dialog flow and dismissing the paid Boost promo
- field-tested traps: no API, Cmd+A clear, retina DPR, locate-by-rect

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changtimwu changtimwu force-pushed the domain-skill-x-articles branch from 4842424 to 04d1318 Compare June 21, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant