X Articles — Viral Long-Form for Twitter
Beat the algorithm. Create and publish X (Twitter) Articles with proven viral patterns.
AI-powered formatting, hook patterns, and browser automation. Handles Draft.js quirks, embed limitations, and image uploads.
Quick Reference
Content Formatting Rules (CRITICAL)
X Articles uses Draft.js editor with specific quirks:
- 1. Line breaks = paragraph breaks - Each newline creates a new paragraph block with spacing
- Join sentences on ONE LINE - All sentences in the same paragraph must be on a single line
- Use plain text, not markdown - X Articles uses rich text, not markdown
- No em dashes (—) - Replace with colons or rewrite sentences
Wrong:
CODEBLOCK0
Right:
CODEBLOCK1
Embed Limitation (IMPORTANT)
Embedded posts ALWAYS render at the END of the content block, not inline.
Workarounds:
- - Structure article to reference "see posts below"
- Accept visual flow: text → text → embeds at bottom
- Use
Insert > Posts menu (don't paste URLs)
Image Specs
| Type | Aspect Ratio | Recommended Size |
|---|
| Cover/Header | 5:2 | 1792x716 or similar |
| Inline images |
16:9 or 4:3 | 1792x1024 (DALL-E HD) |
Viral Article Structure
The Template
CODEBLOCK2
Hook Patterns That Work
Insecurity/FOMO:
CODEBLOCK3
Big Opportunity:
CODEBLOCK4
News Hook:
CODEBLOCK5
RIP Pattern:
CODEBLOCK6
WTF Pattern:
CODEBLOCK7
Personal Story:
CODEBLOCK8
CTA Patterns
Hard CTA (engagement bait):
CODEBLOCK9
Soft CTA:
CODEBLOCK10
Simple:
CODEBLOCK11
Style Guide
Damian Player Style (Tactical)
- - All lowercase (deliberate)
- Urgent, tactical tone
- 1500+ words
- Heavy step-by-step detail
- Hard CTA with lead magnet
Alex Finn Style (Motivational)
- - Normal capitalization
- Warm, motivational tone
- 800-1200 words
- Mix of WHY and HOW
- Soft CTA + product links
Dan Koe Style (Philosophical)
- - Long-form essay (2000+ words)
- Personal storytelling opener
- Named frameworks ("The Pyramid Principle")
- Deep teaching, not just tactics
- Newsletter CTA
Common Mistakes to Avoid
- - Short articles under 500 words
- Facts without story/emotion
- No clear sections or headers
- No objection handling
- No immediate wins section
- No CTA
- Generic AI-sounding language
- Em dashes (—) everywhere
- Excessive emojis
- Pasting tweet URLs instead of using Insert menu
Browser Automation (agent-browser)
Prerequisites
- - clawd browser running on CDP port 18800
- Logged into X on the browser
Navigate to Article Editor
CODEBLOCK12
Paste Content
CODEBLOCK13
Upload Cover Image
CODEBLOCK14
Publish
CODEBLOCK15
Cleanup (Important!)
CODEBLOCK16
Troubleshooting: Stale Element Refs
If clicks fail due to stale refs, use JS evaluate:
CODEBLOCK17
Content Preparation Script
Convert Markdown to X-Friendly Format
CODEBLOCK18
Pre-Publish Checklist
- - [ ] Hook grabs attention in first line
- [ ] Objections addressed early
- [ ] Step-by-step with time estimates
- [ ] Immediate wins section included
- [ ] CTA at the end
- [ ] No em dashes (—)
- [ ] Sentences joined on single lines
- [ ] Cover image 5:2 aspect ratio
- [ ] Embeds referenced as "see below"
- [ ] Proofread for AI-sounding language
Tweetable Quote Patterns
For promoting your article:
Result + Cost:
CODEBLOCK19
You Don't Need X:
CODEBLOCK20
Gap Warning:
CODEBLOCK21
Urgency:
CODEBLOCK22
Example Workflow
- 1. Write article in markdown with clear sections
- Run format script to convert to X-friendly plain text
- Generate cover image with DALL-E (1792x716 or 5:2 ratio)
- Open X article editor via browser automation
- Paste content and add section headers manually in editor
- Upload cover image via file input
- Add inline images at section breaks
- Insert embeds (they'll appear at bottom)
- Preview and proofread
- Publish
- Post promotional tweet with hook + article link
Related Skills
- -
bird - X/Twitter CLI for posting tweets - INLINECODE2 - Remove AI jargon from text
- INLINECODE3 - Generate PDFs (for lead magnets)
Built by
@NextXFrontier
X Articles — 面向Twitter的病毒式长文
击败算法。 使用经过验证的病毒式模式创建和发布X(Twitter)文章。
AI驱动的格式化、钩子模式和浏览器自动化。处理Draft.js的怪癖、嵌入限制和图片上传。
快速参考
内容格式化规则(关键)
X Articles使用具有特定怪癖的Draft.js编辑器:
- 1. 换行 = 段落分隔 - 每个新行都会创建一个带有间距的新段落块
- 将句子合并到一行 - 同一段落中的所有句子必须位于单行上
- 使用纯文本,而非markdown - X Articles使用富文本,而非markdown
- 不要使用长破折号(—) - 用冒号替换或重写句子
错误:
句子一。
句子二。
句子三。
正确:
句子一。句子二。句子三。
嵌入限制(重要)
嵌入的帖子始终在内容块的末尾渲染,而非内联。
变通方法:
- - 构建文章结构,引用见下方帖子
- 接受视觉流程:文本 → 文本 → 底部嵌入
- 使用插入 > 帖子菜单(不要粘贴URL)
图片规格
| 类型 | 宽高比 | 推荐尺寸 |
|---|
| 封面/页眉 | 5:2 | 1792x716或类似 |
| 内联图片 |
16:9或4:3 | 1792x1024(DALL-E HD) |
病毒式文章结构
模板
钩子(击中不安全感或机会)
这是什么(1-2段,附带社会证明)
为什么大多数人不会去做(解决异议)
[X]分钟指南
你的前[N]个胜利(即时价值)
成本(价值比较)
之后做什么(后续步骤)
窗口期(紧迫感)
行动号召(软性或硬性)
有效的钩子模式
不安全感/错失恐惧症:
每个人都在谈论X……而你坐在那里怀疑自己是否错过了机会
大机会:
这是我们一生中最大的机会
新闻钩子:
X刚刚开源了算法。这对你意味着什么:
RIP模式:
RIP [职业]。这个AI工具将在几秒钟内[执行操作]。
WTF模式:
WTF!!这个AI代理[做了惊人的事情]。方法如下:
个人故事:
小时候,我总是被那些……的人所吸引
行动号召模式
硬性行动号召(互动诱饵):
转发 + 关注 + 回复关键词,我会发送速查表
软性行动号召:
如果你采纳这个建议并构建了什么东西,请告诉我!
简单:
如果这对你有帮助,欢迎点赞和转发。
风格指南
Damian Player风格(战术型)
- - 全部小写(刻意为之)
- 紧迫、战术性的语气
- 1500+字
- 大量逐步细节
- 硬性行动号召 + 引流磁石
Alex Finn风格(激励型)
- - 正常大小写
- 温暖、激励性的语气
- 800-1200字
- 混合为什么和怎么做
- 软性行动号召 + 产品链接
Dan Koe风格(哲学型)
- - 长文随笔(2000+字)
- 个人故事开场
- 命名框架(金字塔原则)
- 深度教学,而非仅战术
- 新闻通讯行动号召
需要避免的常见错误
- - 少于500字的短文
- 缺乏故事/情感的事实
- 没有清晰的章节或标题
- 没有异议处理
- 没有即时胜利部分
- 没有行动号召
- 通用的AI式语言
- 到处使用长破折号(—)
- 过多的表情符号
- 粘贴推文URL而非使用插入菜单
浏览器自动化(agent-browser)
前提条件
- - clawd浏览器在CDP端口18800上运行
- 在浏览器中登录X
导航到文章编辑器
bash
打开新文章
agent-browser --cdp 18800 navigate https://x.com/compose/article
截图查看当前状态
agent-browser --cdp 18800 snapshot
粘贴内容
bash
将内容放入剪贴板
cat article.txt | pbcopy
点击内容区域,全选,粘贴
agent-browser --cdp 18800 click [contenteditable=true]
agent-browser --cdp 18800 press Meta+a
agent-browser --cdp 18800 press Meta+v
上传封面图片
bash
上传到文件输入
agent-browser --cdp 18800 upload input[type=file] /path/to/cover.png
等待编辑媒体对话框,点击应用
agent-browser --cdp 18800 snapshot | grep -i apply
agent-browser --cdp 18800 click @e5 # 应用按钮引用
发布
bash
查找并点击发布按钮
agent-browser --cdp 18800 snapshot | grep -i publish
agent-browser --cdp 18800 click @e35 # 发布按钮引用
在对话框中确认
agent-browser --cdp 18800 click @e5 # 确认
清理(重要!)
bash
发布后关闭标签页
agent-browser --cdp 18800 tab list
agent-browser --cdp 18800 tab close 1
故障排除:过时的元素引用
如果由于过时的引用导致点击失败,请使用JS评估:
bash
agent-browser --cdp 18800 evaluate (function() {
const btns = document.querySelectorAll(button);
for (let btn of btns) {
if (btn.innerText.includes(Publish)) {
btn.click();
return clicked;
}
}
return not found;
})()
内容准备脚本
将Markdown转换为X友好格式
bash
scripts/format-for-x.sh
#!/bin/bash
将markdown转换为X Articles格式
INPUT=$1
OUTPUT=${2:-${INPUT%.md}-x-ready.txt}
cat $INPUT | \
# 移除markdown标题,保留文本
sed s/^## /\n/g | \
sed s/^### /\n/g | \
sed s/^# /\n/g | \
# 移除markdown粗体/斜体
sed s/\\//g | \
sed s/\*//g | \
# 移除长破折号
sed s/ — /: /g | \
sed s/—/:/g | \
# 合并段落内的行(保留空行作为分隔符)
awk BEGIN{RS=; FS=\n; ORS=\n\n} {gsub(/\n/, ); print} \
> $OUTPUT
echo 已创建: $OUTPUT
发布前检查清单
- - [ ] 钩子在第一行抓住注意力
- [ ] 尽早解决异议
- [ ] 逐步指导并附时间估算
- [ ] 包含即时胜利部分
- [ ] 末尾有行动号召
- [ ] 没有长破折号(—)
- [ ] 句子合并到单行
- [ ] 封面图片5:2宽高比
- [ ] 嵌入引用为见下方
- [ ] 校对AI式语言
可推文引用模式
用于推广你的文章:
结果 + 成本:
我让一个AI代理完全访问我的MacBook。它检查邮件、管理日历、推送代码。每月花费20美元。一个虚拟助理要2000美元。
你不需要X:
你不需要Mac Mini。你不需要服务器。我在一个抽屉里的旧MacBook Air上运行我的AI代理。
差距警告:
拥有AI代理和没有AI代理之间的差距即将变得巨大。我花了15分钟设置好我的。
紧迫感:
大多数人会收藏这个但永远不会设置。不要成为大多数人。机会窗口正在关闭。
示例工作流程
- 1. 撰写文章,使用markdown并带有清晰的章节
- 运行格式化脚本,转换为X友好的纯文本
- 使用DALL-E生成封面图片(1792x716或5:2比例)
- 通过浏览器自动化打开X文章编辑器
- 粘贴内容并在编辑器中手动添加章节标题
- 通过文件输入上传封面图片
- 在章节分隔处添加内联图片
8.