juejin-publish
Skill168 starsChanged 3 months agoMITView on GitHub
Publish Markdown articles and Bifrost capability series to Juejin, or verify with Microsoft Edge that a published Juejin page's title and body match the local Markdown. Use when the user asks to create, save, publish, or验收 a 掘金/Juejin article, automate future Bifrost article releases, reuse authentication from Bifrost traffic, recover an expired/missing Juejin Cookie, or compare a live post with its source.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- codex-task-inspectorSkill
- design-mdSkill
- e2e-testSkill
- e2e-verifySkill
- github-actions-patSkill
- rust-project-validateSkill
- site-cookie-loginSkill
- zhihu-publishSkill
- bifrostSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. About 0 are common, 11 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use the bundled script for deterministic publishing.
- Very specific: line 15
Keep brief_content at 100 characters or fewer.
- Very specific: line 16
Use JSON arrays for tag_ids, column_ids, theme_ids, and pics.
- Distinctive: line 17
Start with the introduction or an H2 section.
- Distinctive: line 18
Keep one source file per intended Juejin article.
- Distinctive: line 20
Read traffic-contract.md only when debugging an API or authentication change.
- Distinctive: line 24
Always preview before a live write:
- Very specific: line 32
Check the title, category, tags, action, and word counts in the JSON output.
- Distinctive: line 34
Use the read-only authentication check when diagnosing the captured session:
- Very specific: line 44
Use --draft-only when the user asks for a draft.
- Very specific: line 61
Read Cookie and x-secsdk-csrf-token locally with bifrost traffic get.
- Distinctive: line 62
Verify authentication against the Juejin user endpoint.
- Distinctive: line 63
Create or reuse a draft, update all metadata/content, then publish.
- Distinctive: line 70
After publishing or updating an article, pass only its numeric article ID to confirm that Edge can load the rendered title and body:
- Very specific: line 88
Use --close-delay-ms 0 only in automated tests that do not need the visible stability window.
- Distinctive: line 101
If no usable capture exists or Juejin rejects it, allow the default recovery flow.
- Very specific: line 103
Use --no-browser only for CI or when the user forbids browser interaction.
- Very specific: line 107
Do not use --force-new unless the user explicitly wants a second article from the same source file.
- Distinctive: line 108
Do not retry non-auth API errors as authentication failures.
- Distinctive: line 111
Keep the default state file under the user's local state directory.
- Very specific: line 112
Use JUEJIN_PUBLISH_STATE_FILE or --state-file only for isolation/testing.
≈ “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.
Files
Juejin Publish
Use the bundled script for deterministic publishing. Never paste Cookie, CSRF tokens, raw request headers, or unredacted Bifrost traffic into chat, logs, source files, or article content.
Prepare the article
Copy article.template.md and fill the frontmatter:
- Require
title, nonzerocategory_id, and at least one numerictag_idsentry. - Keep
brief_contentat 100 characters or fewer; omit it to derive a summary. - Use JSON arrays for
tag_ids,column_ids,theme_ids, andpics. - Start with the introduction or an H2 section; do not repeat the frontmatter title as the first Markdown H1 because Juejin renders its own article heading.
- Keep one source file per intended Juejin article. The script recognizes both the source path and content hash after publication to prevent duplicates if a file is moved or copied.
Read traffic-contract.md only when debugging an API or authentication change.
Preview
Always preview before a live write:
.agents/skills/juejin-publish/scripts/juejin-publish \
--article /absolute/path/to/article.md \
--dry-runCheck the title, category, tags, action, and word counts in the JSON output. The dry run does not access Bifrost or Juejin.
Use the read-only authentication check when diagnosing the captured session:
.agents/skills/juejin-publish/scripts/juejin-publish --check-authIt reports only the source request ID and Cookie names, never credential values.
Save a draft or publish
Use --draft-only when the user asks for a draft. Use --publish only when the user explicitly asks to publish:
# Save or update a draft
.agents/skills/juejin-publish/scripts/juejin-publish \
--article /absolute/path/to/article.md \
--draft-only
# Publish
.agents/skills/juejin-publish/scripts/juejin-publish \
--article /absolute/path/to/article.md \
--publishThe script performs the observed sequence:
- Find the newest Juejin request with
bifrost search. - Read Cookie and
x-secsdk-csrf-tokenlocally withbifrost traffic get. - Verify authentication against the Juejin user endpoint.
- Create or reuse a draft, update all metadata/content, then publish.
- Save only draft/article IDs and a content hash to the local state file.
Report the returned article URL. Treat already_published as a successful duplicate-prevention result.
Verify the published page with Edge
After publishing or updating an article, pass only its numeric article ID to confirm that Edge can load the rendered title and body:
.agents/skills/juejin-publish/scripts/juejin-verify 1234567890The verifier launches installed Microsoft Edge, navigates exactly once, waits for the rendered article title and body, keeps the loaded window visible for 5 seconds, then closes Edge and exits 0 with status=loaded, the HTTP status, title, body character count, navigation_count=1, and close_delay_ms=5000.
To additionally compare the live title/body with the source Markdown, pass --article:
.agents/skills/juejin-publish/scripts/juejin-verify 1234567890 \
--article /absolute/path/to/article.mdStrict comparison normalizes Markdown/rendered list syntax and requires an exact text match. It also rejects an unexpected duplicate title at the start of the body. A match returns status=verified; any mismatch exits 1 with the first differing text window.
This verification path never reads Bifrost traffic, captures Cookie values, or replays requests. It loads the page once by default and reloads only when --refresh [N] is explicitly supplied. Use --headless only for automated tests; the default opens a visible Edge window.
Use --close-delay-ms 0 only in automated tests that do not need the visible stability window.
For a bounded reload test followed by one final content check, pass a refresh count. Omitting the count defaults to one refresh:
.agents/skills/juejin-publish/scripts/juejin-verify 1234567890 --refresh
.agents/skills/juejin-publish/scripts/juejin-verify 1234567890 --refresh 3The verifier waits 3 seconds before each requested reload and prints progress for every reload. It does not inspect article content between reloads. After all reloads finish, it checks the final page once for a non-empty title and body; when --article is supplied, that final snapshot is also compared with the local Markdown. refresh.complete=true and one entry per reload in refresh.attempts confirm that every requested reload completed. A navigation or HTTP failure stops the run because the page can no longer be checked. Use --refresh-delay-ms to tune the interval. The refresh count is intentionally bounded to 1–1000 to prevent accidental high-volume traffic.
Automatic Cookie recovery
If no usable capture exists or Juejin rejects it, allow the default recovery flow. The script runs bifrost capture wait --open, opens the Juejin editor in the system browser, waits for the user to log in, extracts the new request locally, validates it, and resumes the interrupted operation.
Use --no-browser only for CI or when the user forbids browser interaction. Do not create a separate Cookie file and do not manually copy Cookie values from traffic.
Safety and retry rules
- Do not use
--force-newunless the user explicitly wants a second article from the same source file. - Do not retry non-auth API errors as authentication failures.
- On an auth failure during create/update/publish, refresh once and retry only the failed operation.
- The script rejects conflicting publication modes and persists a newly created draft ID before update, so a transient update failure can resume without creating another draft.
- Keep the default state file under the user's local state directory; it contains no credentials.
- Use
JUEJIN_PUBLISH_STATE_FILEor--state-fileonly for isolation/testing. JUEJIN_API_BASEand--api-baseaccept onlyhttps://api.juejin.cnor a loopback mock endpoint, preventing credentials from being sent to another host.
Validate the skill
node --test .agents/skills/juejin-publish/scripts/*.test.mjs
python3 /Users/eden/.codex/skills/.system/skill-creator/scripts/quick_validate.py \
.agents/skills/juejin-publishDoes 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
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.

