publish

publish is a command for coding agents from signalcompose/claude-tools. It costs 13 tokens per session (1,698 once invoked), scanned A, original, MIT.

A publishing command that moves a Markdown draft into an X Article, the long-form article format on the X social network, through browser automation.

In plain words
What is it for?
Use it to select a draft, convert headings, tables, code blocks, and separators for the X Articles editor, and open the publishing workflow in a browser.
Why use it?
It handles the conversion and editor entry work that would otherwise require copying and formatting the draft by hand.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the x-article plugin — 1 skill, 4 commands shipped together

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 commands/signalcompose/claude-tools/publish
Clone the repo
git clone --depth 1 https://github.com/signalcompose/claude-tools

Or install x-article, the plugin that ships this one along with the rest of its 1 skill, 4 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for publish

README.md
[![agentmods](https://agentmods.dev/badge/commands/signalcompose/claude-tools/publish.svg)](https://agentmods.dev/commands/signalcompose/claude-tools/publish)
Your own site
<a href="https://agentmods.dev/commands/signalcompose/claude-tools/publish"><img src="https://agentmods.dev/badge/commands/signalcompose/claude-tools/publish.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,698 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.00013 $0.01698
Opus 5 $0.00006 $0.00849
Sonnet 5 $0.00003 $0.00340
Haiku 4.5 $0.00001 $0.00170

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

Security

Grade A, and why

publish 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 4d 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.

plugins/x-article/commands/publish.md · 131 lines

How it starts

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

X Articles 公開

Step 1: 必須リファレンスを読む

以下を順番に読むこと:

  1. ${CLAUDE_PLUGIN_ROOT}/skills/x-articles-knowledge/references/draftjs-editor.md
  2. ${CLAUDE_PLUGIN_ROOT}/skills/x-articles-knowledge/references/browser-automation.md

Step 2: ドラフトの読み込みと変換

このコマンドは単独のセッションで実行できる(下書きフェーズとの分離が可能)。

引数でファイルパスが指定された場合はそのファイルを読み込む。 指定がない場合は、現在のディレクトリにある draft-*.md ファイルを探してユーザーに選択を促す。

# 推奨: ファイルパスを明示的に渡す
/x-article:publish /path/to/draft-topic-20260219-1430.md

# 引数なしも可(カレントディレクトリの draft-*.md を検索)
/x-article:publish

マークダウンを X Articles 用 HTML に変換する(article-structure.md のルールに従う):

  • テーブル → テキスト形式
  • コードブロック → [手動挿入フラグ] を残す
  • 水平線 → [手動挿入フラグ] を残す

セクションを ## ヘッダーで分割する(3000 文字以上のセクションはさらに分割)。

Step 3: ブラウザ MCP の確認と選択

利用可能な MCP ツールを確認し、以下の優先順位で使用する:

優先度 手段 確認方法
1 Claude in Chrome MCP mcp__Claude_in_Chrome__ で始まるツールが存在するか
2 Playwright MCP mcp__playwright__ で始まるツールが存在するか
3 手動案内 上記どちらもない場合

Claude in Chrome を優先する理由: ユーザーの実ブラウザを使うため X にログイン済み。Playwright は拡張機能(1Password 等)が動作しない。

Step 4: X Articles エディタを開く

選択した MCP で https://x.com/compose/articles へ navigate する。 ページ読み込み後、「create」ボタン(新規記事作成)をクリックする。 エディタが表示されるまで待機する。

注意: https://x.com/articles/new は存在しないため使用しないこと。

Step 5: タイトルを入力する

タイトル入力欄を特定して記事タイトルを入力する。

Step 6: ヘッダー画像のアップロード(ユーザーに依頼)

AskUserQuestion ツールで以下を確認:

「ヘッダー画像を手動でアップロードしてください。アップロード完了後、「続行」と入力してください。(ヘッダー画像ファイル: header.png または --title 引数で生成したもの)」

ユーザーの確認後に次のステップへ進む。

Step 7: セクションごとにペースト

browser-automation.md の DataTransfer + ClipboardEvent パターンを使用する。

DraftJS の h2 ブロック認識の制約と回避策

DraftJS の挙動: ペースト時、HTMLの最初のブロック要素は現在の段落に追記される(ブロック境界が無視される)。2番目以降の要素は正しく新規ブロックとして認識される。

正しいペースト戦略:

  1. Section 1(最初): 通常通りペーストする(エディタが空なので問題なし)

    <h2>セクション1タイトル</h2><p>段落...</p>
    
  2. Section 2以降(2つ目〜): ゼロ幅スペース \u200B のダミー先頭ブロックを追加し、残りのセクションをまとめて1回でペーストする(ただし合計 3000 文字を超える場合は draftjs-editor.md の「ペースト分割戦略」に従い 2〜3 セクションずつに分割すること)

    <p>\u200B</p><h2>セクション2タイトル</h2><p>段落...</p><h2>セクション3タイトル</h2><p>段落...</p>
    
    • \u200B(ゼロ幅スペース)は不可視文字なので直前段落に混入しても視覚影響なし
    • <h2> は2番目以降の要素なので正しく新規ブロックとして認識される

Read the full file on GitHub · 131 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. 4d ago First seen · 131 lines · 13 tokens per session scan A 894ea80c7628

Subscribe to this mod's changes

publish is a command published in the GitHub repository signalcompose/claude-tools (4 stars, last pushed 8d ago), licensed MIT. It adds 13 tokens to every session and 1,698 once invoked, about $0.0001 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-31.