84 lines
3.9 KiB
Markdown
84 lines
3.9 KiB
Markdown
---
|
||
name: zhihu-write
|
||
description: Use when the user wants to draft, fill, or publish a Zhihu article through browser actions in the Zhihu editor or creator center.
|
||
version: 0.1.0
|
||
author: sgclaw
|
||
tags:
|
||
- zhihu
|
||
- browser
|
||
- writing
|
||
---
|
||
|
||
# Zhihu Write
|
||
|
||
Draft or publish a Zhihu article through the creator center and editor flow. Use this skill for filling article title and body, entering the Zhihu editor, and confirming the publish sequence. Do not use it for generic page navigation or hotlist extraction.
|
||
|
||
## When to Use
|
||
|
||
- The user asks to write, draft, fill, edit, or publish a Zhihu article.
|
||
- The task requires entering the Zhihu editor from creator center or the direct write page.
|
||
- The task requires browser-side verification that the article title or publish URL is correct.
|
||
|
||
Do not use this skill for:
|
||
|
||
- opening ordinary Zhihu pages without editing content
|
||
- collecting hotlist or comment metrics
|
||
- bulk content generation without a clear article title and body
|
||
|
||
## Workflow
|
||
|
||
1. Confirm the article inputs exist and are non-empty: title and body are both required.
|
||
2. Decide whether the run is draft-only or publish mode.
|
||
3. In the SuperRPA browser host, call the packaged browser-script tools before any generic browser probing:
|
||
- `zhihu-write.prepare_article_editor`
|
||
- `zhihu-write.fill_article_draft`
|
||
4. Enter the editor flow described in [editor-flow.md](references/editor-flow.md).
|
||
5. Fill the title first, then the body.
|
||
6. If the task is publish mode, require explicit human confirmation before clicking publish.
|
||
7. After publish, verify the final state using title text and published URL when available.
|
||
8. If a brittle selector is involved, revalidate it using [publish-safety.md](references/publish-safety.md) before acting.
|
||
9. If the editor is blocked by login, verification, or missing permissions, report that explicit state instead of continuing generic probing.
|
||
10. Once draft or publish verification succeeds, stop exploratory browser work.
|
||
|
||
## SuperRPA Interface Contract
|
||
|
||
- Inside the sgClaw browser host, prefer `superrpa_browser` for Zhihu editor actions. `browser_action` is only the compatibility alias.
|
||
- Always pass `expected_domain` as the bare hostname only, for example `www.zhihu.com`.
|
||
- All selectors must be valid CSS selectors because the host executes `document.querySelector(...)`.
|
||
- Never use XPath or jQuery-style pseudo-selectors such as `:contains(...)`.
|
||
- Prefer the packaged browser-script tools over ad-hoc `getText` or `click` probing.
|
||
- In the BrowserAttached host, use canonical `www.zhihu.com` creator routes first.
|
||
- Do not navigate to `zhuanlan.zhihu.com` unless the host policy explicitly allows that domain.
|
||
- Do not retry multiple weak editor selectors when a canonical creator/editor route is available.
|
||
|
||
## Confirmation Rule
|
||
|
||
- Draft-only mode does not require a publish confirmation gate.
|
||
- Publish mode always requires an explicit confirmation from the human operator in the current session.
|
||
- If the user’s wording is ambiguous between draft and publish, default to draft and ask before publishing.
|
||
|
||
## Output
|
||
|
||
Return a concise result with:
|
||
|
||
- article title
|
||
- mode: `draft` or `publish`
|
||
- editor entry path used
|
||
- final URL if one was captured
|
||
- verification result
|
||
- unresolved issues or brittle points encountered
|
||
- whether login/verification/permission state blocked the requested action
|
||
|
||
## References
|
||
|
||
- Use [editor-flow.md](references/editor-flow.md) for the action sequence and verification steps.
|
||
- Use [publish-safety.md](references/publish-safety.md) before any live publish click.
|
||
- Use `assets/zhihu_write_flow.source.json` when the references need exact selector or step names from the source flow.
|
||
|
||
## Common Mistakes
|
||
|
||
- Publishing when the user only asked for a draft.
|
||
- Treating a captured edit URL as proof of successful publication.
|
||
- Ignoring title verification after the publish confirmation flow.
|
||
- Reusing brittle selectors without checking whether a better semantic selector now exists.
|