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 skills add https://github.com/sugarforever/01coder-agent-skills --skill publish-zsxq-article
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 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:
button "image"generic description="Add 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"]
| 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.
Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks
Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.
Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.
Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.
Use this skill any time a .pptx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates, layouts, speaker notes, or comments. Trigger whenever the user mentions \"deck,\" \"slides,\" \"presentation,\" or references a .pptx filename, regardless of what they plan to do with the content afterward. If a .pptx file needs to be opened, created, or touched, use this skill.
Create and edit Obsidian Flavored Markdown with wikilinks, embeds, callouts, properties, and other Obsidian-specific syntax. Use when working with .md files in Obsidian, or when the user mentions wikilinks, callouts, frontmatter, tags, embeds, or Obsidian notes.
Take sugarforever/publish-zsxq-article from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.