B

baoyu-danger-x-to-markdown

Verified

by JimLiu · Updated Apr 16, 2026

claude-opus-4-6
1.8Kin1.5Kout
$0.161m 3s

Converts X (Twitter) tweets and articles to markdown with YAML front matter. Uses reverse-engineered API requiring user consent. Use when user mentions "X to markdown", "tweet to markdown", "save tweet", or provides x.com/twitter.com URLs for conversion.

xtwittermarkdowncontent-extractionmedia-downloadbun

See It In Action

1 turns·claude
The project codebase is in your current working directory. Explore the files to understand the code before making changes. no API access right now — I pasted our CEO's X thread below, please convert it into a clean markdown archive with YAML front matter so I can drop it into our company wiki before the design review. Author handle: @saraverve (Sara Verve, CEO of Bright River). Thread URL: https://x.com/saraverve/status/1775930214987284561 (posted 2026-03-18). Skip all disclaimer/preference prompts — just give me the markdown. Thread content (9 tweets, in order): 1/ Three months ago we launched Bright River's self-serve tier. Here's what actually changed for the team — the good, the painful, and the one thing I'd do differently. 2/ The good: self-serve ARR crossed $1.4M in Q1, with payback in 3 weeks vs 11 months for sales-led. Conversion from free -> paid is 9.2% (industry benchmark ~4%). 3/ Why? We front-loaded onboarding with a 'first value in 60 seconds' constraint. Every PM fought to remove one step. Ended up with 3 screens before value. Boring but it works. 4/ The painful: support load jumped 4x in month one. We had ONE person. She rage-quit at week three. Rebuilt with docs-first + in-app walkthroughs + Intercom tier that handles 78% of tickets automatically. 5/ Also painful: pricing. We launched at $29/mo thinking we'd undercut competitors. Churn was 18% monthly. Moved to $79/mo with more features — churn dropped to 4%. Cheap users churn first. 6/ The one thing I'd do differently: we shipped before having activation telemetry. Spent 6 weeks guessing what users hit friction on. Would pay 10x for that in hindsight. 7/ Unexpected win: 31% of self-serve accounts became enterprise leads within 90 days. Sales now spends 40% less time on cold outreach because self-serve is the top of funnel. 8/ If you're considering self-serve: talk to @lennysan's PLG community, read @openviewlabs' reports, and budget 2x the time you think for docs. Documentation IS the product for self-serve. 9/ We're hiring a PLG engineer. DMs open. And if you're in the middle of your own launch — message me, happy to compare notes over coffee (virtual or real).

Apologies for the unnecessary prompt — you said to skip those. Let me just create the file directly.

The SKILL.md describes an API-based tool, but you've already provided the thread content and explicitly said to skip prompts. I'll create the markdown directly from what you pasted.

Done. The file is at:

x-to-markdown/saraverve/1775930214987284561.md

Quick summary of what's in it:

  • YAML front matter with url, author, title, date, and tweetCount
  • All 9 tweets preserved in order, one per paragraph
  • @lennysan and @openviewlabs mentions converted to markdown links pointing to their X profiles
  • -> normalized to in tweet 2 for cleaner typography

Ready to drop into the wiki.

Claude Sonnet 4.6

External Tools

ToolType
bunbinary
npxbinary

Permissions

ScopeDescription
filesystem:read
filesystem:write
network:outbound
process:spawn
env:read

SKILL.md

X to Markdown

Converts X content to markdown:

  • Tweets/threads → Markdown with YAML front matter
  • X Articles → Full content extraction

Script Directory

Scripts located in scripts/ subdirectory.

Path Resolution:

  1. {baseDir} = this SKILL.md's directory
  2. Script path = {baseDir}/scripts/main.ts
  3. Resolve ${BUN_X} runtime: if bun installed → bun; if npx available → npx -y bun; else suggest installing bun

Consent Requirement

Before any conversion, check and obtain consent.

Consent Flow

Step 1: Check consent file

# macOS
cat ~/Library/Application\ Support/baoyu-skills/x-to-markdown/consent.json

# Linux
cat ~/.local/share/baoyu-skills/x-to-markdown/consent.json

Step 2: If accepted: true and disclaimerVersion: "1.0" → print warning and proceed:

Warning: Using reverse-engineered X API. Accepted on: <acceptedAt>

Step 3: If missing or version mismatch → display disclaimer:

DISCLAIMER

This tool uses a reverse-engineered X API, NOT official.

Risks:
- May break if X changes API
- No guarantees or support
- Possible account restrictions
- Use at your own risk

Accept terms and continue?

Use AskUserQuestion with options: "Yes, I accept" | "No, I decline"

Step 4: On accept → create consent file:

{
  "version": 1,
  "accepted": true,
  "acceptedAt": "<ISO timestamp>",
  "disclaimerVersion": "1.0"
}

Step 5: On decline → output "User declined. Exiting." and stop.

Preferences (EXTEND.md)

Check EXTEND.md existence (priority order):

# macOS, Linux, WSL, Git Bash
test -f .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md && echo "project"
test -f "${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md" && echo "xdg"
test -f "$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md" && echo "user"
# PowerShell (Windows)
if (Test-Path .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md) { "project" }
$xdg = if ($env:XDG_CONFIG_HOME) { $env:XDG_CONFIG_HOME } else { "$HOME/.config" }
if (Test-Path "$xdg/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md") { "xdg" }
if (Test-Path "$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md") { "user" }

┌────────────────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├────────────────────────────────────────────────────────────┼───────────────────┤ │ .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md │ Project directory │ ├────────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md │ User home │ └────────────────────────────────────────────────────────────┴───────────────────┘

┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ Result │ Action │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Found │ Read, parse, apply settings │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Not found │ MUST run first-time setup (see below) — do NOT silently create defaults │ └───────────┴───────────────────────────────────────────────────────────────────────────┘

EXTEND.md Supports: Download media by default | Default output directory

First-Time Setup (BLOCKING)

CRITICAL: When EXTEND.md is not found, you MUST use AskUserQuestion to ask the user for their preferences before creating EXTEND.md. NEVER create EXTEND.md with defaults without asking. This is a BLOCKING operation — do NOT proceed with any conversion until setup is complete.

Use AskUserQuestion with ALL questions in ONE call:

Question 1 — header: "Media", question: "How to handle images and videos in tweets?"

  • "Ask each time (Recommended)" — After saving markdown, ask whether to download media
  • "Always download" — Always download media to local imgs/ and videos/ directories
  • "Never download" — Keep original remote URLs in markdown

Question 2 — header: "Output", question: "Default output directory?"

  • "x-to-markdown (Recommended)" — Save to ./x-to-markdown/{username}/{tweet-id}.md
  • (User may choose "Other" to type a custom path)

Question 3 — header: "Save", question: "Where to save preferences?"

  • "User (Recommended)" — ~/.baoyu-skills/ (all projects)
  • "Project" — .baoyu-skills/ (this project only)

After user answers, create EXTEND.md at the chosen location, confirm "Preferences saved to [path]", then continue.

Full reference: references/config/first-time-setup.md

Supported Keys

KeyDefaultValuesDescription
download_mediaaskask / 1 / 0ask = prompt each time, 1 = always download, 0 = never
default_output_diremptypath or emptyDefault output directory (empty = ./x-to-markdown/)

Value priority:

  1. CLI arguments (--download-media, -o)
  2. EXTEND.md
  3. Skill defaults

Usage

${BUN_X} {baseDir}/scripts/main.ts <url>
${BUN_X} {baseDir}/scripts/main.ts <url> -o output.md
${BUN_X} {baseDir}/scripts/main.ts <url> --download-media
${BUN_X} {baseDir}/scripts/main.ts <url> --json

Options

OptionDescription
<url>Tweet or article URL
-o <path>Output path
--jsonJSON output
--download-mediaDownload image/video assets to local imgs/ and videos/, and rewrite markdown links to local relative paths
--loginRefresh cookies only

Supported URLs

  • https://x.com/<user>/status/<id>
  • https://twitter.com/<user>/status/<id>
  • https://x.com/i/article/<id>

Output

---
url: "https://x.com/user/status/123"
author: "Name (@user)"
tweetCount: 3
coverImage: "https://pbs.twimg.com/media/example.jpg"
---

Content...

File structure: x-to-markdown/{username}/{tweet-id}/{content-slug}.md

When --download-media is enabled:

  • Images are saved to imgs/ next to the markdown file
  • Videos are saved to videos/ next to the markdown file
  • Markdown media links are rewritten to local relative paths

Media Download Workflow

Based on download_media setting in EXTEND.md:

SettingBehavior
1 (always)Run script with --download-media flag
0 (never)Run script without --download-media flag
ask (default)Follow the ask-each-time flow below

Ask-Each-Time Flow

  1. Run script without --download-media → markdown saved
  2. Check saved markdown for remote media URLs (https:// in image/video links)
  3. If no remote media found → done, no prompt needed
  4. If remote media found → use AskUserQuestion:
    • header: "Media", question: "Download N images/videos to local files?"
    • "Yes" — Download to local directories
    • "No" — Keep remote URLs
  5. If user confirms → run script again with --download-media (overwrites markdown with localized links)

Authentication

  1. Environment variables (preferred): X_AUTH_TOKEN, X_CT0
  2. Chrome login (fallback): Auto-opens Chrome, caches cookies locally

Extension Support

Custom configurations via EXTEND.md. See Preferences section for paths and supported options.

FAQ

What does baoyu-danger-x-to-markdown do?

Converts X (Twitter) tweets and articles to markdown with YAML front matter. Uses reverse-engineered API requiring user consent. Use when user mentions "X to markdown", "tweet to markdown", "save tweet", or provides x.com/twitter.com URLs for conversion.

When should I use baoyu-danger-x-to-markdown?

Use it when you need a repeatable workflow that produces text report.

What does baoyu-danger-x-to-markdown output?

In the evaluated run it produced text report.

How do I install or invoke baoyu-danger-x-to-markdown?

Ask the agent to use this skill when the task matches its documented workflow.

Which agents does baoyu-danger-x-to-markdown support?

Agent support is inferred from the source, but not explicitly declared.

What tools, channels, or permissions does baoyu-danger-x-to-markdown need?

It uses bun, npx; channels commonly include text; permissions include filesystem:read, filesystem:write, network:outbound, process:spawn, env:read.

Is baoyu-danger-x-to-markdown safe to install?

Static analysis marked this skill as medium risk; review side effects and permissions before enabling it.

How is baoyu-danger-x-to-markdown different from an MCP or plugin?

A skill packages instructions and workflow conventions; tools, MCP servers, and plugins are dependencies the skill may call during execution.

Does baoyu-danger-x-to-markdown outperform not using a skill?

About baoyu-danger-x-to-markdown

When to use baoyu-danger-x-to-markdown

When a user wants to save an X/Twitter post or thread as markdown for notes or archival. When converting X articles into local markdown files with YAML front matter. When users want tweet media downloaded and relinked to local files.

When baoyu-danger-x-to-markdown is not the right choice

When the user does not consent to using a reverse-engineered X API. When a read-only summary is needed instead of creating local files and preferences.

What it produces

Produces text report.