publish-substack

publish-substack is a skill for Claude Code from atretyak1985/swarmery. It costs 84 tokens per session (1,474 once invoked), scanned A, original, Apache-2.0.

A publishing workflow that transfers an article from a repository to Substack, a website for publishing email newsletters and posts.

In plain words
What is it for?
It is for preparing and checking Substack drafts, replacing the body of an existing post, and publishing only after explicit confirmation.
Why use it?
It checks what Substack saved after the transfer and stops at a draft because publishing can email subscribers and cannot be undone.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: reads .claude/ paths.

Good fit It is for preparing and checking Substack drafts, replacing the body of an existing post, and publishing only after explicit confirmation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/atretyak1985/swarmery/publish-substack
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.

Any agent
npx skills add atretyak1985/swarmery --skill publish-substack
Clone the repo
git clone --depth 1 https://github.com/atretyak1985/swarmery

Made for: Claude Code.

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-substack

README.md
[![agentmods](https://agentmods.dev/badge/skills/atretyak1985/swarmery/publish-substack/github.svg)](https://agentmods.dev/skills/atretyak1985/swarmery/publish-substack)
Your own site
<a href="https://agentmods.dev/skills/atretyak1985/swarmery/publish-substack"><img src="https://agentmods.dev/badge/skills/atretyak1985/swarmery/publish-substack/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for publish-substack

Your own site · 80×15
<a href="https://agentmods.dev/skills/atretyak1985/swarmery/publish-substack"><img src="https://agentmods.dev/badge/skills/atretyak1985/swarmery/publish-substack.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,474 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00084 $0.01474
Opus 5.5 $0.00034 $0.00590
Sonnet 5.5 $0.00017 $0.00295
Haiku 4.5 $0.00008 $0.00147

Measured 7d ago against content hash f4ba13defaa1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

publish-substack scanned grade A with 1 finding 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 7d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/build-substack.py, scripts/substack-editor.js), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const get = async (path) => (await fetch(path)).text();
.claude/skills/publish-substack/SKILL.md · 143 lines

How it starts

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

Publish to Substack

Substack has no publishing API. The body is pasted into its web editor in the author's own signed-in Chrome, and that editor discards what its schema cannot hold without reporting anything: a table, a link around inline code, a subtitle one character too long that stops the whole draft saving. So nothing here trusts the screen. The build refuses what is known to be dropped, and after the paste the draft Substack saved is read back and compared with what went in.

A run ends at a draft. Publishing emails every subscriber and cannot be undone, so it happens only when the author, having seen the draft, says so in this session and says whether the email goes out.

Before starting

  • pandoc is installed.
  • Chrome with the Claude extension is signed in to Substack. Drive it with the claude-in-chrome tools; the Playwright browser is a separate profile with no session.
  • The article's images are committed and pushed. Substack fetches them from GitHub at paste time.
  • The publication address is the one line in articles/substack/PUBLICATION (https://<name>.substack.com). When the file is missing, ask the author and write it.

1. Build

python3 .claude/skills/publish-substack/scripts/build-substack.py articles/substack/<slug>

It prints a manifest (title, subtitle, link targets, code blocks with their line counts, image count) and writes build/substack.html, build/manifest.json and a copy of the editor helper. When it lists problems, fix each one in article.md and build again.

2. Carry the article into the editor tab

The editor page's security policy blocks any request to the local machine, and HTML retyped into a tool call gets corrupted without a trace. window.name survives a navigation in the same tab, so the bytes travel there.

  1. Serve the build directory, in the background: python3 -m http.server 8901 --bind 127.0.0.1 --directory articles/substack/<slug>/build
  2. Open http://127.0.0.1:8901/substack.html in a new tab and run in the page:

Read the full file on GitHub · 143 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 7d ago First seen · 143 lines · 84 tokens per session scan A f4ba13defaa1

Subscribe to this mod's changes

publish-substack is a skill published in the GitHub repository atretyak1985/swarmery (7 stars, last pushed yesterday), licensed Apache-2.0. It adds 84 tokens to every session and 1,474 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-07.