skills/substack-tools/SKILL.md
Quản lý Substack: draft, schedule, publish, list, sections, scan/crawl newsletter.
npx skillsauth add hoangvantuan/claude-plugin substack-toolsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
CLI tự động quản lý bài viết Substack: draft, schedule, publish, list, sections, batch operations + scan/crawl newsletter khác (lấy tất cả bài qua archive API). Dùng python-substack (reverse-engineered) + public JSON API (/api/v1/).
test -d ~/.venv/claude || uv venv ~/.venv/claude
uv pip install --python ~/.venv/claude/bin/python python-substack feedparser httpx beautifulsoup4 markdownify
Script cần 2 biến: SUBSTACK_COOKIE và SUBSTACK_PUBLICATION_URL. Tìm theo thứ tự: env var → .env trong thư mục skill → .env trong CWD.
| Cách | Khi nào |
|------|---------|
| Env var (~/.zshrc) | Dùng thường xuyên — set 1 lần, dùng mãi |
| File .env | Nhiều publication — mỗi thư mục 1 .env (cần python-dotenv) |
Lấy cookie: Substack dashboard (đã login) → F12 → Application → Cookies → copy substack.sid. Hết hạn sau 1-2 tuần.
Chi tiết setup lần đầu → setup-guide.
PY=~/.venv/claude/bin/python
SCRIPT=<skill-path>/scripts/substack_cli.py
$PY $SCRIPT draft ARTICLE.md COVER.png [--section "Tên section"] [--subtitle "..."]
ARTICLE.md: dòng 1 = title (tự strip #), dòng 2+ = body markdownCOVER.png: upload lên S3 Substack, chèn đầu bài làm cover + inline image$PY $SCRIPT schedule ARTICLE.md COVER.png --at 2026-04-20T09:00:00 [--audience everyone]
| Flag | Mặc định | Giá trị |
|---|---|---|
| --at | bắt buộc | ISO 8601. Không timezone → dùng local. Có timezone → dùng luôn |
| --audience | everyone | everyone / only_paid / only_free / founding |
$PY $SCRIPT publish ARTICLE.md COVER.png [--no-send]
CẢNH BÁO: không reversible. Bài lên public ngay, email gửi subscriber không recall được. Luôn hỏi user xác nhận trước khi chạy publish.
$PY $SCRIPT publish-existing DRAFT_ID [--no-send]
$PY $SCRIPT unschedule DRAFT_ID
$PY $SCRIPT list [--filter draft|scheduled|published|all] [--limit 25]
$PY $SCRIPT sections
$PY $SCRIPT set-section "Tên Section" DRAFT_ID1 DRAFT_ID2 ...
$PY $SCRIPT scan <slug> [--limit 10] [--json] [--all]
slug: slug Substack (vd: platformer), full URL, hoặc domain--json: output JSON thay vì bảng--all: lấy TẤT CẢ bài qua archive API (mặc định dùng RSS, tối đa ~25 bài)$PY $SCRIPT crawl <URL> [--output-dir ./crawled]
$PY $SCRIPT crawl-feed <slug> [--limit 5] [--output-dir ./crawled] [--all]
--all: tải TẤT CẢ bài qua archive API (bỏ qua --limit)Chi tiết troubleshooting → crawl-guide.
--dry-run: in payload, không gọi API. Đặt SAU tên subcommand.--section "...": gán bài vào section (áp dụng cho draft/schedule/publish).--subtitle "...": subtitle hiển thị dưới title.| Tự làm | Phải hỏi user trước |
|--------|---------------------|
| draft, schedule, list, sections, set-section, unschedule | publish / publish-existing — gửi email thật, không recall được |
| scan, crawl, crawl-feed (read-only) | Xoá bài đã publish |
| --dry-run để kiểm tra payload | |
Không commit .env — chứa cookie auth.
references/setup-guide.md — chi tiết cấu hình credentials lần đầureferences/api-quirks.md — endpoint quirks, rate limit, troubleshootingreferences/batch-operations.md — pattern delay + retry cho batch schedulereferences/crawl-guide.md — troubleshooting scan/crawl: selectors, rate limit, paywalltools
Viết/rà soát/tách user story, acceptance criteria, INVEST, epic, backlog từ requirement/PRD/bug/feature.
tools
Phân tích quyết định/vấn đề bằng Thu Giang Nguyễn Duy Cần: Thuật Tư Tưởng, Dịch Lý, Lão Trang, quân bình.
tools
Phân tích tình huống bằng Kinh Dịch: 64 quẻ, Âm Dương, Ngũ Hành, thời, biến, quân tử.
research
Tạo proposal/đề án có research, business case, technical solution. Trigger: RFP, bid, draft proposal, đề xuất dự án.