publish-medium

A publishing workflow for copying blog posts to Medium, a platform for publishing and reading articles. It converts Markdown, a plain-text writing format, into the rich content Medium's editor expects.

In plain words
What is it for?
Use it to publish a finished blog post on Medium, either by itself or as one step in distributing an article across several platforms.
Why use it?
It avoids pasted posts appearing as unformatted text and keeps the original website link available as the article's canonical source where supported.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/childrentime/reactuse/publish-medium
Any agent
npx skills add childrentime/reactuse --skill publish-medium
Clone the repo
git clone --depth 1 https://github.com/childrentime/reactuse

Made for: Claude Code, Codex.

Per session 137 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,763 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00137 $0.03763
Opus 5 $0.00068 $0.01881
Sonnet 5 $0.00027 $0.00753
Haiku 4.5 $0.00014 $0.00376

Measured 3d ago against content hash 6fb60db6d3d8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

publish-medium scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/publish-medium/SKILL.md · 233 lines

How it starts

The opening of the file, as written. The whole thing — 233 lines — stays where its author put it; the contents beside it link to each section on GitHub.

publish-medium — 跨发到 Medium(opencli 浏览器自动化)

reactuse.com 的博客在 Medium 上做镜像分发,扩大英文触达。Medium 是真实增量流量(推荐流 + 订阅者收件箱)。

⚠️ 路径:opencli 浏览器自动化(已取代旧的 bridge + 扩展方案)

历史:2026-06 之前用的是本地 Bridge 服务 + Chrome 扩展(medium-push skill,靠 SSE 推 markdown 到扩展、扩展转 HTML 再模拟粘贴)。现在统一走 opencli,和 publish-hashnode 一致,不再需要那套 bridge。旧 skill 已删除。

核心难点:Medium 的编辑器(.js-postField,contenteditable + 自有数据模型)不解析 markdown。直接 fill markdown 文本只会得到一坨纯文本。正确做法和那个旧扩展一样——把 markdown 转成 HTML,然后模拟一次 paste 事件(带 text/html 的 DataTransfer),Medium 的粘贴处理器会把 HTML 正确吃进它的模型。标题则用 execCommand("insertText") 灌(Medium 模型只认"输入"路径,直接写 DOM textContent 不进模型)。

触发场景

  1. 用户明说:"发到 medium" / "publish to medium" / "把这篇 cross-post 到 medium"
  2. 刚写完一篇博客并说"发出去" / "同步发布" / "推平台"——默认包括 Medium
  3. 多平台分发流程的一步(dev.to + Medium + Hashnode + 掘金)

⚠️ 不要触发:用户只让发别的平台(只发 Hashnode / 掘金 / dev.to)时,不要顺手也发 Medium。

⚠️ 顺序:先推 GitHub,再跨发

英文跨发(Medium / Hashnode / dev.to)的 canonical 都指回 reactuse.com/blog/<slug>/必须先把博客 commit + push 到 GitHub(触发 Netlify 部署),让原文链接真的存在,再发跨平台版本——否则 canonical 指向一个 404。掘金是中文翻译、独立站,不受此约束。

注:Medium 原生编辑器没有 canonical 字段(只有 Import 流程才有)。所以 Medium 这篇本身不会把权重让回 reactuse.com——它纯粹是触达渠道。这是已知取舍,不用纠结;旧的 bridge 方案同样没设 canonical。

前置检查

opencli --version                    # 需要 ≥ 1.7.22
opencli doctor                       # 必须看到 Connectivity: connected
command -v pandoc                    # 正文 markdown→HTML 靠 pandoc;没有就 brew install pandoc

如果 Connectivity: failed:让用户把 Chrome 切到前台、点一下 opencli 扩展图标唤醒 service worker,再 opencli doctor

工作流程

步骤 1:确认目标文章 + 元数据

ls packages/website-astro/src/content/blog/ | tail -3

blog-external/post-N-<slug>/medium.md 拿正文(已剥掉 frontmatter 和 <!-- truncate -->,含 H1 标题)。从源文件 frontmatter 拿 title

步骤 2:打开 Medium 新文章页

opencli browser default open "https://medium.com/new-story"
opencli browser default get title          # 应是 "New story – Medium"(说明已登录)

如果跳到登录页:让用户先在该 Chrome 里登录 Medium,再重来。

步骤 3:正文 markdown → HTML(pandoc)+ ⚠️ 代码块空行适配

Read the full file on GitHub · 233 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 233 lines · 137 tokens per session scan A 6fb60db6d3d8

Subscribe to this mod's changes

publish-medium is a skill published in the GitHub repository childrentime/reactuse (1,048 stars, last pushed 12d ago), licensed Unlicense. It adds 137 tokens to every session and 3,763 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

content-publish

End-to-end content creation and publishing. Takes a topic (or generates one), drafts in the user's voice, gets approval via Telegram, and publishes to Medium via browser automation. Invoke with "publish a post about X", "write and publish to Medium", "content-publish", or when an ego-dispatched session needs to create…

WingedGuardian/GENesis-AGI · 74 tokens

csdn-publisher

CSDN 博客发布/管理自动化(Web 内部 API).

Morningstar202604/awesome-skillkit · 21 tokens

take-screenshot

Take a screenshot of a rendered blog page section using Playwright (via uv) against the local dev server, save it as a WebP into a page's assets dir, and insert an tag. Use whenever the user asks to take/create/capture a screenshot of a page or section themselves (especially for monthly updates pages), e.g. "take a…

gbmhunter/blog · 110 tokens

electron

Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include…

vercel-labs/agent-browser · 112 tokens

use-agent-browser-for-airi

Test AIRI display-model imports with agent-browser across stage-tamagotchi Electron, stage-web, and stage-pocket mobile web layouts. Use when uploading and verifying contributor-supplied Live2D ZIP, VRM, or MMD ZIP/PMX/PMD files through AIRI's model selector, including onboarding bypass, format-specific import…

moeru-ai/airi · 87 tokens

opencli-sitemap-author

Use when creating or maintaining OpenCLI site sitemaps: agent-facing navigation, page-state, action, workflow, API-reference, pitfall, and fallback knowledge for a website. Use after browser exploration discovers durable site context, when a sitemap is stale, or when promoting local site knowledge into the repo.

jackwener/OpenCLI · 67 tokens