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

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.

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
  1. Very specific:

    Use the bundled script for deterministic publishing.

    line 8
  2. Very specific:

    Keep brief_content at 100 characters or fewer.

    line 15
  3. Very specific:

    Use JSON arrays for tag_ids, column_ids, theme_ids, and pics.

    line 16
  4. Distinctive:

    Start with the introduction or an H2 section.

    line 17
  5. Distinctive:

    Keep one source file per intended Juejin article.

    line 18
  6. Distinctive:

    Read traffic-contract.md only when debugging an API or authentication change.

    line 20
  7. Distinctive:

    Always preview before a live write:

    line 24
  8. Very specific:

    Check the title, category, tags, action, and word counts in the JSON output.

    line 32
  9. Distinctive:

    Use the read-only authentication check when diagnosing the captured session:

    line 34
  10. Very specific:

    Use --draft-only when the user asks for a draft.

    line 44
  11. Very specific:

    Read Cookie and x-secsdk-csrf-token locally with bifrost traffic get.

    line 61
  12. Distinctive:

    Verify authentication against the Juejin user endpoint.

    line 62
  13. Distinctive:

    Create or reuse a draft, update all metadata/content, then publish.

    line 63
  14. Distinctive:

    After publishing or updating an article, pass only its numeric article ID to confirm that Edge can load the rendered title and body:

    line 70
  15. Very specific:

    Use --close-delay-ms 0 only in automated tests that do not need the visible stability window.

    line 88
  16. Distinctive:

    If no usable capture exists or Juejin rejects it, allow the default recovery flow.

    line 101
  17. Very specific:

    Use --no-browser only for CI or when the user forbids browser interaction.

    line 103
  18. Very specific:

    Do not use --force-new unless the user explicitly wants a second article from the same source file.

    line 107
  19. Distinctive:

    Do not retry non-auth API errors as authentication failures.

    line 108
  20. Distinctive:

    Keep the default state file under the user's local state directory.

    line 111
  21. Very specific:

    Use JUEJIN_PUBLISH_STATE_FILE or --state-file only for isolation/testing.

    line 112

≈ “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

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, nonzero category_id, and at least one numeric tag_ids entry.
  • Keep brief_content at 100 characters or fewer; omit it to derive a summary.
  • Use JSON arrays for tag_ids, column_ids, theme_ids, and pics.
  • 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-run

Check 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-auth

It 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 \
  --publish

The script performs the observed sequence:

  1. Find the newest Juejin request with bifrost search.
  2. Read Cookie and x-secsdk-csrf-token locally with bifrost traffic get.
  3. Verify authentication against the Juejin user endpoint.
  4. Create or reuse a draft, update all metadata/content, then publish.
  5. 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 1234567890

The 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.md

Strict 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 3

The 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-new unless 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_FILE or --state-file only for isolation/testing.
  • JUEJIN_API_BASE and --api-base accept only https://api.juejin.cn or 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-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.