substack — скилл для Claude Code: чтение и публикация в Substack
Скилл ведёт ваш настоящий аккаунт Substack через логин-куки: показывает основную публикацию, выгружает посты со статистикой и публикует новый материал.
Apache-2.0 207 установок ★ 17 обновлён 2026-10-25
npx skills add AceDataCloud/Skills --skill substack -a claude-codeЧто делает substack
Скилл работает с Substack под вашей учётной записью: куки логина вы снимаете расширением ACE, а коннектор отдаёт их скрипту в переменной SUBSTACK_COOKIES. Официального публичного API для записи у Substack нет, поэтому запросы идут на те же внутренние веб-эндпоинты, что и у самого сайта.
Внутри один файл — scripts/substack.py, ему хватает стандартной библиотеки Python. Команда whoami показывает аккаунт и основную публикацию, articles --limit 20 выводит опубликованные посты со статистикой, а publish принимает Markdown и переводит его в блоки ProseMirror: заголовки, списки, код и ссылки становятся настоящим форматированием Substack.
Публикация закрыта подтверждением. Без --confirm последним аргументом команда только печатает план и ничего не пишет, поэтому сначала прогоняйте dry-run. С --draft-only пост остаётся черновиком в дашборде и возвращает edit_url. Живая публикация не рассылает письма, пока не добавлен --send-email, а эта рассылка необратима. Просроченные куки дают 401 или 403 — тогда аккаунт переподключают на studio.acedata.cloud/console/connectors.
Какие задачи решает
- проверить, под каким аккаунтом Substack работают сохранённые куки
- выгрузить опубликованные посты со статистикой в чат
- собрать черновик из Markdown и получить ссылку на редактор
- опубликовать заметку на вебе, не трогая подписчиков
- разослать выпуск по явному запросу
Примеры запросов агенту
- Покажи, кто залогинен в Substack и какая у меня основная публикация
- Выведи последние 20 постов со статистикой
- Опубликуй
post.mdкак черновик, письма не отправляй
Как установить substack
1Через Skills CLI (Vercel)
npx skills add AceDataCloud/Skills --skill substack -a claude-code2Вручную: положить файлы
~/.claude/skills/substack/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/substack/
1Через Skills CLI (Vercel)
npx skills add AceDataCloud/Skills --skill substack -a codex2Вручную: положить файлы
.agents/skills/substack/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add AceDataCloud/Skills --skill substack -a cursor2Вручную: положить файлы
.cursor/skills/substack/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install AceDataCloud/Skills skills/substack2Вручную: положить файлы
.github/skills/substack/SKILL.md1Через Skills CLI (Vercel)
npx skills add AceDataCloud/Skills --skill substack -a gemini-cli2Командой платформы
gemini skills install https://github.com/AceDataCloud/Skills --path skills/substackВручную: положить файлы
.devin/skills/substack/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add AceDataCloud/Skills --skill substack -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о substack
Как установить substack в Claude Code?
Выполните npx skills add AceDataCloud/Skills --skill substack -a claude-code, после этого скилл окажется по пути ~/.claude/skills/substack/SKILL.md.
Что делает substack?
Показывает аккаунт и основную публикацию, перечисляет посты со статистикой и публикует новый материал из Markdown. Запросы идут от вашего имени через куки, снятые расширением ACE.
Что будет, если куки протухнут?
Чтение вернёт 401 или 403, и аккаунт нужно переподключить на studio.acedata.cloud/console/connectors. Запись скрипт не повторяет.
Исходный текст
SKILL.md · Apache-2.0
---
name: substack
description: Read and publish on Substack (substack.com) with the user's own login cookies (BYOC) — show who they are and their primary publication, list their published posts with stats, and publish a new post / newsletter. Use when the user mentions Substack, "my Substack", their newsletter, or publishing a post to Substack.
when_to_use: |
Trigger for anything on the user's Substack account driven by their own login
cookie: show who they are and their primary publication, list their published
posts, or publish a new post / newsletter. This acts as the user's real
account, so writes are gated behind an explicit confirmation and never email
subscribers unless asked.
connections: [substack]
allowed_tools: [Bash]
license: Apache-2.0
metadata:
author: acedatacloud
version: "1.0"
---
# substack — read & publish on Substack via your own cookies
Drives the user's **real** Substack account through the same internal web API
the site uses (Substack has no official public write API), authenticated by the
login cookie they captured with the ACE extension. No browser, no third-party
deps — just `urllib`. The publish flow mirrors the community `python-substack`
library: **create draft → prepublish → publish**.
The connector injects the cookie jar as an env var:
- `SUBSTACK_COOKIES` — a JSON array of cookies (`substack.sid`, `substack.lli`,
…). **Secret — never echo or print it.** Substack authenticates writes with
the session cookie alone (no CSRF token header needed).
## CLI
The skill ships [`scripts/substack.py`](scripts/substack.py) — self-contained, stdlib only.
```sh
# $SKILL_DIR can point at another skill loaded this turn — anchor on our own
# script, and re-run this at the top of every Bash block (fresh shell each time).
SUB="$SKILL_DIR/scripts/substack.py"; [ -f "$SUB" ] || SUB=$(find /tmp -maxdepth 8 -path '*/skills/*/scripts/substack.py' 2>/dev/null | head -1)
[ -f "$SUB" ] || { echo "substack script not found (SKILL_DIR=$SKILL_DIR)" >&2; exit 1; }
python3 "$SUB" whoami # who is logged in + primary publication
python3 "$SUB" articles --limit 20 # my published posts + stats
```
## Verify the connection first
```sh
SUB="$SKILL_DIR/scripts/substack.py"; [ -f "$SUB" ] || SUB=$(find /tmp -maxdepth 8 -path '*/skills/*/scripts/substack.py' 2>/dev/null | head -1)
python3 "$SUB" whoami
# → {"user_id": ..., "name": "...", "handle": "...", "publication": "...", "publication_url": "https://<sub>.substack.com"}
```
On an auth error the cookie is expired — have the user reconnect at
<https://studio.acedata.cloud/console/connectors>. Do **not** loop-retry.
## Publishing — GATED (dry-run unless trailing `--confirm`)
`publish` writes to the user's real account. Content is **Markdown**, converted
to Substack's ProseMirror blocks: `#`..`######`→heading, ```` ``` ````→code
block, `>`→blockquote, `-`/`*`/`1.`→lists, `---`→horizontal rule, everything else
→paragraphs. Inline **bold**, *italic*, `code`, ~~strike~~, and `[links](url)`
render as real Substack formatting; bare `https://…` URLs are auto-linked.
Without a trailing `--confirm` it dry-runs. `--confirm` is honored **only as the
last argument**. Always show the dry-run, get an explicit "yes", then re-run.
```sh
SUB="$SKILL_DIR/scripts/substack.py"; [ -f "$SUB" ] || SUB=$(find /tmp -maxdepth 8 -path '*/skills/*/scripts/substack.py' 2>/dev/null | head -1)
# dry-run (shows the plan, writes nothing)
python3 "$SUB" publish --title "Title" --content-file post.md
# private draft (visible only in the user's dashboard)
python3 "$SUB" publish --title "Title" --content-file post.md --draft-only --confirm
# go LIVE on the web (does NOT email subscribers)
python3 "$SUB" publish --title "Title" --content-file post.md --confirm
# go LIVE and email subscribers (use only when the user explicitly asks)
python3 "$SUB" publish --title "Title" --content-file post.md --send-email --confirm
```
- `--draft-only` stops at a draft — **default to this** unless the user asked to
go live. Returns an `edit_url` to review in the Substack editor.
- Publishing **does NOT email subscribers** unless `--send-email` is passed.
Emailing a newsletter is irreversible and hits every subscriber's inbox —
never add `--send-email` without an explicit request.
- `--subtitle` sets the post subtitle; `--audience` is one of
`everyone` (default, free/public), `only_paid`, `founding`, `only_free`.
## Gotchas
- **This is the user's real Substack account.** Confirm before any publish, and
keep `--draft-only` as the safe default.
- **`--send-email` blasts the whole subscriber list** and cannot be undone — opt
in only on explicit request.
- Substack sits behind Cloudflare; an occasional 403/429 on a read is transient —
the CLI auto-retries reads once. A *persistent* 401/403 means the cookie is
genuinely expired (reconnect); the CLI never retries a write.
- **Never print `SUBSTACK_COOKIES`** — it is full account access.
- **ToS**: acts only on the user's own account with their own captured cookie.
## Record the output
After you successfully publish and obtain the live result URL, call the built-in
`publish_artifact` tool ONCE so the user can track this deliverable in **My Outputs**:
```
publish_artifact(kind="article", channel="substack", title="<title>", url="<the REAL returned URL>", status="delivered")
```
Use the real returned URL — never fabricate one. Call it once per published item,
only after delivery is confirmed; skip it (or use `status="failed"`) if publishing failed.
See `_shared/artifacts.md`.
© acedatacloud · Apache-2.0 · AceDataCloud/Skills