一键导入
peng-post-to-x-thread
Publishes X/Twitter threads from Markdown. Splits a Markdown file by
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Publishes X/Twitter threads from Markdown. Splits a Markdown file by
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Posts articles to Medium via Playwright browser automation. Supports Markdown with frontmatter (title, tags, canonical_url, publication_id), draft/publish/unlisted workflow, and cross-posting with canonical URLs. Use when user mentions "post to Medium", "publish Medium", "Medium 发布", "Medium article", or provides medium.com article URLs.
北野茶缸子的思维框架与表达方式。基于19篇公众号文章的深度调研, 提炼5个核心心智模型、7条决策启发式和完整的表达DNA。 用途:作为思维顾问,用北野茶缸子的视角分析问题、审视决策、提供反馈。 当用户提到「用北野茶缸子的视角」「茶缸子会怎么看」「茶缸子模式」时使用。 即使用户只是说「帮我用茶缸子的角度想想」「如果茶缸子会怎么做」也应触发。
Generates Xiaohongshu image cards via Google Gemini and publishes them to 小红书. Single Gemini provider with custom GOOGLE_BASE_URL support. Combined image generation + publishing workflow. Use when user asks to create XHS cards, generate 小红书 images, or post to 小红书.
Convert articles into Reddit-ready posts and recommend target subreddits. Analyzes content, finds matching communities, adapts tone/format per subreddit. Use when user asks to post on Reddit, convert to Reddit format, or find subreddits for their content.
Write and polish XHS post copy: anti-AI tone, first-person voice, character limits. Use when user asks to write, edit, or polish 小红书文案/笔记文案/正文/标题.
Posts URL stories to Hacker News from Markdown. Uses curl-based HTTP authentication (no browser required). Supports preview mode (verify session) and auto-submit. Use when user asks to "post to Hacker News", "submit to HN", "share on Hacker News", or provides a markdown file for HN submission.
| name | peng-post-to-x-thread |
| description | Publishes X/Twitter threads from Markdown. Splits a Markdown file by --- separators into a chain of connected tweets, each replying to the previous one. Supports images per tweet, character validation, preview mode, and configurable delay between posts. Use when user asks to "post thread", "tweet thread", "X thread", "Twitter thread", or provides a markdown file for thread publishing. |
Publish a Markdown file as an X/Twitter thread — a chain of connected tweets where each replies to the previous one. Threads get more visibility than long-form articles because each tweet appears individually in timelines.
{baseDir} = this SKILL.md's directory. Resolve ${BUN_X}: prefer bun; else npx -y bun; else suggest brew install oven-sh/bun/bun.
| Script | Purpose |
|---|---|
scripts/x-thread.ts | Post a markdown file as a thread |
scripts/md-to-thread.ts | Parse and preview thread structure |
Check these paths in order; first hit wins:
| Path | Scope |
|---|---|
.peng-skills/peng-post-to-x-thread/EXTEND.md | Project |
${XDG_CONFIG_HOME:-$HOME/.config}/peng-skills/peng-post-to-x-thread/EXTEND.md | XDG |
$HOME/.peng-skills/peng-post-to-x-thread/EXTEND.md | User home |
Found -> read, parse, apply. Not found -> use defaults.
Supported keys:
| Key | Default | Description |
|---|---|---|
default_delay_ms | 2000 | Delay between tweets (ms) |
auto_submit | false | true = post automatically; false = preview first tweet |
default_profile | (auto) | Chrome profile directory |
Value priority: CLI args -> frontmatter -> EXTEND.md -> skill defaults.
bun runtime (brew install oven-sh/bun/bun)Use --- on its own line to separate tweets. Use  for images.
---
delay_ms: 2000
---
First tweet. The hook that grabs attention.
---
Second tweet, elaborating.

---
Final tweet with a call to action.
See references/thread-format.md for full spec.
Before posting, preview how the markdown will be split:
${BUN_X} {baseDir}/scripts/md-to-thread.ts <file.md>
Output shows each tweet's text, character count, and image count.
${BUN_X} {baseDir}/scripts/x-thread.ts <file.md>
Opens Chrome, fills the first tweet only. You review and can manually submit. Remaining tweets are not posted.
${BUN_X} {baseDir}/scripts/x-thread.ts <file.md> --submit
Posts all tweets in sequence. Each reply chains to the previous tweet.
${BUN_X} {baseDir}/scripts/x-thread.ts <file.md> --submit --delay 3000
${BUN_X} {baseDir}/scripts/x-thread.ts <file.md> --submit --profile ~/my-chrome-profile
| Parameter | Description |
|---|---|
<file.md> | Markdown file (required) |
--submit | Post all tweets (default: preview first only) |
--delay <ms> | Delay between tweets (default: frontmatter or 2000) |
--profile <dir|mode> | local (default, your Chrome profile), isolated, or a custom directory path |
--chrome <path> | Chrome executable path |
1. Parse markdown: split by --- into tweets
2. Validate: each tweet <= 280 chars, max 4 images per tweet
3. Launch Chrome with CDP (persistent profile)
4. Post first tweet -> capture tweet URL
5. For each remaining tweet:
a. Navigate to previous tweet URL
b. Click reply button
c. Fill text + paste images
d. Submit -> capture new tweet URL
e. Wait delay_ms
6. Report completion
| Issue | Fix |
|---|---|
Chrome debug port not ready | Kill stale Chrome: pkill -f "Chrome.*remote-debugging-port" |
Editor not found | Log in to X manually in the browser window |
Reply button not found | Tweet may not have loaded. Increase timeout or retry |
| Tweet over 280 chars | Split the tweet in your markdown file |
| Images not pasting | Run the pre-flight check (see below) |
bun not found | brew install oven-sh/bun/bun or npm install -g bun |
Before first use, verify the environment:
${BUN_X} {baseDir}/../baoyu-post-to-x/scripts/check-paste-permissions.ts 2>/dev/null || echo "Check not available — verify Chrome and bun are installed"
Checks: Chrome, profile, bun, Accessibility (macOS), clipboard, paste keystroke.
--profile isolated if you want to run without closing Chrome (requires manual X login on first use)--delay 3000 or higher to avoid rate limits