[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78CVDKJ33F71WK6KM4K5D0R":3,"skill-same:01M78CVDKJ33F71WK6KM4K5D0R":57},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M78CVDKJ33F71WK6KM4K5D0R","publish-substack",null,"Use when an article under articles\u002Fsubstack\u002F has to reach Substack — \"publish to Substack\", \"put the draft on Substack\", \"опублікуй на сабстек\", \"\u002Fpublish-substack \u003Cslug>\" — or when a post already live on Substack needs its body replaced from the repository. Not for writing the article (write-article) and not for other outlets.","atretyak1985\u002Fswarmery","atretyak1985","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1436737?v=4","01M78CTSX57YH0EYY9YGH0TWKX","Andrii Tretiak","01M78CTSXRPJPYQ7GNPMP45TYX",8,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpublish-substack\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: publish-substack\ndescription: Use when an article under articles\u002Fsubstack\u002F has to reach Substack — \"publish to Substack\", \"put the draft on Substack\", \"опублікуй на сабстек\", \"\u002Fpublish-substack \u003Cslug>\" — or when a post already live on Substack needs its body replaced from the repository. Not for writing the article (write-article) and not for other outlets.\nargument-hint: \"\u003Cslug>\"\n---\n\n# Publish to Substack\n\nSubstack has no publishing API. The body is pasted into its web editor in the\nauthor's own signed-in Chrome, and that editor discards what its schema cannot\nhold without reporting anything: a table, a link around inline code, a subtitle\none character too long that stops the whole draft saving. So nothing here trusts\nthe screen. The build refuses what is known to be dropped, and after the paste\nthe draft Substack **saved** is read back and compared with what went in.\n\nA run ends at a **draft**. Publishing emails every subscriber and cannot be\nundone, so it happens only when the author, having seen the draft, says so in\nthis session and says whether the email goes out.\n\n## Before starting\n\n- `pandoc` is installed.\n- Chrome with the Claude extension is signed in to Substack. Drive it with the\n  `claude-in-chrome` tools; the Playwright browser is a separate profile with no\n  session.\n- The article's images are committed and pushed. Substack fetches them from\n  GitHub at paste time.\n- The publication address is the one line in `articles\u002Fsubstack\u002FPUBLICATION`\n  (`https:\u002F\u002F\u003Cname>.substack.com`). When the file is missing, ask the author and\n  write it.\n\n## 1. Build\n\n```bash\npython3 .claude\u002Fskills\u002Fpublish-substack\u002Fscripts\u002Fbuild-substack.py articles\u002Fsubstack\u002F\u003Cslug>\n```\n\nIt prints a manifest (title, subtitle, link targets, code blocks with their line\ncounts, image count) and writes `build\u002Fsubstack.html`, `build\u002Fmanifest.json` and\na copy of the editor helper. When it lists problems, fix each one in\n`article.md` and build again.\n\n## 2. Carry the article into the editor tab\n\nThe editor page's security policy blocks any request to the local machine, and\nHTML retyped into a tool call gets corrupted without a trace. `window.name`\nsurvives a navigation in the same tab, so the bytes travel there.\n\n1. Serve the build directory, in the background:\n   `python3 -m http.server 8901 --bind 127.0.0.1 --directory articles\u002Fsubstack\u002F\u003Cslug>\u002Fbuild`\n2. Open `http:\u002F\u002F127.0.0.1:8901\u002Fsubstack.html` in a new tab and run in the page:\n\n   ```js\n   (async () => {\n     const get = async (path) => (await fetch(path)).text();\n     window.name = JSON.stringify({\n       html: await get('\u002Fsubstack.html'),\n       js: await get('\u002Fsubstack-editor.js'),\n       meta: JSON.parse(await get('\u002Fmanifest.json')),\n     });\n     return window.name.length;\n   })()\n   ```\n\n3. Navigate **the same tab** to `\u003Cpublication>\u002Fpublish\u002Fpost?type=newsletter`.\n   That address creates a new draft and redirects to `\u002Fpublish\u002Fpost\u002F\u003Cid>`, so\n   open it once per article and keep the id. If it lands on a sign-in page,\n   stop and ask the author to sign in.\n\n## 3. Paste, then read back what was saved\n\nRun in the editor page, one call at a time, reading each result. Each call is a\nsingle expression, because a top-level `const` declared in one call makes the\nnext call that declares it fail:\n\n```js\n(() => { const p = JSON.parse(window.name); (0, eval)(p.js); return JSON.stringify(ss.prepare(p.html)); })()\n```\n\n```js\nss.paste().then(JSON.stringify)\n```\n\n```js\n(() => { const m = JSON.parse(window.name).meta; return JSON.stringify(ss.setTitle(m.title, m.subtitle)); })()\n```\n\n```js\nss.audit().then(JSON.stringify)\n```\n\nA result of `{refused: …}` is a guard that fired. Read the reason and fix the\ncondition it names.\n\nCompare the audit with the manifest:\n\n- every manifest `links` target is in the audit's `links`\n- `codeBlockLines` are equal, in order\n- the image count is equal and every image has `rehosted: true`\n- `types` holds no `latex_block`\n- `title` and `subtitle` are equal to the manifest's\n\nOn a difference, find its cause in `article.md` and fix it there. Then run\n`await ss.clear(\u003Cid>)`, rebuild, and repeat steps 2 and 3, returning to\n`\u003Cpublication>\u002Fpublish\u002Fpost\u002F\u003Cid>` this time, since the create address would\nstart a second draft.\n\n## 4. Stop at the draft\n\nStop the local server. Give the author the draft's address and the comparison,\nline by line. The author reads the draft in the editor.\n\n## 5. Publish, on the author's word\n\nBefore the click, the author has said in this session to publish this article\nand has answered whether subscribers get the email.\n\n1. `await ss.openPublish()` and read its `settings` back to the author:\n   audience, comments, email, scheduling, and the button's label.\n2. `await ss.publish({email: \u003Ctheir answer>, audience: \"everyone\"})`. It refuses\n   when any setting differs from what it was given.\n3. `await ss.published(\u003Cid>)`. Take the address from this response: Substack\n   cuts the slug short, so it cannot be derived from the title.\n4. Write `substack = \u003Curl>` to the article's `links.txt` and set\n   `published: true` in its front matter.\n\n## Updating a post that is live\n\nOpen `\u003Cpublication>\u002Fpublish\u002Fpost\u002F\u003Cid>`, run `await ss.clear(\u003Cid>)`, then steps\n2 and 3 against that address. `ss.openPublish()` then shows the button\n`Update now` with no email setting; `await ss.publish({update: true})` replaces\nthe live body and sends nothing to subscribers.\n\n## Where the helper comes from\n\n`scripts\u002Fsubstack-editor.js` is vendored unmodified from\n[publishing-kit](https:\u002F\u002Fgithub.com\u002Fxbill9\u002Fpublishing-kit) (Apache-2.0). What it\ndoes was measured by its author against Substack's editor on 2026-10-05. When a\nhelper refuses, or the audit differs, in a way `article.md` does not explain,\nthe editor has probably changed: read upstream's\n`skills\u002Fpublishing\u002Freferences\u002Fsubstack.md` and the current helper before\nchanging anything here.\n","# Publish to Substack\n\nSubstack has no publishing API. The body is pasted into its web editor in the\nauthor's own signed-in Chrome, and that editor discards what its schema cannot\nhold without reporting anything: a table, a link around inline code, a subtitle\none character too long that stops the whole draft saving. So nothing here trusts\nthe screen. The build refuses what is known to be dropped, and after the paste\nthe draft Substack **saved** is read back and compared with what went in.\n\nA run ends at a **draft**. Publishing emails every subscriber and cannot be\nundone, so it happens only when the author, having seen the draft, says so in\nthis session and says whether the email goes out.\n\n## Before starting\n\n- `pandoc` is installed.\n- Chrome with the Claude extension is signed in to Substack. Drive it with the\n  `claude-in-chrome` tools; the Playwright browser is a separate profile with no\n  session.\n- The article's images are committed and pushed. Substack fetches them from\n  GitHub at paste time.\n- The publication address is the one line in `articles\u002Fsubstack\u002FPUBLICATION`\n  (`https:\u002F\u002F\u003Cname>.substack.com`). When the file is missing, ask the author and\n  write it.\n\n## 1. Build\n\n```bash\npython3 .claude\u002Fskills\u002Fpublish-substack\u002Fscripts\u002Fbuild-substack.py articles\u002Fsubstack\u002F\u003Cslug>\n```\n\nIt prints a manifest (title, subtitle, link targets, code blocks with their line\ncounts, image count) and writes `build\u002Fsubstack.html`, `build\u002Fmanifest.json` and\na copy of the editor helper. When it lists problems, fix each one in\n`article.md` and build again.\n\n## 2. Carry the article into the editor tab\n\nThe editor page's security policy blocks any request to the local machine, and\nHTML retyped into a tool call gets corrupted without a trace. `window.name`\nsurvives a navigation in the same tab, so the bytes travel there.\n\n1. Serve the build directory, in the background:\n   `python3 -m http.server 8901 --bind 127.0.0.1 --directory articles\u002Fsubstack\u002F\u003Cslug>\u002Fbuild`\n2. Open `http:\u002F\u002F127.0.0.1:8901\u002Fsubstack.html` in a new tab and run in the page:\n\n   ```js\n   (async () => {\n     const get = async (path) => (await fetch(path)).text();\n     window.name = JSON.stringify({\n       html: await get('\u002Fsubstack.html'),\n       js: await get('\u002Fsubstack-editor.js'),\n       meta: JSON.parse(await get('\u002Fmanifest.json')),\n     });\n     return window.name.length;\n   })()\n   ```\n\n3. Navigate **the same tab** to `\u003Cpublication>\u002Fpublish\u002Fpost?type=newsletter`.\n   That address creates a new draft and redirects to `\u002Fpublish\u002Fpost\u002F\u003Cid>`, so\n   open it once per article and keep the id. If it lands on a sign-in page,\n   stop and ask the author to sign in.\n\n## 3. Paste, then read back what was saved\n\nRun in the editor page, one call at a time, reading each result. Each call is a\nsingle expression, because a top-level `const` declared in one call makes the\nnext call that declares it fail:\n\n```js\n(() => { const p = JSON.parse(window.name); (0, eval)(p.js); return JSON.stringify(ss.prepare(p.html)); })()\n```\n\n```js\nss.paste().then(JSON.stringify)\n```\n\n```js\n(() => { const m = JSON.parse(window.name).meta; return JSON.stringify(ss.setTitle(m.title, m.subtitle)); })()\n```\n\n```js\nss.audit().then(JSON.stringify)\n```\n\nA result of `{refused: …}` is a guard that fired. Read the reason and fix the\ncondition it names.\n\nCompare the audit with the manifest:\n\n- every manifest `links` target is in the audit's `links`\n- `codeBlockLines` are equal, in order\n- the image count is equal and every image has `rehosted: true`\n- `types` holds no `latex_block`\n- `title` and `subtitle` are equal to the manifest's\n\nOn a difference, find its cause in `article.md` and fix it there. Then run\n`await ss.clear(\u003Cid>)`, rebuild, and repeat steps 2 and 3, returning to\n`\u003Cpublication>\u002Fpublish\u002Fpost\u002F\u003Cid>` this time, since the create address would\nstart a second draft.\n\n## 4. Stop at the draft\n\nStop the local server. Give the author the draft's address and the comparison,\nline by line. The author reads the draft in the editor.\n\n## 5. Publish, on the author's word\n\nBefore the click, the author has said in this session to publish this article\nand has answered whether subscribers get the email.\n\n1. `await ss.openPublish()` and read its `settings` back to the author:\n   audience, comments, email, scheduling, and the button's label.\n2. `await ss.publish({email: \u003Ctheir answer>, audience: \"everyone\"})`. It refuses\n   when any setting differs from what it was given.\n3. `await ss.published(\u003Cid>)`. Take the address from this response: Substack\n   cuts the slug short, so it cannot be derived from the title.\n4. Write `substack = \u003Curl>` to the article's `links.txt` and set\n   `published: true` in its front matter.\n\n## Updating a post that is live\n\nOpen `\u003Cpublication>\u002Fpublish\u002Fpost\u002F\u003Cid>`, run `await ss.clear(\u003Cid>)`, then steps\n2 and 3 against that address. `ss.openPublish()` then shows the button\n`Update now` with no email setting; `await ss.publish({update: true})` replaces\nthe live body and sends nothing to subscribers.\n\n## Where the helper comes from\n\n`scripts\u002Fsubstack-editor.js` is vendored unmodified from\n[publishing-kit](https:\u002F\u002Fgithub.com\u002Fxbill9\u002Fpublishing-kit) (Apache-2.0). What it\ndoes was measured by its author against Substack's editor on 2026-10-05. When a\nhelper refuses, or the audit differs, in a way `article.md` does not explain,\nthe editor has probably changed: read upstream's\n`skills\u002Fpublishing\u002Freferences\u002Fsubstack.md` and the current helper before\nchanging anything here.\n",{"name":5,"description":7,"argument-hint":24},"\u003Cslug>","main","2d9e918cc79c9b17b59356780ff0a3da38a3e98a",".claude\u002Fskills\u002Fpublish-substack",5,"https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery","https:\u002F\u002Fatretyak1985.github.io\u002Fswarmery\u002F","https:\u002F\u002Fgithub.com\u002Fatretyak1985","2026-11-11 04:29:12",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add atretyak1985\u002Fswarmery --skill publish-substack",{"tool":39,"command":40},"bunx","bunx skills add atretyak1985\u002Fswarmery --skill publish-substack",{"tool":42,"command":43},"pnpm","pnpm dlx skills add atretyak1985\u002Fswarmery --skill publish-substack","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpublish-substack\u002FSKILL.md",true,[47,53],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"scripts\u002Fbuild-substack.py","SCRIPT","脚本",9900,"https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpublish-substack\u002Fscripts\u002Fbuild-substack.py",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"scripts\u002Fsubstack-editor.js",14041,"https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpublish-substack\u002Fscripts\u002Fsubstack-editor.js",[58,65,71,78,85,92],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M78D4T1FFWFW19Z44AHH5BSY","short-desc","Too short.","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fskills\u002Fshort-desc\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M78D4S0TWT42WXFJHC1DBN0R","no-frontmatter","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fskills\u002Fno-frontmatter\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M78D4Q14P8DJ4W78N62F3EG2","global-skill","Fixture global skill (minimal user-scope shape, format doc §2.3).","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fskills\u002Fglobal-skill\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M78D4N1JHGQJQ7EZ43KY5SV3","documented-skill","Fixture skill whose usage guide deliberately omits the Worked example subsection.","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fskills\u002Fdocumented-skill\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M78D4KVNZ03GBKGDFJZWW5FJ","z","NOT auto-discovered — only skills\u002F is scanned for plugins (§2.2).","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fplugins\u002Fcache\u002Fmkt\u002Ftoolpack\u002F1.0.0\u002Fworkflow-skills\u002Fz\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M78D4JMBRZWK51HFE5RZJGHC","y","Plugin skill y from toolpack — stored as \"toolpack:y\".","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fplugins\u002Fcache\u002Fmkt\u002Ftoolpack\u002F1.0.0\u002Fskills\u002Fy\u002FSKILL.md",[],[]]