Skip to content

Add Medium publishing domain skill#462

Open
changtimwu wants to merge 1 commit into
browser-use:mainfrom
changtimwu:domain-skill-medium-publishing
Open

Add Medium publishing domain skill#462
changtimwu wants to merge 1 commit into
browser-use:mainfrom
changtimwu:domain-skill-medium-publishing

Conversation

@changtimwu

@changtimwu changtimwu commented Jun 21, 2026

Copy link
Copy Markdown

Adds agent-workspace/domain-skills/medium/publishing.md — the write path for Medium, complementing the existing read-oriented scraping.md (APIs) and article-hydration.md (DOM extraction).

Why

There is no public API for publishing to Medium (the legacy API stopped issuing integration tokens), so a story has to be composed by driving the editor. The mechanics are non-obvious and cost a lot of exploration to work out.

What it captures

  • URLs: /new-story/p/<id>/edit/p/<id>/submission/@handle/<slug>-<id>, plus the drafts list + delete path.
  • Editor structure: the classic .js-postField contenteditable and the .graf--* block-type table (graf--title, graf--h3/h4, graf--p, graf--li, graf--pre, graf--blockquote).
  • The key mechanic: inject content with a synthetic paste ClipboardEvent carrying text/html — Medium converts HTML → graf blocks. Includes the verified HTML→graf mapping (incl. inline <code> surviving as monospace).
  • Title handling: the first <h1> of a fresh-editor paste becomes graf--title; or JS-place the caret in the title block and type (clicking the empty title block won't focus it).
  • Multi-line code: newlines inside one <pre> collapse (also <br> and <pre><code>), so emit one <pre> per line.
  • Tags: commit each via JS .focus() + a char-less trusted Enterpress_key("Enter") doesn't commit and comma is rejected.
  • Traps: no API; new-draft creation throttles (editing an existing draft still saves); execCommand('delete') clearing corrupts the save model; beforeunload freezes navigation; Cmd+A won't register via CDP; retina DPR.

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

🤖 Generated with Claude Code


Summary by cubic

Adds a Medium publishing domain skill that documents how to compose and publish stories by driving the classic editor (no public publish API). Complements the read skills and shares the reliable write flow and pitfalls.

  • New Features
    • Adds agent-workspace/domain-skills/medium/publishing.md.
    • Maps the publish flow: /new-story/p/<id>/edit/p/<id>/submission → canonical URL.
    • Details HTML-based synthetic paste to create graf blocks, including title handling and inline code.
    • Covers multi-line code (one <pre> per line) and committing tags with a focused Enter.
    • Notes traps: draft throttling, execCommand('delete') save issues, beforeunload dialogs, Cmd+A via CDP, and DPR tips.

Written for commit ad39448. Summary will update on new commits.

Review in cubic

Document publishing a Medium story via the classic graf editor,
complementing the read-oriented scraping.md / article-hydration.md:

- URLs (new-story -> /p/<id>/edit -> /submission -> canonical)
- graf block structure and HTML -> graf paste mapping
- the synthetic-paste mechanic; title handling (first <h1> -> graf--title)
- multi-line code = one <pre> per line (newlines collapse)
- tag commit via JS focus + char-less trusted Enter
- traps: no API, new-draft throttling, execCommand-clear corrupts save,
  beforeunload freeze, Cmd+A not registering, retina DPR

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@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

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