Agent skill

X to Markdown Converter

by JimLiu in JimLiu/baoyu-skills

Saves tweets, threads and X Articles as Markdown files with YAML front matter, using an unofficial API that asks for your consent first.

MITAuto-check: warningsKnowledge Management

Install X to Markdown Converter

The automated check flagged lines worth reading first. See the safety section below.

skills CLI
$ npx skills add JimLiu/baoyu-skills --skill baoyu-danger-x-to-markdown -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install JimLiu/baoyu-skills baoyu-danger-x-to-markdown --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/JimLiu/baoyu-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/baoyu-danger-x-to-markdown .claude/skills/baoyu-danger-x-to-markdown && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
baoyu-danger-x-to-markdown
GitHub stars
27k
Used in
4 other repos
Token cost
~1.8k tokens
SKILL.md length
685 words
Files
20 (incl. scripts, references)
Skills in repo
22
Repo updated
First seen
Licence
MIT

At a glance

Saves tweets, threads and X Articles as Markdown files with YAML front matter, using an unofficial API that asks for your consent first.

  • Works in 3 steps: Prefer built-in user-input tools exposed… → Fallback: if no such tool exists, emit a… → Batching: if the tool supports multiple…
  • Archiving a tweet or thread as a Markdown note with front matter
  • SKILL.md covers User Input Tools, Script Directory, Consent Requirement and Preferences (EXTEND.md), plus 7 more sections
  • Runs TypeScript scripts from its folder; calls npx; reaches x.com and twitter.com; needs X_AUTH_TOKEN

What it does

Given an x.com or twitter.com link, the agent runs a bundled TypeScript script, through Bun or npx running Bun, that converts a tweet or thread into Markdown with YAML front matter, or extracts the full text of an X Article. The scripts include modules for threads, referenced tweets, a media localizer, cookie handling and a GraphQL layer.

Because the tool relies on a reverse-engineered X API rather than an official one, the skill checks for a stored consent file before any conversion and shows a disclaimer if none exists or its version differs. You must accept; declining stops the run. Preferences are read from an EXTEND.md file looked up in the project folder, then the XDG config folder, then the home folder, and the first one found wins.

When your agent uses it

  • Archiving a tweet or thread as a Markdown note with front matter
  • Pulling the full text of an X Article into a local file
  • Converting an x.com or twitter.com link into Markdown

Example prompts

  • “Convert this x.com thread link to Markdown and keep the front matter.”
  • “Turn this X Article into a Markdown file I can drop into my notes.”
  • “Save this tweet as Markdown in my clippings folder.”

Requirements

  • Bun, or npx to run it
  • Your acceptance of the unofficial-API disclaimer

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Prefer built-in user-input tools exposed by the current agent runtime — e.g., AskUserQuestion, request_user_input, clarify, ask_user, or…
  2. Fallback: if no such tool exists, emit a numbered plain-text message and ask the user to reply with the chosen number/answer for each…
  3. Batching: if the tool supports multiple questions per call, combine all applicable questions into a single call; if only single-question…

What it can do on your machine

Read from SKILL.md and the folder at commit 1567581. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 16 files in scripts/ (TypeScript, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • x.com
    • twitter.com
    • pbs.twimg.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • X_AUTH_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

X to Markdown Converter loads about 1.8k tokens when it runs, and up to ~2.5k if it reads all its reference files. Until then it costs about 70 tokens; SKILL.md has 685 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~70
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: warnings

The automated check found patterns that need a careful read before installing.

  • WarningMentions a credentials file (SSH keys, cloud or package-manager tokens)SKILL.md:210
    2. **Chrome login** (fallback): Auto-opens Chrome, caches cookies locally

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from JimLiu/baoyu-skills at commit 1567581, republished under its MIT licence (© JimLiu). 685 words, ~1,834 tokens.

Download SKILL.mdSave it as .claude/skills/baoyu-danger-x-to-markdown/SKILL.md (or your agent's skills folder). This skill also uses 19 other files; get the full folder from GitHub.
name
baoyu-danger-x-to-markdown
description
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.
version
1.117.3

X to Markdown

Converts X content to markdown:

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

User Input Tools

When this skill prompts the user, follow this tool-selection rule (priority order):

  1. Prefer built-in user-input tools exposed by the current agent runtime — e.g., AskUserQuestion, request_user_input, clarify, ask_user, or any equivalent.
  2. Fallback: if no such tool exists, emit a numbered plain-text message and ask the user to reply with the chosen number/answer for each question.
  3. Batching: if the tool supports multiple questions per call, combine all applicable questions into a single call; if only single-question, ask them one at a time in priority order.

Concrete AskUserQuestion references below are examples — substitute the local equivalent in other runtimes.

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

Before any conversion, check and obtain consent.

Step 1: Check consent file

bash
# 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:

json
{
  "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 in priority order — the first one found wins:

PriorityPathScope
1.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.mdProject
2${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.mdXDG
3$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.mdUser home
ResultAction
FoundRead, parse, apply settings
Not foundMUST 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

Show full SKILL.md (253 more words)Show less
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

bash
${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

markdown
---
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.

© JimLiu, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 19 other files (scripts, references) in skills/baoyu-danger-x-to-markdown of JimLiu/baoyu-skills.

  • SKILL.md
  • references/config/first-time-setup.md
  • scripts/bun.lock
  • scripts/constants.ts
  • scripts/cookie-file.ts
  • scripts/cookies.ts
  • scripts/graphql.ts
  • scripts/http.ts
  • scripts/main.ts
  • scripts/markdown.test.ts
  • scripts/markdown.ts
  • scripts/media-localizer.ts
  • scripts/package.json
  • scripts/paths.ts
  • scripts/referenced-tweets.ts
  • scripts/thread-markdown.ts
  • scripts/thread.ts
  • scripts/tweet-article.ts
  • … and 2 more

Open the folder on GitHubat commit 1567581

Used in 4 other repositories

We found 4 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 4 other GitHub owners. This page covers the copy in JimLiu/baoyu-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

X to Markdown Converter next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

X to Markdown Converter compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
X to Markdown Converter this skillJimLiu/baoyu-skills27k4 repos~1.8kAutomated safety check: WarnMIT
Web To Markdownrookie-ricardo/erduo-skills935—~894Automated safety check: PassMIT
URL to Markdown Fetcherjoeseesun/qiaomu-markdown-proxy509—~1.4kAutomated safety check: PassMIT
Content Creation Publisherappleweiping/WEIPING_WIKI1191 repos~1.7kAutomated safety check: NotesMIT
Clean Content FetchLeoYeAI/openclaw-master-skills2.2k—~574Automated safety check: PassMIT
Defuddlekepano/obsidian-skills49k11 repos~208Automated safety check: PassMIT

Similar skills

  • Web To Markdown

    rookie-ricardo/erduo-skills

    Convert a web URL into cleaned Markdown with deterministic routing.

    935 GitHub stars~894 tokensUpdated 2 mo ago
    Productivity & AutomationAuto-check passed
  • URL to Markdown Fetcher

    joeseesun/qiaomu-markdown-proxy

    Converts a URL or PDF into clean Markdown, with dedicated routes for WeChat articles, Feishu docs, arXiv papers and login-gated pages, before any summary or rewrite.

    509 GitHub stars~1.4k tokensUpdated 2 mo ago
    Documents & OfficeAuto-check passed
  • Content Creation Publisher

    appleweiping/WEIPING_WIKI

    内容创作与发布全流程技能,整合网页采集、Markdown格式化、智能配图、多平台发布(微信公众号、X/Twitter)功能,实现从内容获取到发布的一站式解决方案

    119 GitHub starsUsed in 1 repo~1.7k tokens
    Documents & OfficeAuto-check: notes
  • Clean Content Fetch

    LeoYeAI/openclaw-master-skills

    获取干净、可读的网页正文内容,适合现代网页、博客、新闻、公告和微信公众号文章抓取;支持网页正文提取、内容清洗、去噪、Markdown 输出,适用于普通 fetch 效果不佳、页面噪音较多或动态渲染干扰的场景。Clean content fetch for modern web pages, article extraction, WeChat article capture, content…

    2.2k GitHub stars~574 tokensUpdated 2 mo ago
    Documents & OfficeAuto-check passed
  • Defuddle

    kepano/obsidian-skills

    Uses the Defuddle CLI to pull clean, readable Markdown, JSON or metadata from web pages, stripping navigation, ads and clutter to save tokens.

    49k GitHub starsUsed in 11 repos~208 tokens
    Knowledge ManagementAuto-check passed
  • Baoyu URL To Markdown

    sdyckjq-lab/llm-wiki-skill

    Fetch any URL and convert to markdown using Chrome CDP. An agent skill from sdyckjq-lab/llm-wiki-skill.

    2.5k GitHub starsUsed in 2 repos~3.2k tokens
    Knowledge ManagementAuto-check passed

More from JimLiu/baoyu-skills

All 22 skills in this repo
  • Markdown Article Formatter

    JimLiu/baoyu-skills

    Reformats plain text or Markdown articles with frontmatter, a title, a summary, headings, bold, lists and code blocks, and saves a separate formatted copy.

    27k GitHub starsUsed in 6 repos~3.5k tokens
    Auto-check passed
  • SVG Diagram Generator

    JimLiu/baoyu-skills

    Creates standalone dark-themed SVG diagrams, including architecture, flowchart, sequence, structural, mind map, timeline and state machine types.

    27k GitHub starsUsed in 1 repo~3.1k tokens
    Auto-check passed
  • Publishes articles and image-text posts to a WeChat Official Account through the API or Chrome CDP, converting markdown to WeChat-ready HTML with link citations.

    27k GitHub starsUsed in 2 repos~3.6k tokens
    Auto-check: warnings
  • Image Compressor

    JimLiu/baoyu-skills

    Compresses images to WebP by default, or to PNG or JPEG, picking the best available tool on the machine and optionally processing whole folders.

    27k GitHub starsUsed in 5 repos~598 tokens
    Auto-check passed
  • Generates text and images through an unofficial, reverse-engineered Gemini Web API, supporting reference images and multi-turn conversations.

    27k GitHub starsUsed in 5 repos~1.6k tokens
    Auto-check passed
  • Baoyu Translate

    JimLiu/baoyu-skills

    Translates articles and files in quick, normal or refined mode, with a custom glossary, saved preferences and a review-and-polish workflow for publication quality.

    27k GitHub starsUsed in 1 repo~3.9k tokens
    Auto-check passed

Works with

Questions about X to Markdown Converter

What does X to Markdown Converter do?

Saves tweets, threads and X Articles as Markdown files with YAML front matter, using an unofficial API that asks for your consent first. com link, the agent runs a bundled TypeScript script, through Bun or npx running Bun, that converts a tweet or thread into Markdown with YAML front matter, or extracts the full text of an X Article. The scripts include modules for threads, referenced tweets, a media localizer, cookie handling and a GraphQL layer.

When should I use X to Markdown Converter?

X to Markdown Converter fits situations like: archiving a tweet or thread as a Markdown note with front matter; pulling the full text of an X Article into a local file; converting an x.com or twitter.com link into Markdown.

How do I install X to Markdown Converter in Claude Code?

Run `npx skills add JimLiu/baoyu-skills --skill baoyu-danger-x-to-markdown -a claude-code`. Or copy the skill folder (skills/baoyu-danger-x-to-markdown in JimLiu/baoyu-skills) into .claude/skills/baoyu-danger-x-to-markdown in your project. Claude Code loads it when a task matches its description.

How do I install X to Markdown Converter in Codex?

Run `npx skills add JimLiu/baoyu-skills --skill baoyu-danger-x-to-markdown -a codex`. Or copy the skill folder (skills/baoyu-danger-x-to-markdown in JimLiu/baoyu-skills) into .agents/skills/baoyu-danger-x-to-markdown in your project. Codex loads it when a task matches its description.

Can I use X to Markdown Converter in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add JimLiu/baoyu-skills --skill baoyu-danger-x-to-markdown -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/baoyu-danger-x-to-markdown, .gemini/skills/baoyu-danger-x-to-markdown, .github/skills/baoyu-danger-x-to-markdown and .opencode/skills/baoyu-danger-x-to-markdown in your project.

What does X to Markdown Converter need to run?

Going by SKILL.md and its folder, X to Markdown Converter needs TypeScript for the scripts in its folder, the command-line tools its instructions call (npx) and credentials named X_AUTH_TOKEN. Our summary lists: Bun, or npx to run it; Your acceptance of the unofficial-API disclaimer.

Does X to Markdown Converter access the network?

SKILL.md names 3 domains. In commands or code: x.com, twitter.com and pbs.twimg.com; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is X to Markdown Converter safe to install?

Our automated static check of SKILL.md flagged 1 warning(s): mentions a credentials file (ssh keys, cloud or package-manager tokens). Read the flagged lines before installing; the check is not a guarantee either way. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does X to Markdown Converter use?

X to Markdown Converter is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does X to Markdown Converter use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 623 tokens, read only when the agent opens those files.

What are the alternatives to X to Markdown Converter?

Skills that share tags, products or a category with X to Markdown Converter: Web To Markdown (rookie-ricardo/erduo-skills, 935 stars), URL to Markdown Fetcher (joeseesun/qiaomu-markdown-proxy, 509 stars), Content Creation Publisher (appleweiping/WEIPING_WIKI, 119 stars) and Clean Content Fetch (LeoYeAI/openclaw-master-skills, 2.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains X to Markdown Converter?

JimLiu (a GitHub user) maintains it in JimLiu/baoyu-skills, which has 26,507 GitHub stars. The repository holds 22 skills in this directory. The repository was last updated on September 10, 2026.

Source: JimLiu/baoyu-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.