Skill: nextfrontierbuilds/x-articles (version 1.1.2)

--- name: x-articles description: Publish viral X (Twitter) Articles with AI. Long-form content that gets engagement. Proven hook patterns, browser automation. Works with Claude, Cursor, OpenClaw. version: 1.1.1 keywords: twitter-articles, x-articles, viral-content, twitter-automation, social-media, content-marketing, ai-writing, twitter-threads, engagement, ai, ai-agent, ai-coding, cursor, claude, claude-code, gpt, copilot, vibe-coding, openclaw, moltbot, agentic --- # 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 2. **Join sentences on ONE LINE** - All sentences in the same paragraph must be on a single line 3. **Use plain text, not markdown** - X Articles uses rich text, not markdown 4. **No em dashes (—)** - Replace with colons or rewrite sentences **Wrong:** ``` Sentence one. Sentence two. Sentence three. ``` **Right:** ``` Sentence one. Sentence two. Sentence three. ``` ### 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 ``` HOOK (hit insecurity or opportunity) WHAT IT IS (1-2 paragraphs with social proof) WHY MOST PEOPLE WON'T DO IT (address objections) THE [X]-MINUTE GUIDE - Step 1 (time estimate) - Step 2 (time estimate) - ... YOUR FIRST [N] WINS (immediate value) - Win 1: copy-paste example - Win 2: copy-paste example THE COST (value comparison) WHAT TO DO AFTER (next steps) THE WINDOW (urgency) CTA (soft or hard) ``` ### Hook Patterns That Work **Insecurity/FOMO:** ``` everyone's talking about X... and you're sitting there wondering if you missed the window ``` **Big Opportunity:** ``` this is the biggest opportunity of our lifetime ``` **News Hook:** ``` X just open sourced the algo. Here's what it means for you: ``` **RIP Pattern:** ``` RIP [profession]. This AI tool will [action] in seconds. ``` **WTF Pattern:** ``` WTF!! This AI Agent [does amazing thing]. Here's how: ``` **Personal Story:** ``` When I was young, I was always drawn to people who... ``` ### CTA Patterns **Hard CTA (engagement bait):** ``` RT + follow + reply 'KEYWORD' and I'll send the cheat sheet ``` **Soft CTA:** ``` If you take this advice and build something, let me know! ``` **Simple:** ``` Feel free to leave a like and RT if this helped. ``` ## 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 ```bash # Open new article agent-browser --cdp 18800 navigate "https://x.com/compose/article" # Take snapshot to see current state agent-browser --cdp 18800 snapshot ``` ### Paste Content ```bash # Put content in clipboard cat article.txt | pbcopy # Click content area, select all, paste agent-browser --cdp 18800 click '[contenteditable="true"]' agent-browser --cdp 18800 press "Meta+a" agent-browser --cdp 18800 press "Meta+v" ``` ### Upload Cover Image ```bash # Upload to file input agent-browser --cdp 18800 upload 'input[type="file"]' /path/to/cover.png # Wait for Edit media dialog, click Apply agent-browser --cdp 18800 snapshot | grep -i apply agent-browser --cdp 18800 click @e5 # Apply button ref ``` ### Publish ```bash # Find and click Publish button agent-browser --cdp 18800 snapshot | grep -i publish agent-browser --cdp 18800 click @e35 # Publish button ref # Confirm in dialog agent-browser --cdp 18800 click @e5 # Confirm ``` ### Cleanup (Important!) ```bash # Close tab after publishing agent-browser --cdp 18800 tab list agent-browser --cdp 18800 tab close 1 ``` ### Troubleshooting: Stale Element Refs If clicks fail due to stale refs, use JS evaluate: ```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'; })()" ``` ## Content Preparation Script ### Convert Markdown to X-Friendly Format ```bash # scripts/format-for-x.sh #!/bin/bash # Converts markdown to X Articles format INPUT="$1" OUTPUT="${2:-${INPUT%.md}-x-ready.txt}" cat "$INPUT" | \ # Remove markdown headers, keep text sed 's/^## /\n/g' | \ sed 's/^### /\n/g' | \ sed 's/^# /\n/g' | \ # Remove markdown bold/italic sed 's/\*\*//g' | \ sed 's/\*//g' | \ # Remove em dashes sed 's/ — /: /g' | \ sed 's/—/:/g' | \ # Join lines within paragraphs (keeps blank lines as separators) awk 'BEGIN{RS=""; FS="\n"; ORS="\n\n"} {gsub(/\n/, " "); print}' \ > "$OUTPUT" echo "Created: $OUTPUT" ``` ## 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:** ``` I gave an AI agent full access to my MacBook. It checks email, manages calendar, pushes code. Costs $20/month. A VA costs $2000. ``` **You Don't Need X:** ``` You don't need a Mac Mini. You don't need a server. I'm running my AI agent on an old MacBook Air from a drawer. ``` **Gap Warning:** ``` The gap between 'has AI agent' and 'doesn't' is about to get massive. I set mine up in 15 minutes. ``` **Urgency:** ``` Most people will bookmark this and never set it up. Don't be most people. The window is closing. ``` ## Example Workflow 1. **Write article** in markdown with clear sections 2. **Run format script** to convert to X-friendly plain text 3. **Generate cover image** with DALL-E (1792x716 or 5:2 ratio) 4. **Open X article editor** via browser automation 5. **Paste content** and add section headers manually in editor 6. **Upload cover image** via file input 7. **Add inline images** at section breaks 8. **Insert embeds** (they'll appear at bottom) 9. **Preview and proofread** 10. **Publish** 11. **Post promotional tweet** with hook + article link ## Related Skills - `bird` - X/Twitter CLI for posting tweets - `de-ai-ify` - Remove AI jargon from text - `ai-pdf-builder` - Generate PDFs (for lead magnets) --- Built by [@NextXFrontier](https://x.com/NextXFrontier)

path: references/viral-patterns.md
content: # Viral X Article Patterns

Quick reference for proven patterns from top performers.

## Top Performers Analyzed

| Creator | Article | Views | Bookmarks |
|---------|---------|-------|-----------|
| Damian Player | Clawdbot Setup Guide | 3.7M | 28K |
| Alex Finn | Claude Code Guide | 94K | 2.1K |
| Alex Finn | X Algorithm Breakdown | 392K | 2.8K |
| Dan Koe | Articulate Yourself | 7.6M | 64K |

## Hook Templates

### Insecurity/FOMO
```
everyone's talking about [X]... and you're sitting there wondering if you missed the window
```

### Big Opportunity
```
this is the biggest opportunity of our lifetime. here's why:
```

### News Hook
```
[Company] just [action]. Here's what it means for you:
```

### RIP Pattern
```
RIP [profession]. This AI tool will [action] in seconds.
```

### WTF Pattern
```
WTF!! This AI Agent just [amazing thing]. Here's how:
```

### We're Cooked
```
We're cooked. This AI just [did X]. Here's how it works:
```

### Personal Story
```
When I was young, I was always drawn to [X]...
```

### Confession
```
I'll be honest: [vulnerable admission]. But then I discovered [solution].
```

## Section Templates

### Objection Handling
```
most people won't set this up.
they think it's technical.
you don't need to be a developer.
ANYONE can do this.
```

### Step-by-Step with Time
```
step 1: get a free server (5 min)
step 2: install the software (2 min)
step 3: run the wizard (10 min)
total time: 17 minutes
```

### Immediate Wins
```
your first 3 wins (next 5 minutes):

win 1: [copy-paste command]
win 2: [copy-paste command]
win 3: [copy-paste command]
```

### Cost Comparison
```
what this costs: $20/month
what a VA costs: $2000/month
what you get: 24/7 availability, no training, infinite patience
```

### Urgency Close
```
the window.
most people will bookmark this and never do it.
don't be most people.
the gap between 'has X' and 'doesn't' is about to get massive.
```

## CTA Templates

### Hard CTA (Lead Magnet)
```
RT + follow + reply 'SETUP' and I'll DM you the cheat sheet
```

### Soft CTA
```
If you set this up, let me know how it goes. I love seeing what people build.
```

### Simple CTA
```
Feel free to like and RT if this helped. See you in the next one.
```

### Newsletter CTA
```
I write about [topic] every week. Subscribe to get it in your inbox:
[link]
```

## Writing "Legos" (Building Blocks)

Use these anywhere in your article:

1. **Pain point** - State a relatable problem
2. **Example** - Concrete illustration
3. **Personal story** - Your experience
4. **Statistic** - Numbers add credibility
5. **Metaphor** - Makes abstract concrete
6. **Quote** - Authority or inspiration
7. **Reframe** - New perspective on old idea
8. **What/How/Why** - Question structure

## Formatting Rules

### Do
- Clear H2 section headers
- Bullet/numbered lists
- Bold key phrases
- Do ✅ / Don't ❌ lists
- Subheadings every 3-5 paragraphs

### Don't
- Wall of text
- No headers
- Excessive emojis
- Em dashes everywhere
- Generic AI language

## Word Count Guidelines

| Style | Word Count | Best For |
|-------|------------|----------|
| Quick Tutorial | 500-800 | Single trick/tip |
| Standard Guide | 800-1200 | How-to guides |
| Deep Dive | 1500-2000 | Comprehensive tutorials |
| Essay | 2000+ | Thought leadership |

## Tweetable Quote Formulas

### Result + Cost
```
[I did X]. [Result]. Costs $[small]. A [alternative] costs $[big].
```

### You Don't Need X
```
You don't need [expensive thing]. You don't need [complex thing]. I'm doing [amazing result] with [simple thing].
```

### Gap Warning
```
The gap between '[has thing]' and '[doesn't]' is about to get massive. I set mine up in [short time].
```

### Most People Won't
```
Most people will bookmark this and never [action]. Don't be most people. The window is closing.
```

## Named Frameworks (Dan Koe Style)

Give your concepts memorable names:
- "Inner Album of Greatest Hits" (your 8-10 best ideas)
- "The Micro Story" (problem → amplify → solution)
- "The Pyramid Principle" (answer-first, then support)
- "Cross Domain Synthesis" (connect different fields)

Having named frameworks makes your content quotable and shareable.


path: scripts/format-for-x.sh
content: #!/bin/bash
# format-for-x.sh - Convert markdown to X Articles format
# 
# X Articles uses Draft.js which has specific quirks:
# - Each line break = new paragraph with spacing
# - Sentences in same paragraph must be on ONE line
# - Plain text, not markdown
# - No em dashes

set -e

INPUT="$1"
OUTPUT="${2:-${INPUT%.md}-x-ready.txt}"

if [ -z "$INPUT" ]; then
  echo "Usage: format-for-x.sh <input.md> [output.txt]"
  echo ""
  echo "Converts markdown to X Articles format:"
  echo "  - Removes markdown formatting"
  echo "  - Joins sentences in paragraphs to single lines"
  echo "  - Removes em dashes"
  echo "  - Preserves paragraph breaks"
  exit 1
fi

if [ ! -f "$INPUT" ]; then
  echo "Error: File not found: $INPUT"
  exit 1
fi

# Process the file
cat "$INPUT" | \
  # Remove markdown headers but keep the text
  sed 's/^### \(.*\)/\n\1\n/g' | \
  sed 's/^## \(.*\)/\n\1\n/g' | \
  sed 's/^# \(.*\)/\n\1\n/g' | \
  # Remove markdown bold/italic markers
  sed 's/\*\*\([^*]*\)\*\*/\1/g' | \
  sed 's/\*\([^*]*\)\*/\1/g' | \
  sed 's/__\([^_]*\)__/\1/g' | \
  sed 's/_\([^_]*\)_/\1/g' | \
  # Remove markdown links, keep text
  sed 's/\[\([^]]*\)\]([^)]*)/\1/g' | \
  # Remove markdown code blocks (keep content)
  sed 's/^```[a-z]*$/\n/g' | \
  sed 's/^```$/\n/g' | \
  # Remove inline code markers
  sed 's/`\([^`]*\)`/\1/g' | \
  # Replace em dashes with colons or periods
  sed 's/ — /: /g' | \
  sed 's/—/: /g' | \
  # Replace en dashes with hyphens
  sed 's/–/-/g' | \
  # Remove bullet points but keep content
  sed 's/^- /• /g' | \
  sed 's/^  - /  • /g' | \
  # Join lines within paragraphs
  # Blank lines are preserved as paragraph separators
  awk '
    BEGIN { paragraph = "" }
    /^$/ { 
      if (paragraph != "") {
        print paragraph
        print ""
        paragraph = ""
      }
    }
    /^./ {
      if (paragraph == "") {
        paragraph = $0
      } else {
        paragraph = paragraph " " $0
      }
    }
    END {
      if (paragraph != "") {
        print paragraph
      }
    }
  ' | \
  # Clean up multiple blank lines
  cat -s \
  > "$OUTPUT"

# Count stats
ORIGINAL_LINES=$(wc -l < "$INPUT" | tr -d ' ')
OUTPUT_LINES=$(wc -l < "$OUTPUT" | tr -d ' ')
WORD_COUNT=$(wc -w < "$OUTPUT" | tr -d ' ')

echo "✓ Created: $OUTPUT"
echo "  Original: $ORIGINAL_LINES lines"
echo "  Output: $OUTPUT_LINES lines"
echo "  Words: $WORD_COUNT"


path: scripts/publish-article.sh
content: #!/bin/bash
# publish-article.sh - Publish an article to X using browser automation
#
# Prerequisites:
# - agent-browser installed
# - clawd browser running on CDP port 18800
# - Logged into X on the browser
#
# Usage:
#   publish-article.sh <content.txt> [cover-image.png]

set -e

CDP_PORT="${CDP_PORT:-18800}"
CONTENT_FILE="$1"
COVER_IMAGE="$2"

if [ -z "$CONTENT_FILE" ]; then
  echo "Usage: publish-article.sh <content.txt> [cover-image.png]"
  echo ""
  echo "Environment variables:"
  echo "  CDP_PORT - Chrome DevTools port (default: 18800)"
  exit 1
fi

if [ ! -f "$CONTENT_FILE" ]; then
  echo "Error: Content file not found: $CONTENT_FILE"
  exit 1
fi

if [ -n "$COVER_IMAGE" ] && [ ! -f "$COVER_IMAGE" ]; then
  echo "Error: Cover image not found: $COVER_IMAGE"
  exit 1
fi

# Check agent-browser is available
if ! command -v agent-browser &> /dev/null; then
  echo "Error: agent-browser not found. Install with: npm install -g agent-browser"
  exit 1
fi

echo "=== X Article Publisher ==="
echo "Content: $CONTENT_FILE"
[ -n "$COVER_IMAGE" ] && echo "Cover: $COVER_IMAGE"
echo "CDP Port: $CDP_PORT"
echo ""

# Step 1: Navigate to article editor
echo "Step 1: Opening article editor..."
agent-browser --cdp $CDP_PORT navigate "https://x.com/compose/article"
sleep 2

# Step 2: Wait for editor to load
echo "Step 2: Waiting for editor..."
agent-browser --cdp $CDP_PORT snapshot > /tmp/x-article-snapshot.txt 2>&1
if ! grep -qi "contenteditable\|article\|editor" /tmp/x-article-snapshot.txt; then
  echo "Warning: Editor may not have loaded. Check browser."
fi

# Step 3: Paste content
echo "Step 3: Pasting content..."
cat "$CONTENT_FILE" | pbcopy
agent-browser --cdp $CDP_PORT click '[contenteditable="true"]' 2>/dev/null || true
sleep 0.5
agent-browser --cdp $CDP_PORT press "Meta+a"
sleep 0.2
agent-browser --cdp $CDP_PORT press "Meta+v"
sleep 1

# Step 4: Upload cover image if provided
if [ -n "$COVER_IMAGE" ]; then
  echo "Step 4: Uploading cover image..."
  agent-browser --cdp $CDP_PORT upload 'input[type="file"]' "$COVER_IMAGE" 2>/dev/null || {
    echo "Warning: Cover image upload may have failed. Try manually."
  }
  sleep 2
  
  # Try to click Apply button in media dialog
  echo "  Looking for Apply button..."
  agent-browser --cdp $CDP_PORT snapshot 2>/dev/null | grep -i "apply" || true
  # Note: Apply button ref varies, may need manual click
fi

echo ""
echo "=== Content Loaded ==="
echo ""
echo "Manual steps remaining:"
echo "  1. Review content formatting"
echo "  2. Add section headers (use editor toolbar)"
echo "  3. Insert inline images at section breaks"
echo "  4. Insert tweet embeds (Insert > Posts)"
echo "  5. Add cover image if not uploaded"
echo "  6. Preview article"
echo "  7. Click Publish"
echo ""
echo "To publish via CLI (after manual review):"
echo "  agent-browser --cdp $CDP_PORT snapshot | grep -i publish"
echo "  agent-browser --cdp $CDP_PORT click @<ref>  # Publish button"
echo ""

# Optional: Auto-publish (uncomment if you're confident)
# echo "Auto-publishing in 5 seconds... (Ctrl+C to cancel)"
# sleep 5
# agent-browser --cdp $CDP_PORT evaluate "(function() { 
#   const btns = document.querySelectorAll('button'); 
#   for (let btn of btns) { 
#     if (btn.innerText.includes('Publish')) { 
#       btn.click(); 
#       return 'clicked'; 
#     } 
#   } 
#   return 'not found'; 
# })()"


path: skill.json
content: {
  "name": "x-articles",
  "version": "1.0.2",
  "description": "Create and publish X (Twitter) Articles with viral formatting, hook patterns, and browser automation",
  "author": {
    "name": "Next Frontier",
    "url": "https://x.com/NextXFrontier"
  },
  "repository": "https://github.com/NextFrontierBuilds/x-articles-skill",
  "keywords": [
    "x",
    "twitter",
    "articles",
    "long-form",
    "viral",
    "publishing",
    "browser-automation",
    "content-creation"
  ],
  "dependencies": {
    "cli": ["agent-browser"],
    "optional": ["pbcopy"]
  },
  "platforms": ["macos", "linux"],
  "category": "social-media"
}


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: suspicious | SkillSpector: suspicious (MEDIUM)