agentleFS
bifrost-proxybifrost-proxy/bifrost/.agents/skills/zhihu-publish/SKILL.md

zhihu-publish

Skill168 starsChanged 3 months agoMITView on GitHub

Publish Markdown articles to Zhihu Columns through authentication context recovered locally from Bifrost traffic and a built-in publish payload schema, save drafts, prevent duplicate posts, and verify the live title/body without browser automation. Use when the user asks to create, preview, save, publish, repost, or验收 a 知乎/知乎专栏/Zhihu article, or automate future Zhihu article releases from Markdown.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. Harzva/learn-likecc★ 57same name
    2. momo0338/skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository10 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 9 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never print or save Cookie values, XSRF tokens, x-zse-*, x-zst-*, raw request headers, or unredacted Bifrost traffic.

    line 10
  2. Distinctive:

    Start the body with the introduction or an H2.

    line 16
  3. Distinctive:

    Keep one source file per intended article so duplicate prevention remains stable.

    line 17
  4. Distinctive:

    Read traffic-contract.md only when diagnosing a Zhihu API or capture change.

    line 22
  5. Distinctive:

    Always run a dry run before a live write:

    line 26
  6. Distinctive:

    Check the captured authentication/signing state without exposing credentials:

    line 36
  7. Very specific:

    Use --draft-only for a Zhihu draft.

    line 44
  8. Very specific:

    Read only their authentication and endpoint-specific signing headers locally with bifrost traffic get.

    line 59
  9. Distinctive:

    Create or resume a draft, then update title and HTML content.

    line 60
  10. Very specific:

    Treat already_published as successful duplicate prevention.

    line 64
  11. Distinctive:

    After publishing, compare the rendered title and body with the source without browser automation:

    line 89
  12. Distinctive:

    Never weaken assertions or retry validation errors as authentication failures.

    line 118
  13. Distinctive:

    Verify the live page after every real publish.

    line 120

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Zhihu Publish

Use the bundled scripts for deterministic publishing. Do not operate Chrome or another browser through UI automation. Read only authentication and endpoint-specific signing context from Bifrost traffic. The stable publish payload schema is built into the script; never read a captured request body as a reusable template.

Never print or save Cookie values, XSRF tokens, x-zse-*, x-zst-*, raw request headers, or unredacted Bifrost traffic.

Prepare the article

Copy article.template.md and fill title. The remaining fields are optional.

  • Start the body with the introduction or an H2; do not repeat the title as an H1.
  • Keep one source file per intended article so duplicate prevention remains stable.
  • Existing frontmatter fields for another platform are allowed and ignored.
  • The renderer supports headings, paragraphs, lists, links, images, inline code, fenced code blocks, blockquotes, emphasis, and horizontal rules.
  • Images may use HTTP(S), a local JPEG/PNG/GIF/WebP/BMP path relative to the article, an absolute local image path, or a matching base64 data URI. Live writes transfer every non-Zhihu image to Zhihu first; SVG and files over 20 MiB are rejected.

Read traffic-contract.md only when diagnosing a Zhihu API or capture change.

Preview

Always run a dry run before a live write:

.agents/skills/zhihu-publish/scripts/zhihu-publish \
  --article /absolute/path/article.md \
  --dry-run

Confirm the title, Markdown/HTML character counts, action, duplicate state, and image counts. Dry-run never uploads an image.

Check the captured authentication/signing state without exposing credentials:

.agents/skills/zhihu-publish/scripts/zhihu-publish --check-auth

Save a draft or publish

Use --draft-only for a Zhihu draft. Use --publish only when the user explicitly requests publication.

.agents/skills/zhihu-publish/scripts/zhihu-publish \
  --article /absolute/path/article.md \
  --draft-only

.agents/skills/zhihu-publish/scripts/zhihu-publish \
  --article /absolute/path/article.md \
  --publish

The script performs the captured workflow:

  1. Find recent Zhihu draft and publish requests with bifrost search.
  2. Read only their authentication and endpoint-specific signing headers locally with bifrost traffic get.
  3. Create or resume a draft, then update title and HTML content.
  4. Assemble the built-in publish payload schema with the new draft ID, title, content, disclosure settings, and trace ID.
  5. Publish and store only IDs, URL, and a content hash in local state.

Treat already_published as successful duplicate prevention. Do not use --force-new unless the user explicitly wants a second post from the same source.

To change the same already-published article, require explicit user intent and pass --update-existing:

.agents/skills/zhihu-publish/scripts/zhihu-publish \
  --article /absolute/path/article.md \
  --publish \
  --update-existing

To adopt a known existing Zhihu article into the local idempotency state, require explicit user intent and pass its numeric ID. This is useful for replacing a temporary protocol-probe article without editing the state file by hand:

.agents/skills/zhihu-publish/scripts/zhihu-publish \
  --article /absolute/path/article.md \
  --publish \
  --update-existing \
  --article-id 1234567890

The live workflow uploads remote images through POST /api/uploaded_images, uploads local/data images as multipart picture, accepts only HTTPS URLs on Zhihu's allowlisted upload hosts (*.zhimg.com or the exact pic-private.zhihu.com host), and emits standalone images as <figure> nodes before saving or publishing. The private upload URL is temporary; Zhihu must rewrite the published article to stable *.zhimg.com content.

Verify the live article

After publishing, compare the rendered title and body with the source without browser automation:

.agents/skills/zhihu-publish/scripts/zhihu-verify ARTICLE_ID \
  --article /absolute/path/article.md

The verifier reuses safe, local Bifrost request context to load Zhihu, normalizes rendered text, rejects a duplicated title at the start of the body, and requires the expected image count with every public image hosted on stable HTTPS *.zhimg.com. It returns status=verified only when text and images both match.

Authentication recovery

The scripts first reuse the newest valid Bifrost capture. If no usable capture exists, do not copy cookies manually. Ask the user to open the Zhihu editor and perform one normal save or publish while Bifrost is running, then retry.

For a bounded capture command, use:

bifrost capture wait \
  --host zhuanlan.zhihu.com \
  --path /api/articles/drafts \
  --method POST \
  --timeout 5m \
  --format json

A formal publish also needs a recent POST www.zhihu.com/api/v4/content/publish capture because Zhihu supplies endpoint-specific signing headers. Its request body is not read or reused.

Safety and validation

  • Accept production API bases only on https://zhuanlan.zhihu.com and https://www.zhihu.com; allow loopback only for tests.
  • Never weaken assertions or retry validation errors as authentication failures.
  • Persist a new draft ID before updating it so interrupted runs resume without creating duplicates.
  • Verify the live page after every real publish.
  • Validate changes with:
node --test .agents/skills/zhihu-publish/scripts/*.test.mjs
python3 /Users/eden_studio/.codex/skills/.system/skill-creator/scripts/quick_validate.py \
  .agents/skills/zhihu-publish

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.