Agent Skillsfanfan-de/anybox › zhihu-md-publisher

zhihu-md-publisher

GitHub

自动化将本地Markdown文章发布至知乎,涵盖解析元数据、处理图片、填充编辑器及更新链接。

.agents/skills/zhihu-md-publisher/SKILL.md fanfan-de/anybox

触发场景

准备发布知乎文章 验证并上传Markdown到知乎

安装

npx skills add fanfan-de/anybox --skill zhihu-md-publisher -g -y
更多选项

非标准路径

npx skills add https://github.com/fanfan-de/anybox/tree/master/.agents/skills/zhihu-md-publisher -g -y

不安装直接使用

npx skills use fanfan-de/anybox@zhihu-md-publisher

指定 Agent (Claude Code)

npx skills add fanfan-de/anybox --skill zhihu-md-publisher -a claude-code -g -y

安装 repo 全部 skill

npx skills add fanfan-de/anybox --all -g -y

预览 repo 内 skill

npx skills add fanfan-de/anybox --list

SKILL.md

Frontmatter
{
    "name": "zhihu-md-publisher",
    "description": "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 source Markdown with the published Zhihu URL."
}

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:

  • <name>.manifest.json: title, topics, cover, image paths, output paths.
  • <name>.html: local preview.
  • <name>.txt: plain-text fallback.

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.

  2. Fill the editor from the manifest:

  • Put manifest.title into the title textbox.
  • Clear the body if it contains an old draft or duplicate content.
  • Paste rich HTML chunks, not raw Markdown, so headings/lists/links render correctly.
  • Paste local images as clipboard image items in the original image order.
  • Verify figure count equals manifest.images.length.
  • Verify raw Markdown heading text such as ## is not present.
  • Verify key tail content and links exist.
  1. Set publishing metadata:
  • Add no more topics than Zhihu accepts. Prefer exact topic suggestions surfaced by Zhihu over forcing frontmatter names.
  • If topic search returns ambiguous results, pick fewer high-confidence topics rather than incorrect ones.
  • Leave column/question/source settings unchanged unless the user explicitly asks.
  • Add a cover only if the page supports it reliably; otherwise rely on the article's first product image.
  1. Publish:
  • Click final 发布 only if the user explicitly asked to publish in this turn or already approved publishing.
  • After success, capture the final URL, usually https://zhuanlan.zhihu.com/p/<id>.
  • Update the article frontmatter zhihu-link: with the final URL.
  • Re-run the preparer once to verify the source still parses.

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:

  • Title textbox contains the intended title.
  • Body has the intro and final paragraph.
  • GitHub/download links are visible and clickable when present.
  • document.querySelectorAll("figure").length equals expected image count.
  • No duplicated body content.
  • No raw heading markers remain, for example ## 是 Agent 工作台.
  • Topics are relevant and visible in publish settings.
  • The 发布 button is enabled.

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

版本历史

  • 08dc189 当前 2026-07-05 18:54

同 Skill 集合

.agents/skills/anybox-frontend-guidelines/SKILL.md
.agents/skills/anybox-mobile-release/SKILL.md
.agents/skills/anybox-plugin/SKILL.md
.agents/skills/deploy-anybox-tencent-docker-windows/SKILL.md
.agents/skills/deploy-anybox-tencent-server/SKILL.md
.agents/skills/fanfande-frontend-style/SKILL.md
.agents/skills/fanfande-plugin-structure/SKILL.md
.agents/skills/frontend-ui-style-kit/SKILL.md
.agents/skills/obsidian-like/SKILL.md
.agents/skills/pdf/SKILL.md
.agents/skills/transcribe/SKILL.md
.anybox/skills/anybox-plugin-development/SKILL.md
.anybox/skills/anybox-start-dev/SKILL.md
packages/chrome-plugin/runtime/skills/chrome/SKILL.md
plugins/Anybox-Plugins/anybox-plugin-development/skills/anybox-plugin-development/SKILL.md
plugins/Anybox-Plugins/atlassian-rovo/skills/capture-tasks-from-meeting-notes/SKILL.md
plugins/Anybox-Plugins/atlassian-rovo/skills/generate-status-report/SKILL.md
plugins/Anybox-Plugins/box/skills/box/SKILL.md
plugins/Anybox-Plugins/browser/skills/browser/SKILL.md
plugins/Anybox-Plugins/build-ios-apps/skills/ios-app-intents/SKILL.md
plugins/Anybox-Plugins/build-ios-apps/skills/ios-debugger-agent/SKILL.md
plugins/Anybox-Plugins/build-ios-apps/skills/ios-ettrace-performance/SKILL.md
plugins/Anybox-Plugins/build-ios-apps/skills/ios-memgraph-leaks/SKILL.md
plugins/Anybox-Plugins/build-ios-apps/skills/ios-simulator-browser/SKILL.md
plugins/Anybox-Plugins/build-ios-apps/skills/swiftui-liquid-glass/SKILL.md
plugins/Anybox-Plugins/build-ios-apps/skills/swiftui-performance-audit/SKILL.md
plugins/Anybox-Plugins/build-ios-apps/skills/swiftui-ui-patterns/SKILL.md
plugins/Anybox-Plugins/build-ios-apps/skills/swiftui-view-refactor/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/appkit-interop/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/build-run-debug/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/liquid-glass/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/packaging-notarization/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/signing-entitlements/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/swiftpm-macos/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/swiftui-patterns/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/telemetry/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/test-triage/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/view-refactor/SKILL.md
plugins/Anybox-Plugins/build-macos-apps/skills/window-management/SKILL.md
plugins/Anybox-Plugins/build-web-apps/skills/frontend-app-builder/SKILL.md
plugins/Anybox-Plugins/build-web-apps/skills/frontend-testing-debugging/SKILL.md
plugins/Anybox-Plugins/build-web-apps/skills/react-best-practices/SKILL.md
plugins/Anybox-Plugins/build-web-apps/skills/shadcn-best-practices/SKILL.md
plugins/Anybox-Plugins/build-web-apps/skills/supabase-best-practices/SKILL.md
plugins/Anybox-Plugins/canva/skills/canva-branded-presentation/SKILL.md
plugins/Anybox-Plugins/canva/skills/canva-resize-for-all-social-media/SKILL.md
plugins/Anybox-Plugins/canva/skills/canva-translate-design/SKILL.md
plugins/Anybox-Plugins/chrome/skills/chrome/SKILL.md
plugins/Anybox-Plugins/cinema/skills/initialize-cinema-project/SKILL.md

元信息

文件数
0
版本
b621dd3
Hash
7c0fbe73
收录时间
2026-07-05 18:54

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-05 02:59
浙ICP备14020137号-1 $访客地图$