Zhihu md publisher

From fanfan-de/anybox · View interactive version

Zhihu md publisher is an AI agent skill from the GitHub repository fanfan-de/anybox. Publish local Markdown articles to Zhihu from Codex. Use when the user asks to prepare, validate, automate, upload, or publish a .md article to Zhihu/Zhuanlan, including parsing frontmatter, resolving local images, filling the Zhihu editor, setting topics, handling draft links, and updating the sour

How to use this skill

Skill file

Zhihu Markdown Publisher

Use this skill to move a local Markdown article into Zhihu's article editor and publish it with images. Treat Zhihu login, CAPTCHA, and final publishing as live external actions.

Required Inputs

Expect a Markdown article path. If the user does not provide one, search the workspace for likely Zhihu drafts under paths such as 03_内容生产/知乎.

The article should have frontmatter:

---
zhihu-title: 文章标题
zhihu-topics:
  - 大语言模型
  - 桌面应用
zhihu-cover:
zhihu-link:
---

Support body images in either Markdown or Obsidian wiki syntax:

![说明](../../assets/screenshot.png)
![[assets/screenshot.png|说明]]

Workflow

  1. Run the bundled preparer:
node "<skill-dir>\scripts\prepare-zhihu-article.mjs" "<article.md>" "<output-dir>"

Use a workspace output directory such as 07_自动化脚本/out/zhihu. The script writes:

Stop and fix any missing frontmatter or missing images before using the browser.

  1. Open https://zhuanlan.zhihu.com/write in the in-app browser when available. If Zhihu redirects to login, ask the user to finish login/CAPTCHA, then continue.
  1. Fill the editor from the manifest:
  1. Set publishing metadata:
  1. Publish:

Browser Implementation Notes

Use the Browser/in-app browser skill when available. A robust sequence is:

  1. Inspect the current DOM and locate the two textboxes: title then body.
  2. Fill title.
  3. If the body must be cleared, click editor undo until the body is empty if ordinary Ctrl+A does not work. Verify 字数:0 and zero figure elements.
  4. Paste chunks:
await tab.clipboard.write([{ entries: [
  { mimeType: "text/html", text: htmlChunk },
  { mimeType: "text/plain", text: plainChunk }
] }]);
await bodyBox.press("Control+V", { timeoutMs: 10000 });
  1. Paste each image:
await tab.clipboard.write([{ entries: [{
  mimeType: "image/png",
  base64: imageBytes.toString("base64")
}] }]);
await bodyBox.press("Control+V", { timeoutMs: 10000 });

Use image/jpeg for .jpg or .jpeg. Wait briefly after every image paste so Zhihu finishes inserting/uploading it.

Validation Checklist

Before publishing, check:

If any validation fails, do not publish. Restore a clean draft and re-fill it.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.