skills/publish-zsxq-article/SKILL.md
Publish Markdown articles to Zsxq (知识星球) as drafts. Use when user wants to publish a Markdown file to Zsxq, or mentions "发布到知识星球", "星球文章", "zsxq article". Handles Markdown content input and saves as draft (never auto-publish).
npx skillsauth add sugarforever/01coder-agent-skills publish-zsxq-articleInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Publish Markdown content to Zsxq (知识星球) article editor in Markdown mode, saving as draft for user review before publishing.
mcp__chrome-devtools__*)mcp__playwright__*)This skill works with both Chrome DevTools MCP and Playwright MCP:
| Action | Chrome DevTools MCP | Playwright MCP |
|--------|---------------------|----------------|
| Navigate | navigate_page | browser_navigate |
| Take snapshot | take_snapshot | browser_snapshot |
| Take screenshot | take_screenshot | browser_take_screenshot |
| Click element | click | browser_click |
| Fill text | fill | browser_type |
| Upload file | upload_file | browser_file_upload |
| Press key | press_key | browser_press_key |
| Evaluate JS | evaluate_script | browser_evaluate |
Priority: Default to Playwright MCP. Use Chrome DevTools MCP only when Playwright MCP is unavailable.
Detection: At runtime, prefer mcp__playwright__browser_navigate. Fall back to mcp__chrome-devtools__navigate_page only if Playwright tools are not available.
https://wx.zsxq.com/loginhttps://wx.zsxq.com/article?groupId={groupId}The Zsxq group ID is required to navigate to the article editor (the groupId= URL parameter). Do not hardcode a default.
Before any navigation, resolve the group ID in this order:
ZSXQ_GROUP_ID (optional, for users who publish repeatedly to the same group).请提供知识星球的 group ID(在星球 URL 里
groupId=之后那串数字)。
Do not proceed to Step 2 (Navigate) without a resolved group ID.
The Zsxq article editor has two modes:
IMPORTANT: Content Insertion Method The Milkdown editor requires content to be inserted via paste event, NOT direct fill:
fill tool → Content treated as plain text, Markdown NOT rendered.ProseMirror class)Read the Markdown file and extract:
title field, or H1 header # Title, or filename--- delimited block at the top)<!-- ... -->)---) — Milkdown's paste handler misparses ---, causing subsequent headings and formatting to break (e.g., ## rendered as bold ** text instead of H2). Remove all --- lines before pasting.# Read the markdown file
cat /path/to/article.md
# Navigate to the article editor with the resolved group ID (see Group ID Resolution above)
navigate_page: https://wx.zsxq.com/article?groupId={groupId}
If not logged in, the page will redirect to login. Prompt user to log in manually:
请先登录知识星球,登录完成后告诉我。
Login URL: https://wx.zsxq.com/login
After page loads, check if already in Markdown mode by looking for "切换到富文本模式" text.
If in Rich Text mode (shows "切换到 Markdown 模式"):
// Check current mode
const switchBtn = document.querySelector('[class*="switch"]');
if (switchBtn && switchBtn.innerText.includes('切换到 Markdown')) {
// Need to switch to Markdown mode
}
click: title textbox
fill: title textbox with article title
CRITICAL: Do NOT use fill tool - it inserts plain text without Markdown rendering.
Instead, use evaluate_script to simulate a paste event:
// Simulate paste event to trigger Milkdown's Markdown parsing
() => {
const markdownContent = `YOUR_MARKDOWN_CONTENT_HERE`;
const editorEl = document.querySelector('.ProseMirror');
if (!editorEl) return { error: 'Editor not found' };
// Focus the editor
editorEl.focus();
// Create and dispatch paste event
const clipboardData = new DataTransfer();
clipboardData.setData('text/plain', markdownContent);
const pasteEvent = new ClipboardEvent('paste', {
bubbles: true,
cancelable: true,
clipboardData: clipboardData
});
editorEl.dispatchEvent(pasteEvent);
return { success: true, charCount: markdownContent.length };
}
This method:
IMPORTANT: Always save as draft, NEVER click "发布" (Publish)
click: "保存" button
After saving:
草稿已保存。请在知识星球中预览并手动发布。
Draft saved. Please review in Zsxq and publish manually.
User: "把 /path/to/my-article.md 发布到知识星球"
1. Read /path/to/my-article.md
- Extract title from frontmatter or H1
- Strip frontmatter, H1 title, HTML comments, and horizontal rules (`---`)
- Get cleaned content
2. Navigate to https://wx.zsxq.com/article?groupId={resolved groupId}
3. Check if logged in
- If not, prompt user to login
4. Switch to Markdown mode if needed
- Click "切换到 Markdown 模式 (内测)"
- Confirm dialog
5. Fill title
- Click title input
- Use `fill` tool to set title text
6. Insert content via paste event
- Use `evaluate_script` to simulate paste event
- This triggers Milkdown to parse and render Markdown
7. Save as draft
- Click "保存"
8. Report success
- "草稿已保存,请手动预览并发布"
ZSXQ_GROUP_ID env var, or user prompt before any navigation (see Group ID Resolution)If you see raw Markdown syntax like **bold** or [link](url) instead of rendered formatting:
fill tool instead of paste eventevaluate_script method to simulate a paste event (see Step 5)The Milkdown editor only parses Markdown when content is pasted, not when directly set.
---) Break FormattingIf headings appear as bold text with ** markers, or formatting is garbled after a --- line:
--- (horizontal rule), corrupting subsequent Markdown elements--- lines from the content before pasting. The article can use headings for section separation instead.If page redirects or shows login prompt:
请先登录知识星球: https://wx.zsxq.com/login
登录完成后告诉我。
Zsxq has a 100,000 character limit. If content exceeds:
文章内容超过100000字符限制,请考虑拆分文章。
When switching to Markdown mode, a confirmation dialog appears:
If editor elements are not visible:
| Element | Selector/Identifier | Description |
|---------|---------------------|-------------|
| Title input | textbox "请在这里输入标题" | Article title (max 60 chars) |
| Content area | .ProseMirror (Milkdown editor) | Markdown content (max 100000 chars) |
| Save button | "保存" | Save as draft |
| Preview button | "预览" | Preview article |
| Publish button | "发布" | DO NOT USE |
| Mode switch | "切换到 Markdown 模式" / "切换到富文本模式" | Toggle editor mode |
| Tags | "添加标签" | Add article tags |
| Word count | "正文字数:X /100000" | Character counter |
Image upload works in both Rich Text mode and Markdown mode using the upload_file tool.
ls -la /path/to/image.png to check file sizeImage upload works with the image button in both editor modes:
Take snapshot to find the image button ref/uid
button "image"generic description="Add image"Upload image
Chrome DevTools MCP:
upload_file:
uid: <image button uid>
filePath: /path/to/image.png
Playwright MCP:
browser_file_upload:
ref: <image button ref>
paths: ["/path/to/image.png"]
Verify upload - take screenshot to confirm image appears in editor
| Mode | Image Button | Selector in Snapshot |
|------|-------------|---------------------|
| Rich Text | button "image" | button "image" |
| Markdown | Add image | generic description="Add image" |
# 1. Take verbose snapshot to find image button
take_snapshot(verbose=true)
# 2. Find "Add image" button (e.g., uid=26_59)
# Look for: generic description="Add image"
# 3. Upload image directly to the button
upload_file:
uid: 26_59 # (example uid for "Add image" button)
filePath: /Users/user/Downloads/image.png
# 4. Verify with screenshot
take_screenshot
# 1. Take snapshot to find image button
take_snapshot
# 2. Find image button (e.g., uid=12_7)
# Look for: button "image"
# 3. Upload image to the button
upload_file:
uid: 12_7 # (example uid for image button)
filePath: /Users/user/Downloads/image.png
# 4. Verify with screenshot
take_screenshot
# Check size
ls -la /path/to/image.png
# Compress if needed (macOS)
sips -s format jpeg -s formatOptions 80 /path/to/image.png --out /path/to/image_compressed.jpg
Image not appearing after upload:
Finding the correct button uid:
take_snapshot(verbose=true) to see element descriptionsgeneric description="Add image"button "image"The Zsxq article editor uses two different editors:
upload_file tool to button "image"upload_file tool to generic description="Add image"This is why the user's workflow via md.bytenote.net works - pasting from any source triggers Milkdown's Markdown parser, resulting in properly rendered content.
tools
Design typography-driven video cover images using HTML/CSS + Chrome DevTools screenshot. Generates covers in all needed aspect ratios - 16:9 (YouTube), 16:10 (Bilibili), 9:16 and 3:4 (抖音/视频号 竖屏短视频) - with big readable text. Different from `cover-image` (AI hand-drawn aesthetic) - this is precise typography control via code. Use when user asks for "视频封面", "thumbnail", "做封面", "cover design", "缩略图", "横屏/竖屏封面", "抖音封面", "视频号封面".
documentation
Plan videos and prepare publishing materials for YouTubers/UP主. Use when user wants to plan a video, write a script (口播稿) with on-screen / screen-share cues, generate video title, description, tags, or YouTube chapter timestamps. Triggers on "策划视频", "写视频脚本", "视频口播稿", "video planner", "video script", "prepare video", "视频发布素材", or mentions creating content for YouTube/Bilibili.
testing
Apply the user's Chinese writing style when writing, translating, editing, proofreading, polishing, or publishing Chinese content, including blog posts, articles, subtitles, captions, tweets/X posts, threads, newsletters, and social posts. Enforce punctuation rules, especially Chinese curved quotes, halfwidth dash " - ", ASCII ellipsis "......", and no leftover fullwidth/English punctuation in Chinese body text.
tools
Use when an agent needs to delegate a task to the OpenAI Codex CLI from another agent environment such as Claude Code, OpenClaw, or similar. Covers checking whether Codex CLI is installed, running one-off Codex prompts with `codex exec`, resuming sessions, collecting outputs, attaching images or files as input with `-i`/stdin, and handling Codex image generation including finding and reporting generated image file paths.